Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/bin/bash
export AWS_DEFAULT_REGION=${REGION:-eu-west-1}
aws ec2 describe-addresses \
--query 'Addresses[*][InstanceId, PublicIp]' \
--output text \
| while read ID IP
do
echo -en "$IP\\t"
aws ec2 describe-instances \
--instance-ids $ID \
--query "Reservations[].Instances[].Tags[?Key=='Name'].Value" \
--output text
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.