aws / aws-cdk

The AWS Cloud Development Kit is a framework for defining cloud infrastructure in code
https://aws.amazon.com/cdk
Apache License 2.0
11.6k stars 3.9k forks source link

(lambda): ParamsAndSecretsVersions should return the latest, or new versions should be made available #31772

Open tomHaum opened 3 days ago

tomHaum commented 3 days ago

Describe the feature

calling

cdk.aws_lambda.ParamsAndSecretsLayerVersion.fromVersion(cdk.aws_lambda.ParamsAndSecretsVersions.V1_0_103)

will always return the lambda layer with a version of 4 for us-east-1. the CDK documentation states that this is the latest version, while the documentation in lambda shows that 14 is the latest in this region.

Can new parameter versions be added to track the latest deployed versions in all regions?

Use Case

we want to stay current with the latest code, ensuring there are no vulnerabilities in old code that is known not to be latest

Proposed Solution

add an additional versions or potentially a LATEST that tracks the lambda latest release per region

Other Information

No response

Acknowledgements

CDK version used

2.151.0

Environment details (OS name and version, etc.)

Ubuntu 22.04.3 LTS x86

tomHaum commented 3 days ago

added a draft PR to show my approach of implementation. I can update with more docs/unit tests if this approach is acceptable and would get this merged in sooner

khushail commented 2 days ago

Hey @tomHaum , Thanks for reaching out and submitting a PR. You could reach out to community reviewer to review your PR , by mentioning in cdk.dev community channel.