IAM policies for Amazon API Gateway calls in Step Functions
The following example templates show how Amazon Step Functions generates IAM policies based on the resources in your state machine definition. For more information, see How Step Functions generates IAM policies for integrated services and Discover service integration patterns in Step Functions.
Resources:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"execute-api:Invoke"
],
"Resource": [
"arn:[[region]]
:[[accountId]]
:*"
]
}
]
}
The following code example shows a resource policy for calling API Gateway.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Service": "states.amazonaws.com"
},
"Action": "execute-api:Invoke",
"Resource": "arn:aws:execute-api:<region>
:<account-id>
:<api-id>
/<stage-name>
/<HTTP-VERB>
/<resource-path-specifier>
",
"Condition": {
"StringEquals": {
"aws:SourceArn": [
"<SourceStateMachineArn>
"
]
}
}
}
]
}