Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(lambda): lambda does not set environment variables for `AWS_CODEG…
…URU_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*
- Loading branch information