

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

# Amazon SES の ID ポリシーの例
<a name="identity-authorization-policy-examples"></a>

ID 承認を使用すると、ID の API アクションを許可または拒否する条件をきめ細かく指定することができます。

**Topics**
+ [プリンシパルの指定](#identity-authorization-policy-example-delegate-user)
+ [アクションの制限](#sending-authorization-policy-example-restricting-action)
+ [複数のステートメントの使用](#identity-authorization-policy-example-multiple-statements)

## プリンシパルの指定
<a name="identity-authorization-policy-example-delegate-user"></a>

アクセス許可を付与するエンティティである*プリンシパル*は、、 AWS アカウント AWS Identity and Access Management (IAM) ユーザー、または同じアカウントに属する AWS サービスです。

次の例は、 AWS ID *123456789012* が が所有する AWS アカウント 検証済み ID *example.com* を制御することを許可するシンプルなポリシーを示しています*123456789012*。

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

****  

```
{
  "Id":"SampleAuthorizationPolicy",
  "Version":"2012-10-17",		 	 	 
  "Statement":[
    {
      "Sid":"AuthorizeMarketer",
      "Effect":"Allow",
      "Resource":"arn:aws:ses:us-east-1:123456789012:identity/example.com",
      "Principal":{
        "AWS":[
          "123456789012"
        ]
      },
      "Action":[
        "ses:DeleteEmailIdentity",
        "ses:PutEmailIdentityDkimSigningAttributes"
      ]
    }
  ]
}
```

------

次のポリシー例では、検証済み ID *example.com* を制御するアクセス許可を 2 人のユーザーに付与します。ユーザーは、Amazon リソースネーム (ARN) によって指定されます。

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

****  

```
{
  "Id":"ExampleAuthorizationPolicy",
  "Version":"2012-10-17",		 	 	 
  "Statement":[
    {
      "Sid":"AuthorizeIAMUser",
      "Effect":"Allow",
      "Resource":"arn:aws:ses:us-east-1:123456789012:identity/example.com",
      "Principal":{
        "AWS":[
          "arn:aws:iam::123456789012:user/John",
          "arn:aws:iam::123456789012:user/Jane"
        ]
      },
      "Action":[
        "ses:DeleteEmailIdentity",
        "ses:PutEmailIdentityDkimSigningAttributes"
      ]
    }
  ]
}
```

------

## アクションの制限
<a name="sending-authorization-policy-example-restricting-action"></a>

承認する制御のレベルに応じて、ID 承認ポリシーで指定できる複数のアクションがあります。

```
 1. "BatchGetMetricData",
 2. "ListRecommendations",
 3. "CreateDeliverabilityTestReport",
 4. "CreateEmailIdentityPolicy",
 5. "DeleteEmailIdentity",
 6. "DeleteEmailIdentityPolicy",
 7. "GetDomainStatisticsReport",
 8. "GetEmailIdentity",
 9. "GetEmailIdentityPolicies",
10. "PutEmailIdentityConfigurationSetAttributes",
11. "PutEmailIdentityDkimAttributes",
12. "PutEmailIdentityDkimSigningAttributes",
13. "PutEmailIdentityFeedbackAttributes",
14. "PutEmailIdentityMailFromAttributes",
15. "TagResource",
16. "UntagResource",
17. "UpdateEmailIdentityPolicy"
```

ID 承認ポリシーでは、プリンシパルをそれらのアクションの 1 つだけに制限することもできます。

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

****  

```
{
    "Id": "ExamplePolicy",
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Sid": "ControlAction",
            "Effect": "Allow",
            "Resource": "arn:aws:ses:us-east-1:123456789012:identity/example.com",
            "Principal": {
                "AWS": [
                    "123456789012"
                ]
            },
            "Action": [
                "ses:PutEmailIdentityMailFromAttributes"
            ]
        }
    ]
}
```

------

## 複数のステートメントの使用
<a name="identity-authorization-policy-example-multiple-statements"></a>

ID 承認ポリシーには複数のステートメントを含めることができます。以下のサンプルポリシーには、2 つのステートメントが含まれています。最初のステートメントでは、2 人のユーザーが同じアカウント `123456789012` 内の *sender@example.com* から `getemailidentity` にアクセスすることを拒否します。2 つ目のステートメントでは、同じアカウント `123456789012` 内のプリンシパル *Jack* に対して `UpdateEmailIdentityPolicy` を拒否します。

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

****  

```
{
  "Version":"2012-10-17",		 	 	 
  "Statement":[
    {
      "Sid":"DenyGet",
      "Effect":"Deny",
      "Resource":"arn:aws:ses:us-east-1:123456789012:identity/sender@example.com",
      "Principal":{
        "AWS":[
          "arn:aws:iam::123456789012:user/John", 
          "arn:aws:iam::123456789012:user/Jane"
        ]
      },
      "Action":[
        "ses:GetEmailIdentity"
      ]
    },
    {
      "Sid":"DenyUpdate",
      "Effect":"Deny",
      "Resource":"arn:aws:ses:us-east-1:123456789012:identity/sender@example.com",
      "Principal":{
        "AWS":"arn:aws:iam::123456789012:user/Jack"
      },
      "Action":[
        "ses:UpdateEmailIdentityPolicy"
      ]
    }
  ]
}
```

------