Skip to content

Instantly share code, notes, and snippets.

@thedoc31
Last active March 18, 2022 16:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thedoc31/2905ae3f1e9a9e73b1ad97f349a87a64 to your computer and use it in GitHub Desktop.
Save thedoc31/2905ae3f1e9a9e73b1ad97f349a87a64 to your computer and use it in GitHub Desktop.
Return count of instance types in use in current AWS region
aws ec2 describe-instances --filters Name=tag-key,Values=Name --query 'Reservations[*].Instances[*].{Instance:InstanceId,Instance:InstanceType}' --output text | sort | uniq -c
@thedoc31
Copy link
Author

To calculate a different region add "--region " after the "aws" command.

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