chore(aws-events-targets): fix StepFunctions doc & tests role usage#19178
Merged
mergify[bot] merged 9 commits intoaws:masterfrom Mar 8, 2022
knightjoel:fix/events_statemachine_fixes
Merged
chore(aws-events-targets): fix StepFunctions doc & tests role usage#19178mergify[bot] merged 9 commits intoaws:masterfrom knightjoel:fix/events_statemachine_fixes
mergify[bot] merged 9 commits intoaws:masterfrom
knightjoel:fix/events_statemachine_fixes
Conversation
The role needs to be passed to the SfnStateMachine target, not to the StateMachine resource. The role's trust policy trusts events.amazonaws.com so the state machine resource would be unable to use this role anyways. Leave the StateMachine construct to create its own role. Instead, pass the role to SfnStateMachine where EventBridge will use it to start the state machine.
The role should be passed to the SfnStateMachine target, not to the StateMachine resource: the role is for EventBridge to start the state machine, not for the state machine to assume. While this change won't affect the results of these tests, it makes the code correct and would prevent future propagation of the error via copy/paste or others reading the tests to learn how to implement this pattern.
rix0rrr
previously approved these changes
Feb 27, 2022
Pull request has been modified.
rix0rrr
approved these changes
Mar 8, 2022
Contributor
|
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Collaborator
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Contributor
|
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
TheRealAmazonKendra
pushed a commit
to TheRealAmazonKendra/aws-cdk
that referenced
this pull request
Mar 11, 2022
…ws#19178) The role used in the aws-events-targets example and test code needs to be passed to the SfnStateMachine target, not to the StateMachine resource. The role's trust policy trusts events.amazonaws.com so the state machine resource would be unable to use this role anyways. This PR modifies the example in README.md and the test code to have the StateMachine construct create its own role and pass the manually created role to SfnStateMachine where EventBridge will use it to start the state machine. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The role used in the aws-events-targets example and test code needs to be passed to the SfnStateMachine target, not to the StateMachine resource.
The role's trust policy trusts events.amazonaws.com so the state machine resource would be unable to use this role anyways. This PR modifies the example in README.md and the test code to have the StateMachine construct create its own role and pass the manually created role to SfnStateMachine where EventBridge will use it to start the state machine.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license