koryNC
koryNC

Reputation: 41

AWS API action to list EC2 Instance associated with a specific Elastic Load Balancer?

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

Answers (1)

Steffen Opel
Steffen Opel

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

Related Questions