Last active
January 30, 2020 15:13
-
-
Save sumit-sampang-rai/0089b4e6651a6d9e6cab4a6bd6b240a4 to your computer and use it in GitHub Desktop.
List instance name, id, and IP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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