- 
                Notifications
    You must be signed in to change notification settings 
- Fork 4.3k
Description
Describe the bug
Deploying a map state in a state machine using distributed processing mode (and standard execution type for the child executions) causes an IAM permissions issue since the parent state machine role doesn't have permission to start executions on itself. Trying to grant permissions via stateMachine.grantStartExecution(stateMachine) causes a circular dependency.
Expected Behavior
When using distributed processing mode, necessary permissions should be generated by default.
Current Behavior
Start execution permission for the child executions is not granted to the parent state machine.
Reproduction Steps
const mapState = new Map(this, 'Map State', {
  itemsPath: JsonPath.stringAt('$...'),
  maxConcurrency: 100,
   parameters: {
    ...
   }
})
mapListings.itemProcessor(..., {
  executionType: ProcessorType.STANDARD,
  mode: ProcessorMode.DISTRIBUTED
})Possible Solution
Automatically add the necessary IAM policy to the parent state machine's default role
Additional Information/Context
No response
CDK CLI Version
2.122.0 (build 7e77e02)
Framework Version
No response
Node.js Version
v18.16.1
OS
MacOS Sonoma 14.0 (M2 Pro)
Language
TypeScript
Language Version
No response
Other information
technically I am using vanilla JS CDK language but that's not an option in the language dropdown.