Skip to content

Instantly share code, notes, and snippets.

@tomdyson
Created December 8, 2009 21:34
Show Gist options
  • Select an option

  • Save tomdyson/252015 to your computer and use it in GitHub Desktop.

Select an option

Save tomdyson/252015 to your computer and use it in GitHub Desktop.
# work with Elastic Load Balancers in the EU region
from boto.ec2 import elb
AWS_ID = ''
AWS_SECRET = ''
HOST = 'eu-west-1.elasticloadbalancing.amazonaws.com'
conn = elb.ELBConnection(AWS_ID, AWS_SECRET,host=HOST)
print conn.get_all_load_balancers()
# add an instance to the load balancer
conn.register_instances('load_balancer_name', ['instance-id'])
# and remove it again
conn.deregister_instances('load_balancer_name', ['instance-id'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment