Skip to content

Commit 2511956

Browse files
fix(lambda): lambda does not set environment variables for AWS_CODEGURU_PROFILER properties when creating Amazon CodeGuruProfiler profiling group (#28762)
> # Issue > > When `{ profiling: true }` CDK creates a profiling group using autogenerated parameters which is never set as an environment variable. This causes another profiling group with default parameters to be created by the lambda. This can create permissions issues. This is an issue when the Lambda has Java or Python runtime but not other runtimes. > # Solution > > For the python, corretto and jdk11 runtime, they will not look at `AWS_CODEGURU_PROFILER_GROUP_ARN` and will only look at `AWS_CODEGURU_PROFILER_GROUP_NAME` and `AWS_CODEGURU_PROFILER_TARGET_REGION`. Runtimes that support `AWS_CODEGURU_PROFILER_GROUP_ARN` prefer `AWS_CODEGURU_PROFILER_GROUP_NAME` and `AWS_CODEGURU_PROFILER_TARGET_REGION` and fallback onto the ARN. So the solution sets these values as potential environment variables. > # Important Design Decisions > > I changed profiling validation to not error and instead warn the user to have environment variables remain consistent with each other while having no backwards compatibility concerns. > > Remember to follow the [CONTRIBUTING GUIDE] and [DESIGN GUIDELINES] for any > code you submit. > > [CONTRIBUTING GUIDE]: https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md > [DESIGN GUIDELINES]: https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md Closes #23511 . ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 20ad55e commit 2511956

File tree

19 files changed

+35143
-35
lines changed

19 files changed

+35143
-35
lines changed

packages/@aws-cdk-testing/framework-integ/test/aws-lambda/test/integ.bundling.js.snapshot/BundlingDefaultTestDeployAssertAACA0CAF.assets.json

+6-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-lambda/test/integ.bundling.js.snapshot/BundlingDefaultTestDeployAssertAACA0CAF.template.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)