

# API 実行アクセス許可の IAM ポリシーの例
<a name="api-gateway-iam-policy-examples-for-api-execution"></a>

アクセス権限モデルおよび他の背景情報については、「[API を呼び出すためのアクセスの制御](api-gateway-control-access-using-iam-policies-to-invoke-api.md)」を参照してください。

以下のポリシーステートメントは、識別子が `a123456789` の API の、ステージが `test` の `mydemoresource` のパスで任意の POST メソッドを呼び出す許可をユーザーに付与するもので、対応する API が us-east-1 の AWS リージョンにデプロイされていることを前提としています。

------
#### [ JSON ]

****  

```
{
  "Version":"2012-10-17",		 	 	 
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "execute-api:Invoke"
      ],
      "Resource": [
        "arn:aws:execute-api:us-east-1:*:a123456789/test/POST/my-demo-resource-path/*"
      ]
    }
  ]
}
```

------

以下のポリシーステートメントの例では、任意の `petstorewalkthrough/pets` リージョンの、識別子が `a123456789` の API の、任意のステージの、リソースパスが AWS の、任意のメソッドを呼び出すアクセス権限をユーザーに付与します。ただし、該当する API がそのリージョンにデプロイされているとします。

------
#### [ JSON ]

****  

```
{
  "Version":"2012-10-17",		 	 	 
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "execute-api:Invoke"
      ],
      "Resource": [
        "arn:aws:execute-api:*:*:a123456789/*/*/petstorewalkthrough/pets"
      ]
    }
  ]
}
```

------