Zero Orphaned Resources: Force Deleting Any CloudFormation Stack
DELETE_FAILED and FORCE_DELETE_STACK If you've ever worked with AWS CloudFormation, chances are you've encountered DELETE_FAILED . A non-empty S3 bucket, an ECR repository with images still in it, a Custom Resource that doesn't return SUCCESS... You end up manually emptying resources and retrying the deletion over and over. It's painful. "What about FORCE_DELETE_STACK ?" you might think. CloudFormation does provide this feature. However, it merely detaches failed resources from the stack . The resources themselves remain in your AWS account. In other words, it creates orphaned resources, and you still have to delete them manually. When Stack Deletion Gets Complicated CloudFormation stack deletion can get complicated beyond just DELETE_FAILED. To begin with, when you want to delete multiple stacks at once, CloudFormation offers no built-in way to do so. On top of that, the following problems come into play. Inter-Stack Dependencies When deleting multiple stacks, if there are dependencie
Continue reading on Dev.to
Opens in a new tab



