Created
August 26, 2015 19:53
-
-
Save Voronenko/8ee8e8be4c7c73776aa4 to your computer and use it in GitHub Desktop.
Get public IPs of the instances currently linked to aws load balancer named LB1
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 elb describe-instance-health --load-balancer-name bla --region us-east-1 | awk '{ print $2 }' | grep "i-" | cut -d '=' -f 2 | sed -e 's/,$//' | xargs aws ec2 describe-instances --instance-id | grep PublicIpAddress | awk '{print $2}' | cut -d '=' -f 2 | sed -e 's/,$//' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment