gpt4 book ai didi

amazon-web-services - 如何通过 cfn 模板中的策略控制访问?

转载 作者:行者123 更新时间:2023-12-03 07:23:28 25 4
gpt4 key购买 nike

我有一个策略,定义为下面的 cloudformation 模板。我希望能够描述它们可以通过 cfn 模板创建哪些 aws 资源。我怎么做?我在下面附上了一个示例?

Type: 'AWS::IAM::Policy'
Properties:
PolicyName: CFNUsers
PolicyDocument:
Version: "2012-10-17"
Statement:
- Effect: Allow
Action:
- 'cloudformation:Describe*'
- 'cloudformation:List*'
- 'cloudformation:Get*'
Resource: '*'

最佳答案

您的政策包含三个操作:

          - 'cloudformation:Describe*'
- 'cloudformation:List*'
- 'cloudformation:Get*'

这些操作可以在所有 (*) CloudFormation (CFN) 堆栈上执行,而不是在“任何 IAM 角色、用户或其他 AWS 资源”上执行。这是因为使用这三个操作只能对 CFN 堆栈进行操作。

AWS::IAM::Policymanaged IAM policy 。此类策略必须针对 IAM 用户、角色或组进行攻击。这样,您就可以向要将策略附加到的人员/对象授予在 CFN 堆栈上执行三个操作的权限。

关于amazon-web-services - 如何通过 cfn 模板中的策略控制访问?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67825303/

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