amazon-web-services - Allowing IAM access to only a specific subdomain on Route 53
问题描述
I need to give an IAM user Route 53 access to create records under a subdomain, say data.example.com
. For example, the user should be able to create a CNAME for server1.data.example.com
. At the same time, I don't want the user to be able to add/modify/delete any records other than *.data.example.com
.
Is it possible to write a policy that does that?
解决方案
您可以按托管区域进行限制,但不能按子域进行限制。如果您想限制到特定的子域,您的 Route53 托管区域应按子域进行拆分。您可以为子域创建托管区域:
例如,如果您想要一个名为的子域test
,您可以这样做,因为这里的答案总结得很好:
为 test.example.com 创建一个托管区域。
请注意 Route 53 为其分配新托管区域的 4 个名称服务器。
返回主区域,创建一个新的资源记录,主机名为“test”,记录类型为 NS,并在下面的框中输入 Route 53 分配的 4 个名称服务器。
以上将子域的控制权委托给这个新的托管区域,它有一个唯一的区域 ID,我们可以在 IAM 策略中使用
然后,您可以构建一个 IAM 策略来限制对该区域的操作:
{
"Statement":[
{
"Action":[
"route53:*"
],
"Effect":"Allow",
"Resource":[
"arn:aws:route53:::hostedzone/<The new zone ID>"
]
},
{
"Action":[
"route53:ListHostedZones"
],
"Effect":"Allow",
"Resource":[
"*"
]
}
]
}
从这里您可以调整此策略以适应您希望用户能够在此区域中执行的操作。
推荐阅读
- android - 您能否将链接传递给更新可用性检查器以检查应用内更新功能是否运行良好?
- c# - EF Core - 更新插入后获取新的 ID,然后使用它们将新实体添加到数据库
- r - as.Date() 没有提及“起源”
- java - 在 y 轴第一列甘特高图中添加弹出窗口
- javascript - 在 react.js 中添加自定义对话框
- python - 这个图中有没有自环?如果你我怎么能删除它并用另一个没有自环的图检查同构?
- c++ - Eigen3中两个矩阵之间的Frobenius内积
- swiftui - ZStack 顶部的 ScrollView
- html - 如何设置溢出而不影响表中的主行?
- shopify - 向 Shopify ajax 购物车添加折扣