gpt4 book ai didi

aws-cloudformation - 用于更新 IAM 角色策略的 CloudFormation 模板

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

是否可以创建一个 CloudFormation 模板,将 IAM 角色的 ARN 作为输入并更新分配给它的策略以添加更多权限?我尝试与 CloudFormation 设计器合作,但它非常困惑且不简单,

最佳答案

是的,您可以使用如下模板来执行此操作:


Description: Add policy to existing role

Parameters:

MyExistingRoleName:
Type: String
Description: Name of the Role you want to add a policy to

Resources:

MyNewPolicy:
Type: AWS::IAM::Policy
Properties:
PolicyName: "my-new-policy"
PolicyDocument:
Version: "2012-10-17"
Statement:
- Effect: Allow
Action:
- "s3:ListAllMyBuckets"
Resource:
- "*"
Roles:
- !Ref MyExistingRoleName

关于aws-cloudformation - 用于更新 IAM 角色策略的 CloudFormation 模板,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71125651/

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