Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

fix(custom-resources): fix circular dependency when a custom role provided to Provider #33600

Merged
merged 7 commits into from
Mar 6, 2025

Conversation

GavinZZ
Copy link
Contributor

@GavinZZ GavinZZ commented Feb 27, 2025

Issue # (if applicable)

Closes #20360

Reason for this change

When users specify a isCompletehandler and specifies a custom role for the provider framework, the output template is not deployable due to circular dependencies.

Description of changes

The change here is to deprecate the old role property because this role is shared between the 3 framework lambda functions. The state machine will depends on the sfn default policy. The default policy depends on isCompleteLambda (granting invoke function permission). isCompleteLambda depends on common default role policy. The common role default policy has startExecution permission to SFN.

The solution is to deprecate role and introduce new roles for the onEvent lambda and isComplete/onTimeout lambda

Describe any new or updated permissions being added

N/A

Description of how you validated changes

New tests

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 the p2 label Feb 27, 2025
@aws-cdk-automation aws-cdk-automation requested a review from a team February 27, 2025 01:29
@GavinZZ GavinZZ changed the title fix(custom-resources): fix circular dependency when a custom role is … fix(custom-resources): fix circular dependency when a custom role provided to Provider Feb 27, 2025
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Feb 27, 2025
@github-actions github-actions bot added bug This issue is a bug. effort/small Small work item – less than a day of effort p1 and removed p2 labels Feb 27, 2025
@GavinZZ
Copy link
Contributor Author

GavinZZ commented Feb 27, 2025

Creating this PR on behalf of @swachter #32404 by adding integration test.

Copy link

codecov bot commented Feb 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.24%. Comparing base (7f5bf4e) to head (ddd8768).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #33600   +/-   ##
=======================================
  Coverage   82.24%   82.24%           
=======================================
  Files         119      119           
  Lines        6875     6875           
  Branches     1161     1161           
=======================================
  Hits         5654     5654           
  Misses       1118     1118           
  Partials      103      103           
Flag Coverage Δ
suite.unit 82.24% <ø> (ø)

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.24% <ø> (ø)
🚀 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.

@GavinZZ GavinZZ force-pushed the yuanhaoz/fix-cyclic-dependency branch from db043a2 to d669aae Compare March 3, 2025 21:27
@GavinZZ GavinZZ marked this pull request as ready for review March 3, 2025 22:44
@aws-cdk-automation aws-cdk-automation added the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Mar 3, 2025
@shikha372 shikha372 self-assigned this Mar 5, 2025
@aws-cdk-automation aws-cdk-automation removed the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Mar 6, 2025
Copy link
Contributor

mergify bot commented Mar 6, 2025

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: ddd8768
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

Copy link
Contributor

mergify bot commented Mar 6, 2025

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mergify mergify bot merged commit 77b6fa9 into main Mar 6, 2025
20 checks passed
@mergify mergify bot deleted the yuanhaoz/fix-cyclic-dependency branch March 6, 2025 20:31
Copy link

github-actions bot commented Mar 6, 2025

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 6, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug This issue is a bug. contribution/core This is a PR that came from AWS. effort/small Small work item – less than a day of effort p1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(aws-cdk-lib/custom-resources): L2 Provider construct generate circular dependency
4 participants