I am facing a persistent AccessDeniedException when trying to execute nested AWS Step Functions in my test environment. The same setup works perfectly in my Integration environment.
child-state-machine-1 and child-state-machine-2 are parallel steps. Giving error in both of these parallel steps.
{
"cause": "User: arn:aws:sts::1234556:assumed-role/SomeRole/xyz is not authorized to access this resource (Service: AWSStepFunctions; Status Code: 400; Error Code: AccessDeniedException; Request ID: SomeID; Proxy: null)",
"error": "StepFunctions.AWSStepFunctionsException",
"resource": "startExecution.sync",
"resourceType": "states"
}
Setup details:
I have a state machine (main-state-machine) that starts other state machines via states:StartExecution or states:StartSyncExecution.
The IAM role main-state-machine-role is used, and I have attached the following policy (see below) both in Terraform and via the AWS Console:
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"states:StartExecution",
"states:StartSyncExecution"
],
"Effect": "Allow",
"Resource": [
"arn:aws:states:REGION:ACCOUNT_ID:stateMachine:child-state-machine-1",
"arn:aws:states:REGION:ACCOUNT_ID:stateMachine:child-state-machine-2",
"arn:aws:states:REGION:ACCOUNT_ID:stateMachine:child-state-machine-3"
]
}
]
}
Things I have checked:
The IAM policy is correctly attached to the role in the staging environment (verified in AWS Console).
The state machine ARNs in the policy exactly match the actual state machine ARNs.
There is no problem in development env (same policy and role setup, works fine).
What could be the cause of this AccessDeniedException in staging, even though the policy and ARNs are correct and the same setup works in integration?