Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I force delete an AWS CloudFormation stack that is In Progress of Rollback

An AWS CloudFormation rollback (e.g., UPDATE_ROLLBACK_IN_PROGRESS) has been in progress forever, like over an hour and a half. I want to delete the stack altogether or force stop any activity. Is this possible?

Thanks!

like image 293
Justin Avatar asked Jan 27 '17 23:01

Justin


People also ask

What happens if I delete CloudFormation stack?

During deletion, AWS CloudFormation deletes the stack but does not delete the retained resources.

Can I force CloudFormation to delete non empty s3 bucket?

1 Answer. You can try creating a lambda function that wipes up your bucket. You'll have to invoke your lambda function from CloudFormation.


2 Answers

Another common cause of blocked stack updates/rollbacks is errors in ECS::Service resource updates: it doesn't look like that is currently detected (in some cases?). Cloudformation is waiting for the service event for the service reaching a steady state, so simply updating the service to something that works (e.g. desired tasks to 0) will unblock it. Try to get the state back to what Cloudformation expects before sending more updates to avoid problems, though.

like image 193
Simon Buchan Avatar answered Oct 07 '22 16:10

Simon Buchan


I guess your stack resources are changed or deleted by outside. You can find official guide as below.

Manually sync resources so that they match the original stack's template, and then continue rolling back the update. For example, if you manually deleted a resource that AWS CloudFormation is attempting to roll back to, you must manually create that resource with the same name and properties it had in the original stack.

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/troubleshooting.html#troubleshooting-errors-update-rollback-failed

or (as @talentedmrjones said)

To fix the stack, contact AWS customer support.

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/troubleshooting.html#troubleshooting-errors-nested-stacks-are-stuck

In my case, I can stop same situation via re-creating deleted resource.

like image 21
mys Avatar answered Oct 07 '22 18:10

mys