我需要授予 IAM 用户 Route 53 访问权限以在子域下创建记录,例如 data.example.com
.例如,用户应该能够为 server1.data.example.com
创建一个 CNAME。 .同时,我不希望用户能够添加/修改/删除除 *.data.example.com
之外的任何记录。 .
是否有可能编写一个这样做的策略?
最佳答案
您可以按托管区域进行限制,但不能按子域进行限制。如果您想限制到特定的子域,您的 Route53 托管区域应按子域进行拆分。您可以create a hosted zone for a subdomain :
例如,如果您想要一个名为 test
的子域你可以作为答案 here总结得很好:
Create a hosted zone for test.example.com.
Note the 4 name servers that Route 53 assigns to it the new hosted zone.
Back in the master zone, create a new resource record, with hostname "test" using record type NS, and enter the 4 name servers that Route 53 assigned, in the box below.
以上将子域的控制权委托(delegate)给这个新的托管区域,它有一个唯一的区域 ID,我们可以在 IAM 策略中使用
然后,您可以构建一个 IAM 策略来限制对该区域的操作:
{
"Statement":[
{
"Action":[
"route53:*"
],
"Effect":"Allow",
"Resource":[
"arn:aws:route53:::hostedzone/<The new zone ID>"
]
},
{
"Action":[
"route53:ListHostedZones"
],
"Effect":"Allow",
"Resource":[
"*"
]
}
]
}
从这里您可以调整此策略以适应您希望用户能够在此区域中执行的操作。
关于amazon-web-services - 仅允许 IAM 访问 Route 53 上的特定子域,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50594808/