Skip to content

Instantly share code, notes, and snippets.

@tfentonz
Created June 16, 2021 00:53
Show Gist options
  • Save tfentonz/b2c0d98e6e8537f009bf5e458f878a27 to your computer and use it in GitHub Desktop.
Save tfentonz/b2c0d98e6e8537f009bf5e458f878a27 to your computer and use it in GitHub Desktop.
AWS CLI query for EC2 instances Customer, Name, InstanceId, InstanceType
aws ec2 describe-instances \
--query 'Reservations[].Instances[].[Tags[?Key==`Customer`]|[0].Value,Tags[?Key==`Name`]|[0].Value,InstanceId,InstanceType]' \
--output text
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment