Created
April 7, 2015 21:46
-
-
Save murarisumit/adf7a43e20370be27062 to your computer and use it in GitHub Desktop.
Boto AWS get loadbalancer pointing to a instance
This file contains hidden or 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
import boto | |
import boto.ec2.elb | |
import boto.ec2.elb.instancestate | |
elb_conn=boto.ec2.elb.ELBConnection(aws_access_key, aws_access_secret) | |
lbs=elb_conn.get_all_load_balancers() | |
for lb in lbs: | |
for instance_info in lb.instances: | |
if instance_info.id == "Your_Instance_ID" | |
print lb |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment