Skip to content

Instantly share code, notes, and snippets.

@tfentonz
Created May 22, 2019 03:55
Show Gist options
  • Save tfentonz/0e9c25709c3069206ebf59d5d46ebc24 to your computer and use it in GitHub Desktop.
Save tfentonz/0e9c25709c3069206ebf59d5d46ebc24 to your computer and use it in GitHub Desktop.
AWS CLI CloudFormation list stacks with filter and sort
aws cloudformation list-stacks --query 'StackSummaries[?starts_with(StackName, `production`)].{StackName:StackName,StackStatus:StackStatus} | sort_by(@, &StackName)'
@tfentonz
Copy link
Author

Find CloudFormations stacks beginning with "production" and sort by StackName.

Uses JMESPath built-in functions starts_with and sort_by.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment