Set of commands which are useful to clean after yourself when I tried to delete AWS Cloud Formation stacks when my infrasec role did not had all the needed permissions.
- List stacks which can be deleted (
DELETE_FAILED
status):aws cloudformation list-stacks | jq '.StackSummaries[] | select(.StackStatus=="DELETE_FAILED") | .StackName'
OR
- List stacks which contain a specific string in their name:
aws cloudformation list-stacks | jq '.StackSummaries[] | select(.StackName | contains("bcol")) | .StackName'