Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix(lambda): deprecate feature flag @aws-cdk/aws-lambda:createNewPoliciesWithAddToRolePolicy #33689

Open
wants to merge 28 commits into
base: main
Choose a base branch
from

Conversation

QuantumNeuralCoder
Copy link
Contributor

Issue # (if applicable)

#33688

Closes #.
33688

Reason for this change

Described in the #33688

Description of changes

Set default value of feature flag to false.
Updated description to indicate deprecated feature flag.
Update description to describe the race condition issue which led to this decision.

N/A

Describe any new or updated permissions being added

N/A

Description of how you validated changes

N/A

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 p2 beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK labels Mar 4, 2025
@aws-cdk-automation aws-cdk-automation requested a review from a team March 4, 2025 22:59
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.

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.

@QuantumNeuralCoder QuantumNeuralCoder added the pr/do-not-merge This PR should not be merged at this time. label Mar 4, 2025
@QuantumNeuralCoder QuantumNeuralCoder removed the pr/do-not-merge This PR should not be merged at this time. label Mar 4, 2025
Copy link

codecov bot commented Mar 4, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.37%. Comparing base (77b6fa9) to head (2fcf9c5).
Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #33689      +/-   ##
==========================================
+ Coverage   82.24%   82.37%   +0.13%     
==========================================
  Files         119      120       +1     
  Lines        6875     6933      +58     
  Branches     1161     1169       +8     
==========================================
+ Hits         5654     5711      +57     
- Misses       1118     1119       +1     
  Partials      103      103              
Flag Coverage Δ
suite.unit 82.37% <ø> (+0.13%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
packages/aws-cdk ∅ <ø> (∅)
packages/aws-cdk-lib/core 82.37% <ø> (+0.13%) ⬆️
🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment on lines 621 to 623
However in the current implementation, we have removed a dependency of the lambda function on the policy. In addition to this, a Role will be attached to the Policy instead of an inline policy being attached to the role.
This will create a data race condition in the CloudFormation template because the creation of the Lambda function no longer waits for the policy to be created.
We recommend to unset the feature flag if already set which will restore the original behavior.
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should mention if people are okay with the fact that lambda may be created before policy, and they're experiencing circular dependency issue, they can consider setting it to true.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

addressed.

@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Mar 6, 2025
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: 2fcf9c5
  • Result: FAILED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK contribution/core This is a PR that came from AWS. p2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants