翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。
Amazon SES の ID ポリシーの例
ID 承認を使用すると、ID の API アクションを許可または拒否する条件をきめ細かく指定することができます。
以下の例は、API アクションのさまざまな側面を制御するポリシーを記述する方法を示しています。
プリンシパルの指定
アクセス許可を付与するエンティティであるプリンシパルは、、 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"
]
}
]
}
アクションの制限
承認する制御のレベルに応じて、ID 承認ポリシーで指定できる複数のアクションがあります。
"BatchGetMetricData",
"ListRecommendations",
"CreateDeliverabilityTestReport",
"CreateEmailIdentityPolicy",
"DeleteEmailIdentity",
"DeleteEmailIdentityPolicy",
"GetDomainStatisticsReport",
"GetEmailIdentity",
"GetEmailIdentityPolicies",
"PutEmailIdentityConfigurationSetAttributes",
"PutEmailIdentityDkimAttributes",
"PutEmailIdentityDkimSigningAttributes",
"PutEmailIdentityFeedbackAttributes",
"PutEmailIdentityMailFromAttributes",
"TagResource",
"UntagResource",
"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"
]
}
]
}
複数のステートメントの使用
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"
]
}
]
}