If you want to get the values of Environment Variables in AWS Lambda using Node.js runtime follow the instructions below.
Node.js Code to Access Environment Variables
To access the Environment Variables of Lambda Functions using Node.js or javascript simply use the code below.
const environmentVariable = process.env.ENVIRONMENT_VARIABLE
Let’s say that my environment variable has a name of DB_USER
, I will use the code below to get its value.