-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
chore(aws-events-targets): fix StepFunctions doc & tests role usage #19178
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.
Pull request has been modified.
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). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
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). |
…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*
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