Red Bottle
Red Bottle

Reputation: 3080

Cloudformation : UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS stuck issue

I have a CFN stack which is stuck in UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS status. It happens to me very often especially when I use a custom function.

I have read through almost everything there is but couldn't find anything that suggests a solution apart from contacting AWS support. Is there a work around to fix this or possibly dodge it altogether?

It goes back to failed status on its own after like half a day which is just too long. And writing to AWS support take at least 2 hours to get it unstuck. Please help

Upvotes: 3

Views: 3114

Answers (1)

mdarwin
mdarwin

Reputation: 2394

Your custom resource is not telling CloudFormation that it has successfully deleted.

To fix this, you can make the call yourself - it's just an HTTP call.

Look up the event that called the Delete operation on the stack in the CloudWatch logs.

Then extract the correct values in order to make a HTTP call to the CloudFormation server like this:

curl -H 'Content-Type: ''' -X PUT -d '{
"Status": "SUCCESS",
"PhysicalResourceId": "<value from event>",
"StackId": "value from event, e.g. arn:aws:cloudformation:us-east-1:111122223333:stack/awsexamplecloudformation/33ad60e0-5f25-11e9-a734-0aa6b80efab2
",
"RequestId": "value from event, e.g. e2fc8f5c-0391-4a65-a645-7c695646739",
"LogicalResourceId": "value from event, e.g.CloudWatchtrigger"
}' 'ResponseURL, e.g. https://cloudformation-custom-resource-response-useast1.s3.us-east-1.amazonaws.com/arn%3Aaws%3Acloudformation%3Aus-east-1%3A1%3Astack/awsexamplecloudformation/33ad60e0-5blablabla'

For the URL, use the ResponseURL parameter in the Delete command.

Once you make that call, the resource should go to the DELETE_COMPLETE state.

https://aws.amazon.com/premiumsupport/knowledge-center/cloudformation-lambda-resource-delete/

Upvotes: 3

Related Questions