Skip to content

Instantly share code, notes, and snippets.

@hrkd
Last active August 29, 2015 14:05
Show Gist options
  • Save hrkd/61444ced779298236f2e to your computer and use it in GitHub Desktop.
Save hrkd/61444ced779298236f2e to your computer and use it in GitHub Desktop.
#ELBにぶら下がるエンドポイントのIPを取得する
VAR=`aws elb describe-instance-health --load-balancer-name your-elb-name --region your-region | jq -r .InstanceStates[].InstanceId`
echo "${VAR}" | while read line
do
VAR2=`aws ec2 describe-instances --region your-region --instance-ids ${line} | jq -r ".Reservations[].Instances[].PrivateIpAddress"`
#this is IP
echo "${VAR2}"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment