Amazon API Gateway 的 IAM 政策 - AWS Step Functions

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

Amazon API Gateway 的 IAM 政策

下列範例範本顯示如何 AWS Step Functions 根據狀態機器定義中的資源產生 IAM 政策。如需詳細資訊,請參閱 整合式服務的 IAM 政策服務整合模式

資源:

{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "execute-api:Invoke" ], "Resource": [ "arn:[[region]]:[[accountId]]:*" ] } ] }

下列程式碼範例顯示呼叫 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>" ] } } } ] }