Created
September 20, 2017 06:16
-
-
Save anuragmathur1/0c105b8a3cbd6a300f5801dd4b1ca1cd to your computer and use it in GitHub Desktop.
Find all instances and list their Private IP, instance-id and Name
This file contains hidden or 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
# Find all instances and list their Private IP, instance-id and Name | |
# You may specify more filters like the vpc | |
# Name=vpc-id,Values=vpc-xxxxxxxx | |
aws ec2 describe-instances --filters --query 'Reservations[].Instances[].[PrivateIpAddress,InstanceId,Tags[?Key==`Name`].Value[]]' --output text --profile=elmodev | sed '$!N;s/\n/ /' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment