Wednesday, October 31, 2018

AWS CLI query to list instance types and name with sort by instace type


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



No comments:

Post a Comment