【问题标题】:CloudFormation change set User not authorizedCloudFormation 更改集用户未授权
【发布时间】:2019-07-22 02:54:08
【问题描述】:

我正在尝试将 aws lambda 发布到我的客户 aws 帐户,但是我不断收到此错误消息。

Error creating CloudFormation change set: User: arn:aws:iam::xxxxxx:user/testuser is not authorized to perform: cloudformation:CreateChangeSet on resource: arn:aws:cloudformation:eu-west-1:xxxx:stack/test-Stack/*

当我在自己的帐户上进行测试时,我添加了一个“AdministratorAccess”策略,它基本上允许一切。

我检查了只有“CloudFormationReadonlyAccess”的政策,但这些政策不允许写入/删除。我应该要求我的客户为 IAM 用户分配什么策略?

我也尝试添加到我的角色

"cloudformation:CreateStack",
"cloudformation:CreateChangeSet",
"cloudformation:ListStacks",
"cloudformation:UpdateStack",
"cloudformation:DescribeStacks",
"cloudformation:DescribeStackResource",
"cloudformation:DescribeStackEvents",
"cloudformation:ValidateTemplate",
"cloudformation:DescribeChangeSet",
"cloudformation:ExecuteChangeSet"

但同样的错误发生了。

【问题讨论】:

    标签: aws-lambda amazon-cloudformation aws-serverless


    【解决方案1】:

    您需要指定允许执行这些操作的资源。具体的

          - Action:
            - cloudformation:CreateStack
            - cloudformation:DeleteStack
            - cloudformation:UpdateStack
            - cloudformation:DescribeStacks
            - cloudformation:DescribeChangeSet
            - cloudformation:CreateChangeSet
            - cloudformation:DeleteChangeSet
            - cloudformation:ExecuteChangeSet
            Effect: Allow
            Resource:
            - !Join
              - ':'
              - - arn
                - aws
                - cloudformation
                - !Ref 'AWS::Region'
                - !Ref 'AWS::AccountId'
                - !Join
                  - /
                  - - stack
                    - test-stack
                    - '*'
    

    还要检查 sts:AssumeRole 服务是 cloudformation.amazonaws.com

    【讨论】:

      猜你喜欢
      • 2021-02-24
      • 2022-08-19
      • 2014-07-26
      • 2020-12-18
      • 2017-06-12
      • 2015-10-21
      • 1970-01-01
      • 2019-03-07
      • 1970-01-01
      相关资源
      最近更新 更多