Reputation: 41
I have looked through the AWS EC2 and ELB apis and I cannot figure out a way that I can list the EC2 Instances that are associated with an Elastic Load Balancer. I would think that there is a way to do this, since it is so easy to do on the console. Any ideas?
Upvotes: 4
Views: 1363
Reputation: 64761
This is indeed possible via the Elastic Load Balancing API as expected:
The DescribeLoadBalancers action returns a list of LoadBalancerDescriptions, where each LoadBalancerDescription contains an Instances element in turn, which provides the desired list of EC2 instance IDs for the LoadBalancer.
Upvotes: 4