Skip to content

Instantly share code, notes, and snippets.

@alimoeeny
Created April 24, 2014 11:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alimoeeny/11251793 to your computer and use it in GitHub Desktop.
Save alimoeeny/11251793 to your computer and use it in GitHub Desktop.
#register this with ELB
# what is my name
myname=$(curl http://169.254.169.254/latest/meta-data/instance-id)
# what is my AvailabilityZone
myaz=$(curl http://169.254.169.254/latest/meta-data/placement/availability-zone)
#What is my region
myregion=${myaz%?}
# you need to know the ELB name
myelb=XXXXXXX
# add me to the elb
aws elb register-instances-with-load-balancer --load-balancer $myelb --instances $myname --region $myregion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment