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]
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.
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.
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.
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.
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
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With