Can I forcibly remove the AWS CloudFormation cloud stack that is in the process of rolling back

AWS CloudFormation rollback (for example, UPDATE_ROLLBACK_IN_PROGRESS) is done forever, for example, after an hour and a half. I want to delete the stack altogether or force stop any activity. Is it possible?

Thanks!

+23
source share
9 answers

Another common reason for blocking updates / rollbacks of the stack is errors in ECS :: Service resource updates: it seems that this was not detected (in some cases?). Cloudformation expects the service event for the service to reach a steady state, so simply updating the service to work (for example, desired tasks to 0) will unlock it. Try to get the state back to what Cloudformation is expecting before posting more updates to avoid problems.

+29
source

I think your stack resources are changed or deleted externally. You can find the official guide as shown below.

Manually synchronize the resources so that they match the original stack template, and then continue rolling back the update. For example, if you manually deleted the resource that AWS CloudFormation is trying to roll back to, you must manually create this resource with the same name and properties that 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 Support.

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

In my case, I can stop the same situation by recreating the remote resource.

+5
source

You will need to find out exactly why the rollback lasts so long (for example, if this is due to the lack of a resource changed outside the CloudFormation stack, or using a special resource that could not return the expected signals).

+1
source

Sometimes this happens if your user role does not have enough permissions to delete roles. You can test this by trying to manually remove the roles or users who created the CloudFormation stack.

+1
source

In my case, this is an EC2 security group that cannot be deleted because it is referenced by another EC2 security group.

+1
source

I had something similar, it happened once, and the stack seemed to be stuck forever in the status of UPDATE_ROLLBACK_IN_PROGRESS. I would recommend sending an AWS support ticket. This was the only way to resolve this.

0
source

When working with a custom resource, you can create a mock version of the return URL.

The easiest way to do this is to get the URL that was used to create it. If you manage to do this, replace the section after the last% 2F with the β€œClient Request Token”, which you can get from your event log for cloud information.

If not, here is the URL format that you will need to create.

https://{region}.console.aws.amazon.com/cloudformation/home?region={region}#/stacks?filter=active&tab=events&stackId={stack arn}%2F{stack name}%2F{client request token} 

Run this url as get and this will result in rollback failure or resource deletion.

0
source

I was able to remove mine by manually deleting everything through the AWS toolbar. I ended up having a couple of hanging roles that just needed to be removed.

0
source

You can try to delete the resources, and then the rollback of the update will be completed successfully.

-1
source

Source: https://habr.com/ru/post/1263479/


All Articles