Skip to content

fix(lambda): calculateLayersHash includes all stack layers (Reopened)#37295

Open
Abhinandansinha01 wants to merge 2 commits intoaws:mainfrom
Abhinandansinha01:fix/lambda-layer-hash-v2
Open

fix(lambda): calculateLayersHash includes all stack layers (Reopened)#37295
Abhinandansinha01 wants to merge 2 commits intoaws:mainfrom
Abhinandansinha01:fix/lambda-layer-hash-v2

Conversation

@Abhinandansinha01
Copy link
Copy Markdown

Fixes #36713. Reopening my original PR #36818.

Exemption Request: I am unable to generate the integration test snapshot locally on Windows because aws-cdk-lib isn't fully built in my environment. I have provided the functionality and the integration test code. Could a maintainer assist in generating the test snapshot or approve the exemption for the PR checkout? Thanks!

Abhinandan Sinha added 2 commits January 30, 2026 00:21
Previously, calculateFunctionHash was including all layers from the stack (fn._layers) in the hash calculation, even if they were not attached to the function. This caused unrelated layer changes to trigger function updates. This change filters fn._layers to only include those present in the function's CloudFormation properties.

Signed-off-by: Abhinandan Sinha <abhinandansinha239@gmail.com>
@github-actions github-actions bot added bug This issue is a bug. effort/medium Medium work item – several days of effort p2 labels Mar 20, 2026
@aws-cdk-automation aws-cdk-automation requested a review from a team March 20, 2026 11:05
@github-actions github-actions bot added the beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK label Mar 20, 2026
Copy link
Copy Markdown
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.

The pull request linter fails with the following errors:

❌ Fixes must contain a change to an integration test file and the resulting snapshot.

If you believe this pull request should receive an exemption, please comment and provide a justification. A comment requesting an exemption should contain the text Exemption Request. Additionally, if clarification is needed, add Clarification Request to a comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK bug This issue is a bug. effort/medium Medium work item – several days of effort p2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

aws-lambda: calculateLayersHash includes all stack layers instead of only function's layers

2 participants