Search code examples
amazon-web-servicesaws-lambdaamazon-iamaws-sam

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]


Solution

  • 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