aws / aws/aws-cdk

(aws-lambda): Option to always use the LATEST lambda insightsVersion

Open
#34,261 1 comment 0 reactions 0 assignees View on GitHub
@aws-cdk/aws-lambda effort/medium feature-request p2
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
2d 3h
Merged PRs (30d)
83

Description

### Describe the feature

Currently, CDK users must manually specify a exact LambdaInsightsVersion when adding Lambda Insights monitoring to their Lambda functions. However, Lambda Insights and OTEL layers are updated regularly with important bug fixes and security patches. Tracking and manually updating these versions across all regions is tedious and error-prone.

https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.LambdaInsightsVersion.html

### Use Case

Automatically using the latest available LambdaInsightsVersion in CDK without having to specify the exact version.

### Proposed Solution

Introduce a new enum value LambdaInsightsVersion.LATEST in the CDK library:
- It would resolve to the latest available stable version of the Lambda Insights layer for the deployment region.
- CDK would maintain and update this version mapping internally, removing the burden from developers.
- This allows teams to opt into always receiving the latest bug fixes and improvements without having to track and manually update versions.

### Other Information

_No response_

### Acknowledgements

- [ ] I may be able to implement this feature request
- [ ] This feature might incur a breaking change

### CDK version used

2.185.0

### Environment details (OS name and version, etc.)

macOS 15.4.1

Contributor guide

Open the contributing guide

Research direction

Start by reading the LambdaInsightsVersion API documentation linked in the issue and locating the existing Lambda Insights layer version definitions in the CDK library. Determine how regional versions are represented and how the latest stable version would be selected. Done means a LATEST option resolves correctly for each deployment region without requiring users to specify an exact version.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript
Domain
cloud, infrastructure
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.