DEV Community

ledux
ledux

Posted on

AWS Stack in UPDATE_ROLLBACK_FAILED state

When your stack is in a UPDATE_ROLLBACK_FAILED state, then you cannot update your stack anymore. You have two solutions here:

  1. Delete the whole stack and deploy it again
  2. Continue the rollback process

In this post I am going to outline how to go route 2.

How to continue the update rollback

When your stack is in UPDATE_ROLLBACK_FAILED state, this means that some resouces could not be rolled back.
When you are going to continue the rollback process, you have to skip these.
We are going to use the aws cloudformation continue-update-rollback command, which has a parameter --resources-to-skip.
This parameter takes one or more LogicalResourceIds, separated by a space.

To get these IDs, this command can be used:

aws cloudformation describe-stack-resources --stack-name <stackname> | jq '.StackResources[] | select(.ResourceStatus == "UPDATE_FAILED") | .LogicalResourceId' | tr -d '"'
Enter fullscreen mode Exit fullscreen mode

These values you can then use in the following command.

 aws cloudformation continue-update-rollback --stack-name <stackname> --resources-to-skip <ResourceOne> <ResourceTwo>
Enter fullscreen mode Exit fullscreen mode

To skip resources means, that they will just get the ResourceStatus = RollbackComplete.
It doesn't mean, that an actual rollback was performed.
This leaves the stack in an inconsistent state.
But it is ready to have another try to update it.

Top comments (0)