Created
February 5, 2017 18:39
-
-
Save youhide/c7ef7d0dbe4acd8389c88427bacc2101 to your computer and use it in GitHub Desktop.
Get IP's of AutoScaling Group (AWS)
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
#!/bin/bash | |
for i in `aws autoscaling describe-auto-scaling-groups --auto-scaling-group-name GROUPNAME | grep -i instanceid | awk '{ print $2}' | cut -d',' -f1| sed -e 's/"//g'` | |
do | |
aws ec2 describe-instances --instance-ids $i | grep -i PrivateIpAddress | awk '{ print $2 }' | head -1 | cut -d"," -f1 | |
done; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment