Skip to content

Instantly share code, notes, and snippets.

@pgpbpadilla
Created July 7, 2017 21:45
Show Gist options
  • Save pgpbpadilla/c48acc873e272a1451d9f00d8a494f1b to your computer and use it in GitHub Desktop.
Save pgpbpadilla/c48acc873e272a1451d9f00d8a494f1b to your computer and use it in GitHub Desktop.
Get only CloudFormation stack names that contain a pattern.
aws cloudformation --profile <profile> --region us-east-1 list-stacks | jq .StackSummaries | jq 'map(.StackName)' | grep "AT-" | sed 's/[ ",]//g'cat stacks | jq .StackSummaries | jq 'map(.StackName)' | grep "<pattern>" | sed 's/[ ",]//g'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment