12

How can I force delete my AWS cloud formation stack? The tied resources were already deleted previously like the DNS, route53, etc. Whenever I delete the stack, it failed because it couldn't find the resources.

The specified hosted zone does not exist. DELETE_FAILED.

This made the deletion halt and made the stack still active. How can I force clean-up and remove this stack?

5 Answers 5

4

Based on this thread, it appears that stack deletion can be problematic if the stack is altered.

https://forums.aws.amazon.com/thread.jspa?threadID=71050&start=0&tstart=0

Looks like you need to go via Support to get it deleted.

That said, I have been able to delete stacks where I have manually altered the components. Sometimes you need to wait a couple of hours after you terminate instances, VPCs, subnets etc before the stack deletion actually succeeds.

1
  • Yes, You can just wait for an hour or so and retry to delete the stack. It prompts with the options of resource that failed to get deleted in previous attempt. Accept those and proceed, and your stack would eventually get deleted.
    – varad_s
    Feb 7 at 7:52
2

AWS Cloud formation stack does not get deleted until all dependency resources either used in other stack or busy with non stack resources. So better see which resource is shared some where else and try to release that. hope that help.

0

It seems the Route53 records were either deleted manually before cloudformation or there was some failure within cloudformation after it deleted the record. Its stuck because it can't find the hosted zone because it was already deleted if indeed this is what was described in your post. You can try to update the stack with the original script and then delete the stack via cloudformation without any manual intervention.

0

Check your IAM role and the policy, review the privileges that you have associated with the role, so that if there is any permission issue, that should resolve the issue. Refer: https://aws.amazon.com/premiumsupport/knowledge-center/cloudformation-stack-delete-failed/

0

Need to check the reason for failure in stack details

Either delete this manually, or retain those resources while eleteing

eg: $ aws cloudformation delete-stack --stack-name my-stack --retain-resources myresource1 myresource2

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.