Last active
January 30, 2018 15:13
-
-
Save agutoli/f0b4ddb80ba017c4ffc6232beeddb182 to your computer and use it in GitHub Desktop.
AWS utils commands
This file contains hidden or 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
## All instances | |
aws ec2 describe-instances --query 'Reservations[*].Instances[*].[InstanceId]' --filters "Name=instance-state-name, Values=running" | awk '/i-*/ {print $1}' | wc -l | |
## ondemand | |
aws ec2 describe-instances --query 'Reservations[*].Instances[*].[InstanceLifecycle]' --filters "Name=instance-state-name, Values=running" | awk '/null/ {print $1}' | wc -l | |
## spot instances | |
aws ec2 describe-instances --query 'Reservations[*].Instances[*].[InstanceLifecycle]' --filters "Name=instance-state-name, Values=running" | awk '/spot/ {print $1}' | wc -l |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment