Skip to content

Instantly share code, notes, and snippets.

@ginokent
Created February 8, 2019 05:46
Show Gist options
  • Save ginokent/ed253087a6576f6538f60351a5d05987 to your computer and use it in GitHub Desktop.
Save ginokent/ed253087a6576f6538f60351a5d05987 to your computer and use it in GitHub Desktop.
grep "^\[profile" ~/.aws/config | sed 's/\[profile \(.*\)\].*/\1/' | while read LINE; do aws --profile $LINE ec2 describe-instances | jq '.Reservations[].Instances[].PublicDnsName' | jq -s '{ "'$LINE'": . }'; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment