Skip to content

Instantly share code, notes, and snippets.

@anuragmathur1
Created September 20, 2017 06:16
Show Gist options
  • Save anuragmathur1/0c105b8a3cbd6a300f5801dd4b1ca1cd to your computer and use it in GitHub Desktop.
Save anuragmathur1/0c105b8a3cbd6a300f5801dd4b1ca1cd to your computer and use it in GitHub Desktop.
Find all instances and list their Private IP, instance-id and Name
# 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