Skip to content

Conversation

@nikovirtala
Copy link
Contributor

Issue # (if applicable)

Closes #36190

Reason for this change

I wanted to provide the aws-cdk-lib Lambda Function constructs users an easy way to start using Amazon CloudWatch Application Signals.

Description of changes

I added new regional facts for the layer ARNs and the methods to find the correct layer for the specified Runtime, with necessary compatibility checks.

Describe any new or updated permissions being added

The usage requires attaching a policy to the Lambda execution IAM Role. I left it intentionally as a manual step, but I want to discuss with the maintainer whether it could be abstracted away. I thought it will be easier around the code?

Description of how you validated changes

Unit and integration tests are covering the implementation.

Checklist


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@github-actions github-actions bot added effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2 valued-contributor [Pilot] contributed between 6-12 PRs to the CDK labels Nov 28, 2025
@aws-cdk-automation aws-cdk-automation requested a review from a team November 28, 2025 09:48
Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(This review is outdated)

@nikovirtala nikovirtala force-pushed the feat/aws-lambda-application-signals branch from 4beed7a to ff0f5c3 Compare November 28, 2025 11:15
@nikovirtala nikovirtala changed the title feat(aws-lambda): support for application signals layers feat(lambda): support for application signals layers Nov 28, 2025
@aws-cdk-automation aws-cdk-automation dismissed their stale review November 28, 2025 11:17

✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.

@nikovirtala
Copy link
Contributor Author

Now that I'm looking at the implementation, it could've also been simply a boolean applicationSignalsEnabled: true | false. I suppose it still may be, if you think it is better than this approach, which reuses the existing adotInstrumentation structure.

@nikovirtala
Copy link
Contributor Author

I would like the API to clearly distinguish the wrapper used by Application Signals, but jsii disagrees:

aws-cdk-lib: aws-lambda/lib/adot-layers.ts:306:3 - error JSII1004: Value '/opt/otel-instrument' is used for multiple enum values: INSTRUMENT_HANDLER, APPLICATION_SIGNALS
Error: aws-cdk-lib: aws-lambda/lib/function.ts:1528:9 - error TS2367: This comparison appears to be unintentional because the types 'AdotLambdaExecWrapper.REGULAR_HANDLER | AdotLambdaExecWrapper.PROXY_HANDLER | AdotLambdaExecWrapper.STREAM_HANDLER | AdotLambdaExecWrapper.SQS_HANDLER' and 'AdotLambdaExecWrapper.INSTRUMENT_HANDLER' have no overlap.

What's the idiomatic way in aws-cdk-lib to deal with issues like this?

@nikovirtala nikovirtala force-pushed the feat/aws-lambda-application-signals branch 4 times, most recently from c34111d to 8c10a69 Compare November 28, 2025 19:51
@aws-cdk-automation aws-cdk-automation added the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Nov 28, 2025
@nikovirtala nikovirtala force-pushed the feat/aws-lambda-application-signals branch from 8c10a69 to bd016e3 Compare November 28, 2025 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2 pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. valued-contributor [Pilot] contributed between 6-12 PRs to the CDK

Projects

None yet

Development

Successfully merging this pull request may close these issues.

(aws-lambda-nodejs): Application Signals configuration

2 participants