Skip to content

Instantly share code, notes, and snippets.

@hinnerk
Last active June 13, 2018 09:28
Show Gist options
  • Save hinnerk/edad252eae51835d5223b2a638b4fafb to your computer and use it in GitHub Desktop.
Save hinnerk/edad252eae51835d5223b2a638b4fafb to your computer and use it in GitHub Desktop.
Count AWS CloudFormation Stack Ressources
AWS_PROFILE=XXX
AWS_DEFAULT_REGION=YYY
echo -e "Stack Name\t\tRessource Count"; for name in $(aws cloudformation list-stacks --stack-status-filter UPDATE_COMPLETE CREATE_COMPLETE | jq --raw-output ".StackSummaries[].StackName"); do echo -ne "${name}\t"; aws cloudformation list-stack-resources --stack-name ${name} | jq ".StackResourceSummaries | length"; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment