-
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
aws_stepfuntions: Automatic grant for StartExecution not added to default policy #29825
Comments
FYI, I found other strange behavior in this synth regarding policies. I can see both policies generated automatically by CDK in the tree, but just one of them got into the Cloud Formation template. Tree path: |
I am looking at the source here. aws-cdk/packages/aws-cdk-lib/aws-stepfunctions-tasks/lib/stepfunctions/start-execution.ts Line 52 in 72b6d8e
Yes, looks like CDK at this moment does not grant relevant permissions to the parent state machine execution role and might require manual grant instead. This might be improved with a PR and I am making this a p2 feature request. |
Hello, I've found out the issue was caused by my own construct. The permission to execute the nested step function was granted automatically when using the CDK library construct (StateMachine) directly. Sorry for the incovenience. |
|
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. |
Describe the bug
Hello team,
I've noticed this issue after upgrading to cli version 2.137.0.
I have a simple step function that calls a nested step function.
After synthesizing the app, I can see the policy granting access to execute the nested step function in the construct tree. However, the generated cloud formation template does not include the policy and, because of that, when I execute the step function it fails on that step due to lack of authorization.
Expected Behavior
The expected behavior is for CDK to auto-detect the call to a nested step function in the state machine definition and add a policy granting access to execute (StartExecution) the nested sfn.
Current Behavior
The statement that adds StartExecution action on the nested step function ARN is added to the construct tree, but not the Cloud Formation template.
Reproduction Steps
The reproduce the steps I just have to run synth on the project and inspect the construct tree and cloud formation template.
Possible Solution
Please review the process that generates the template based on the tree output I am attaching here.
Additional Information/Context
I am attaching the construct tree generated by synth and the corresponding cloud formation template.
tree.json
OneAiServiceStack.template.json
OneAiServiceStack.assets.json
For reference, I am adding here the code used to create the step function call task. Notice I am not granting access explicitly for the parent step function to be able to execute the nested step function. I expected CDK to do that, like it did in other projects I've done before.
CDK CLI Version
2.137.0
Framework Version
2.88
Node.js Version
18.12.1
OS
macos 12.3.1
Language
TypeScript
Language Version
Typescript 5.4.5
Other information
Additional info: The project was initially setup by projen 0.81.0
The step function reported in this issue can be found in the tree as:
tree / children / OneAiServiceStack / children / PostTxWorkflow / StateMachine / children / Role / DefaultPolicy
The text was updated successfully, but these errors were encountered: