gpt4 book ai didi

amazon-web-services - 在 IAM 策略中引用 AWS 帐号

转载 作者:行者123 更新时间:2023-12-04 01:35:09 26 4
gpt4 key购买 nike

为了自动化,我希望我的 IAM 策略是通用的。

我知道 ${aws:username} 获取它所应用到的策略的用户名。

是否可以在 IAM 策略中使用类似 arn:aws:iam::1234567890:user/${aws:username} 的内容对 AWS 帐号 arn:aws:iam::${aws:accountnumber}:user/${aws:username} 执行相同操作。

编辑:
允许的变量列在下面链接的文档中。
https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_variables.html

最佳答案

AWS IAM 策略变量不允许引用 AWS 账户名称。因此,没有替代方法可以在 IAM 策略中动态引用帐号。

关于amazon-web-services - 在 IAM 策略中引用 AWS 帐号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50192326/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com