User is not authorized to perform: cloudformation:CreateStack

后端 未结 11 1654
天涯浪人
天涯浪人 2021-01-31 01:37

I\'m trying out Serverless to create AWS Lambdas and while creating a project using the command serverless project create I\'m getting the following error.

相关标签:
11条回答
  • 2021-01-31 01:56

    Give "administrator" access to the user you created

    0 讨论(0)
  • 2021-01-31 02:03

    I fixed this issue by adding the permission to the user in the AWS console:

    1. Go to AWS Console
    2. Find the user whose credentials you are using IAM > Access Management > Users
    3. Permissions > 'Add Permissions' > 'Attach existing policies directly'
    4. Search for and select 'AWSCloudFormationFullAccess'
    0 讨论(0)
  • 2021-01-31 02:12

    I wasn't able to get the shorter versions shown above to work; what fixed things for me was extending @mancvso 's answer slightly to add "cloudformation:GetTemplateSummary":

    {
        "Version": "2012-10-17",
        "Statement": [
            {
                "Sid": "Stmt1449904348000",
                "Effect": "Allow",
                "Action": [
                    "cloudformation:CreateStack",
                    "cloudformation:CreateChangeSet",
                    "cloudformation:ListStacks",
                    "cloudformation:UpdateStack",
                    "cloudformation:DescribeStacks",
                    "cloudformation:DescribeStackResource",
                    "cloudformation:DescribeStackEvents",
                    "cloudformation:ValidateTemplate",
                    "cloudformation:DescribeChangeSet",
                    "cloudformation:ExecuteChangeSet",
                    "cloudformation:GetTemplateSummary"
                ],
                "Resource": [
                    "*"
                ]
            }
        ]
    }
    
    0 讨论(0)
  • 2021-01-31 02:14

    In my recent experience the policy required was

    {
        "Version": "2012-10-17",
        "Statement": [
            {
                "Sid": "Stmt1449904348000",
                "Effect": "Allow",
                "Action": [
                    "cloudformation:CreateStack",
                    "cloudformation:CreateChangeSet",
                    "cloudformation:ListStacks",
                    "cloudformation:UpdateStack",
                    "cloudformation:DescribeStacks",
                    "cloudformation:DescribeStackResource",
                    "cloudformation:DescribeStackEvents",
                    "cloudformation:ValidateTemplate",
                    "cloudformation:DescribeChangeSet",
                    "cloudformation:ExecuteChangeSet"
                ],
                "Resource": [
                    "*"
                ]
            }
        ]
    }
    
    0 讨论(0)
  • 2021-01-31 02:16

    With the recent updates in AWS, the following inline policy will also work.

    {
       "Version": "2012-10-17",
       "Statement": [
           {
                "Sid": "VisualEditor0",
                "Effect": "Allow",
                "Action": [
                    "cloudformation:DeleteStack"
                ],
                "Resource": "*"
            }
        ]
    }
    
    0 讨论(0)
提交回复
热议问题