bash

Mass delete cloudformation stacks

The oneliner: # This will delete all stacks in the account connected to yourprofile with the string "delete-me" in the stackname for StackName in $(aws --profile yourprofile cloudformation list-stacks --query 'StackSummaries[?contains(StackName, `delete-me`) == `true`] .StackName' --output text); do echo $StackName ; aws --profile yourprofile cloudformation delete-stack --stack-name $StackName ; done