I want to update the environment variable for a Lambda function and this the code that I am using currently.
const AWS = require("aws-sdk");
exports.handler = async (event, context) => {
const res = await updateConfig("test");
};
async function updateConfig(funcName) {
const lambda = new AWS.Lambda({
region: "us-east-2"
});
const params = {
FunctionName: funcName,
Environment: {
Variables: {
"debug": true
}
}
};
const data = await lambda.updateFunctionConfiguration(params).promise();
return data;
}
Currently this code doesn't work as I am trying to set the environment variable debug to true but it can only be a string and not a boolean.