AWS IAM操作cloudformation:GetTemplateSummary仅适用于资源“ *”

时间:2020-09-23 19:00:33

标签: amazon-web-services amazon-cloudformation amazon-iam

我试图创建一个IAM策略,以允许对帐户中的特定资源采取CloudFormation操作。

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "VisualEditor0",
            "Effect": "Allow",
            "Action": [
                "cloudformation:DetectStackDrift",
                "cloudformation:CancelUpdateStack",
                "cloudformation:DescribeStackInstance",
                "cloudformation:DescribeStackResources",
                "cloudformation:SignalResource",
                "cloudformation:DescribeStackResource",
                "cloudformation:CreateChangeSet",
                "cloudformation:DeleteChangeSet",
                "cloudformation:DescribeStacks",
                "cloudformation:ContinueUpdateRollback",
                "cloudformation:DetectStackResourceDrift",
                "cloudformation:DescribeStackResourceDrifts",
                "cloudformation:GetStackPolicy",
                "cloudformation:GetTemplateSummary",
                "cloudformation:DescribeStackEvents",
                "cloudformation:CreateStack",
                "cloudformation:GetTemplate",
                "cloudformation:DeleteStack",
                "cloudformation:TagResource",
                "cloudformation:UpdateStack",
                "cloudformation:DescribeChangeSet",
                "cloudformation:ListChangeSets",
                "cloudformation:ListStackResources"
            ],
            "Resource": [
                "arn:aws:cloudformation:*:*:stack/*/*",
                "arn:aws:cloudformation:*:*:stackset/*:*",
                "arn:aws:cloudformation:*:*:stack",
                "arn:aws:cloudformation:*:*:stackset",
            ]
        }
    ]
}

但是,当我根据保存在S3中的模板(指定S3 URL)创建堆栈时,却被AccessDenied错误阻止。

User is not authorized to perform: cloudformation:GetTemplateSummary

如果添加以下块,则不会遇到错误。

{
  "Effect": "Allow",
  "Action": "cloudformation:GetTemplateSummary",
  "Resource": [
    "*"
  ]
}

我在公司环境中工作,不允许我们使用类似通配符的资源。为该操作指定资源的正确方法是什么?


我找到了有关CloudFormation操作和资源(https://docs.aws.amazon.com/IAM/latest/UserGuide/list_awscloudformation.html)的AWS文档。它说GetTemplateSummary操作具有stackstackset资源类型,但是这些资源在我的原始策略中是允许的。 GetTemplateSummary作用于哪些资源类型?

0 个答案:

没有答案