Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅
中国的 Amazon Web Services 服务入门
(PDF)。
本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。
Amazon ECS 服务扩展执行区块策略示例
如果您向 Amazon ECS 服务扩展的区域切换计划中添加执行块,则需要附加以下示例策略。
- JSON
-
-
{
"Version":"2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ecs:DescribeServices",
"ecs:UpdateService"
],
"Resource": [
"arn:aws:ecs:us-east-1:123456789012:service/app-cluster-primary/app-service",
"arn:aws:ecs:us-west-2:123456789012:service/app-cluster-secondary/app-service"
]
},
{
"Effect": "Allow",
"Action": [
"ecs:DescribeClusters"
],
"Resource": [
"arn:aws:ecs:us-east-1:123456789012:cluster/app-cluster-primary",
"arn:aws:ecs:us-west-2:123456789012:cluster/app-cluster-secondary"
]
},
{
"Effect": "Allow",
"Action": [
"ecs:ListServices"
],
"Resource": "*"
},
{
"Effect": "Allow",
"Action": [
"application-autoscaling:DescribeScalableTargets",
"application-autoscaling:RegisterScalableTarget"
],
"Resource": "*"
},
{
"Effect": "Allow",
"Action": [
"cloudwatch:GetMetricStatistics"
],
"Resource": "*"
}
]
}