aws-lambda-nodejs: Bundled environment variables aren't present in CF template #26893
Labels
@aws-cdk/aws-lambda-nodejs
bug
This issue is a bug.
needs-triage
This issue or PR still needs to be triaged.
Describe the bug
Environment variables specified in the
NodejsFunctionProps.bundling.environment
key in theNodejsFunction
constructor don't appear in the outputted CloudFormation template, or inprocess.env
in the function's handler.Expected Behavior
Values specified in
NodejsFunctionProps.bundling.environment
should be present in the CloudFormation template and inprocess.env
in the function handler.Current Behavior
Values don't appear in CloudFormation template and are
undefined
in the function's handler when accessed viaprocess.env
.Reproduction Steps
Code and reproduction steps can be found in this repo: https://github.com/ashtonmoomoo/aws-lambda-nodejs-bug
Possible Solution
No response
Additional Information/Context
Work around at the moment is to add them to the function manually with
this.addEnvironment(key, value)
.CDK CLI Version
2.92.0 (build bf62e55)
Framework Version
No response
Node.js Version
v18.7.0
OS
macOS Ventura 13.4.1 (c)
Language
Typescript
Language Version
Typescript 5.1.6
Other information
No response
The text was updated successfully, but these errors were encountered: