Search code examples
amazon-web-servicesaws-lambdanodesaws-sdk-nodejs

How get Environment Variables from lambda (nodejs aws-sdk)


We can set up Environment Variables in aws-lambda for example via AWS SAM:

Environment:
    Variables:
      TABLE_NAME: !Ref Table

How can I get this variables from current lambda via Node JS AWS-SDK?


Solution

  • Just as you would any environment variable from node

    const tableName = process.env.TABLE_NAME;