AWS CloudFormation is stuck on DELETED_FAILED status

Viewed 7647

I have some AWS CloudFormation stacks which are in the status DELETED_FAILED. There was an issue building these CFTs which caused them to time out originally, and then I attempted to delete them.

When contacting AWS support on a separate issue they mentioned there is a way to clear these up. How can I get remove stacks which are in a DELETED_FAILED status?

4 Answers

Identify the resources that are attached to the stack and delete them manually from AWS web console. You can find the resources attached to your stack in the cloud formation stack details. And then you should be able to clear the stack in DELETE_FAILED status.

Hope this helps for you.

Did you check Delete Stack Fails?

When stacks are in the DELETE_FAILED state because AWS CloudFormation couldn't delete a resource, rerun the deletion with the RetainResources parameter and specify the resource that AWS CloudFormation can't delete. AWS CloudFormation deletes the stack without deleting the retained resource. Retaining resources is useful when you can't delete a resource, such as an S3 bucket that contains objects that you want to keep, but you still want to delete the stack. After you delete the stack, you can manually delete retained resources by using their associated AWS service.

I deleted a pipeline stack but the stacks it had created could not be deleted because the IAM role no longer existed. Things seem to need to be deleted in a certain order. I redeployed the pipeline and only then was able to delete the stack.

enter image description here

AWS now also gives the option to exclude resources that prevent deletion.

enter image description here

I am using CDK and deployed a stack, then destroyed it. I ran into the exact DELETED_FAILED status issue.

How to fix this status ?

Search "CloudFormation" in the search bar. Go to Stacks.

Select the DELETED_FAILED stack and press the delete button.

To be really sure all resource have been deleted, if you use cdk

cdk list

your_stack_name

Then delete this stack

cdk destroy your_stack_name

enter image description here

Related