aws ec2 describe-instances --filters "Name=instance-state-name,Values=running" "Name=mytag,Values=myvalue" --query "Reservations[*].Instances[*].{name: Tags[?Key=='Name'] | [0].Value, InstanceType: InstanceType}" --output text --color off | sort -n -k 2
Wednesday, October 31, 2018
Thursday, October 25, 2018
AWS CLI query for EC2 instances summary (multiple filters)
aws ec2 describe-instances --output text --filters "Name=instance-state-name,Values=running" "Name=tag:mytagname,Values=mytagvalue" --query 'Reservations[*].Instances[*].[InstanceType]' | sort | uniq -c
18 c4.2xlarge
10 c4.xlarge
7 m4.10xlarge
6 m4.16xlarge
8 m4.2xlarge
3 m4.4xlarge
22 m4.large
21 m4.xlarge
26 r4.2xlarge
3 r4.large
10 r4.xlarge
6 r5.2xlarge
10 r5.4xlarge
3 t2.medium
Subscribe to:
Posts (Atom)