Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS SAM - Failed to create the changeset: Waiter ChangeSetCreateComplete failed

AWS SAM deploying codebase to AWS cloud using aws-sam-cli but it throw me below error.

Failed to create the changeset: Waiter ChangeSetCreateComplete failed: Waiter encountered a terminal failure state Status: FAILED. Reason: Requires capabilities : [CAPABILITY_IAM]

like image 596
Sagar Avatar asked Sep 08 '18 12:09

Sagar


People also ask

What is a change set in AWS CloudFormation?

If you create a change set for a stack that doesn't exist, the change set shows all of the resources that AWS CloudFormation will create. If you create a change set for an existing stack, AWS CloudFormation compares the stack's information with the information that you submit in the change set and lists the differences.

Why am I getting errors when running AWS CLI commands?

Note: If you receive errors when running AWS Command Line Interface (AWS CLI) commands, make sure that you’re using the most recent AWS CLI version. If you receive the following error: There was an error creating this change set. As part of the import operation, you cannot modify or add [Outputs] Try these troubleshooting steps: 1.

Why do I get an import error in AWS?

Note: This error occurs when a change set of type IMPORT is created using the AWS CLI or AWS SDK and contains modified or added stack attributes. This error is thrown when an existing resource is modified during a resource import operation. During an import operation, create, update, and delete operations are not permitted.

How does AWS CloudFormation recognize the differences between stacks?

If you create a change set for an existing stack, AWS CloudFormation compares the stack's information with the information that you submit in the change set and lists the differences.


2 Answers

When you're creating or deploying a stack you need to explicitly allow creation of IAM resources. To do that, you need to add the parameter when calling sam deploy:

--capabilities CAPABILITY_IAM

If you want to create named IAM resources (e.g. roles or users where you explicitly specify the name), you'll want to use --capabilities CAPABILITY_NAMED_IAM instead.

You can read more about deploying IAM resources in CloudFormation here: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html#using-iam-capabilities

SAM deployment documentation: https://github.com/awslabs/aws-sam-cli/blob/develop/docs/deploying_serverless_applications.rst#deploying-your-application

like image 119
pbeardshear Avatar answered Sep 21 '22 10:09

pbeardshear


Do check your YAML file indentation. review the YAML file once again, if it's a tad bit not up to the SAM standards it will throw this error. DO check once again.

like image 40
anas khan Avatar answered Sep 21 '22 10:09

anas khan