Skip to content

Instantly share code, notes, and snippets.

@sumit-sampang-rai
Last active January 30, 2020 15:13
Show Gist options
  • Save sumit-sampang-rai/0089b4e6651a6d9e6cab4a6bd6b240a4 to your computer and use it in GitHub Desktop.
Save sumit-sampang-rai/0089b4e6651a6d9e6cab4a6bd6b240a4 to your computer and use it in GitHub Desktop.
List instance name, id, and IP
aws ec2 describe-instances \
--filter Name=tag-key,Values=Name \
--query 'Reservations[*].Instances[*].{Instance:InstanceId,Name:Tags[?Key==`Name`]|[0].Value,PublicIP:PublicIpAddress,PrivateIP:PrivateIpAddress,State:State.Name}' \
--output table
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment