amazon-web-services - 仅允许 IAM 访问 Route 53 上的特定子域

标签 amazon-web-services dns amazon-iam amazon-route53

我需要授予 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/

相关文章:

amazon-web-services - API网关的ARN角色以启用日志错误

amazon-web-services - 允许用户创建 IAM 角色的 AWS IAM 策略(从管理控制台和 AWS CLI)

python - 在 amazon lambda 中使用 moviepy、scipy 和 numpy

java - AWS S3 与 Spring Boot 错误 "profile file cannot be null"

c - 替代 gethostbyname 我可以在哪里选择 DNS 服务器?

c - 解析 url 或 ip 地址并计算 c 中每次出现之前的字长?

amazon-web-services - AWS - 为现有 IAM 用户创建独立沙箱

python - AWS Elastic Beanstalk Django - 部署到 EB 时首先发生什么,pip install -r requirements.txt 或配置文件中的命令

amazon-web-services - aws cloudformation 中的映射。 Fn::FindInMap 对象需要三个参数

ssl - Heroku SSL - 更新 DNS 条目