I have the following step function that I'm trying to create in AWS:
{
"StartAt": "Creating metadata stack",
"States": {
"Creating metadata stack": {
"Type": "Task",
"Resource": "arn:aws:states:::states:startExecution.sync:2",
"Parameters": {
"Input": {
"AwsStage.$": "$.AwsStage",
"AwsMasterRegion.$": "$.AwsMasterRegion",
"StackName": "my-stack-name",
"StackFilename": "my-stack-template.yml",
"AWS_STEP_FUNCTIONS_STARTED_BY_EXECUTION_ID.$": "$$.Execution.Id"
},
"StateMachineArn": "<my_state_machine_arn>"
},
"Catch": [
{
"ErrorEquals": [
"UNHEALTHY_STACK"
],
"Next": "Stack exists but it is not healthy"
}
],
"Next": "Stack exists and is healthy"
},
"Stack exists and is healthy": {
"Type": "Succeed"
},
"Stack exists but it is not healthy": {
"Type": "Fail"
}
}
}
When I click Save
I get the following error:
Just that red tag, no details at all.
So I started trimming the code to see what could be wrong and I found that if I use arn:aws:states:::states:startExecution
instead of arn:aws:states:::states:startExecution.sync:2
it saves.
Does anyone have experienced something weird like this?
You are likely getting this error because you do not have the permissions for EventBridge. Step Functions uses EventBridge Managed Rules to provide the .sync "Run a Job" integration pattern. These allow Step Functions to complete your task quickly in reaction ton an event when the job completes (as opposed to polling the Describe API Action, which is still done as a backstop).
You can learn more about the necessary permissions in the documentation topic on IAM Policies for integrated services.