Last active
June 13, 2018 09:28
-
-
Save hinnerk/edad252eae51835d5223b2a638b4fafb to your computer and use it in GitHub Desktop.
Count AWS CloudFormation Stack Ressources
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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