How do I troubleshoot a CloudFormation stack deployment failure because of an existing AWS KMS key alias?

1 minute read
0

When I redeploy my AWS CloudFormation stack, the stack fails with the following error: "alias already exists."

Short description

When a CloudFormation stack fails, the stack deletes resources that it created. As a safety measure, AWS Key Management Service (AWS KMS) keys have a minimum 7-day deletion period. If you redeploy the stack before the 7-day deletion period is over, then the stack fails because the alias still exists.

Resolution

Note: If you receive errors when you run AWS Command Line Interface (AWS CLI) commands, then see Troubleshoot AWS CLI errors. Also, make sure that you're using the most recent AWS CLI version.

To delete an alias from an AWS KMS key, you can use either the AWS KMS console or the DeleteAlias AWS KMS API operation.

AWS OFFICIAL
AWS OFFICIALUpdated 12 days ago