Skip to content

Instantly share code, notes, and snippets.

@luis02lopez
Created June 2, 2020 19:52
Show Gist options
  • Save luis02lopez/ffde6f859809381548b3f1f8be14088c to your computer and use it in GitHub Desktop.
Save luis02lopez/ffde6f859809381548b3f1f8be14088c to your computer and use it in GitHub Desktop.
List EC2 running instances and only displaying ID, Name and Status.
aws ec2 describe-instances --filters "Name=instance-state-name, Values=running" --query 'Reservations[*].Instances[*].{ID:InstanceId,Name:Tags[?Key==`Name`]|[*].Value,Type:InstanceType,Status:State.Name}' --output json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment