-
Notifications
You must be signed in to change notification settings - Fork 4k
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: prevent cyclic dependencies created by custom resource provider #32404
Conversation
There was a problem hiding this 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.
✅ A exemption request has been requested. Please wait for a maintainer's review.
9cf34ea
to
763b0f2
Compare
Clarification Request There seems to exist no integration test for custom resource providers. |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
This PR has been in the CHANGES REQUESTED state for 3 weeks, and looks abandoned. To keep this PR from being closed, please continue work on it. If not, it will automatically be closed in a week. |
Exemption Request |
The pull request linter fails with the following errors:
PRs must pass status checks before we can provide a meaningful review. If you would like to request an exemption from the status checks or clarification on feedback, please leave a comment on this PR containing ✅ A exemption request has been requested. Please wait for a maintainer's review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello, thanks for drafting this PR. I'd like to understand what issue were you seeing prior to this change. Is the cyclic dependency causing the deployment to fail?
Yes, the deployment fails with a cyclic dependency error. |
This PR has been deemed to be abandoned, and will be automatically closed. Please create a new PR for these changes if you think this decision has been made in error. |
Comments on closed issues and PRs are hard for our team to see. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #32404 +/- ##
===========================================
- Coverage 78.66% 66.63% -12.03%
===========================================
Files 107 332 +225
Lines 7237 18965 +11728
Branches 1329 3301 +1972
===========================================
+ Hits 5693 12638 +6945
- Misses 1358 6001 +4643
- Partials 186 326 +140
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Thanks for the quick response. I think this is a great place to add an integ test to make sure now it's deployable if we supply a custom |
Unfortunately, I have no clue how an integration test for a custom resource provider could be set up. I would appreciate your help a lot. |
This PR has been deemed to be abandoned, and will be automatically closed. Please create a new PR for these changes if you think this decision has been made in error. |
Comments on closed issues and PRs are hard for our team to see. |
Reason for this change
If both, the
isCompleteHandler
and therole
is set in custom resourceProviderProps
then a resource dependencies cycle results.If
role
is specified then that role is used for all 3 framework lambdas (i.e.onEventFunction
,isCompleteFunction
, andtimeoutFunction
). In order to grant additional required permissions to these functions, a policy is created under the hood. That policy is calledDefaultPolicy
.The
DefaultPolicy
is attached to the givenrole
and includes thelambda:InvokeFunction
permissions for the two handler functions (onEventHandler
andisCompleteHandler
). In addition, theDefaultPolicy
includes thestates:StartExecution
permission that is granted to theonEventFunction
by the call `waiterStateMachine.grantStartExecution(onEventFunction);.This results in the following dependencies cycle:
waiter state machine --(via its description)--> isCompleteFunction / timeoutFunction --(via explicits dependsOn)--> DefaultPolicy --(via resource constraint)--> waiter state machine
If the resource constraint is dropped from the
states:StartExecution
grant then the cyclic dependency is cut.Description of changes
Drop the resource constraint from the
states:StartExecution
grant if an execution role for the framework lambdas is specified.Description of how you validated changes
I tried the following workaround locally:
This workaround applies the proposed modification to the created
DefaultPolicy
.Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license