Skip to content

Instantly share code, notes, and snippets.

@sharuzzaman
Created May 6, 2020 16:30
Show Gist options
  • Save sharuzzaman/76ed2ca8fa8453c014c6a1e23815915b to your computer and use it in GitHub Desktop.
Save sharuzzaman/76ed2ca8fa8453c014c6a1e23815915b to your computer and use it in GitHub Desktop.
Get a list of EC2 instance which are running
aws ec2 describe-instances --filters "Name=instance-state-name,Values=running" | jq '.Reservations[]|.Instances[]|{InstanceId,PrivateIpAddress,Name: .Tags[]|select(.Key == "Name").Value}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment