I created a Nodejs Lambda function to use Environment variables based on: AWS Lambda Environment Variables - AWS Lambda
And I tried to access the environment with process.env but it does not work.
Here is my code:
exports.handler = async (event) => {
console.log('The A varialbe is: ', process.env.A)
console.log('\n')
console.log('The all varialbes in process.env is: ', process.env)
// TODO implement
const response = {
statusCode: 200,
body: JSON.stringify('Hello from Lambda!'),
};
return response;
};
You can see I already set a variable here:
But process.env.A return undefined and in process.env it does not contain my variable A
You can see actual result here:



[a-zA-Z]([a-zA-Z0-9_])+AAinsteadA, it works for me.[a-zA-Z]([a-zA-Z0-9_])+where you find it, I can not find it in docs.