Michele Guerriero
Michele Guerriero

Reputation: 97

AWS EC2 Load Balancing: point to specific AMI

I'm using the EC2 load balancer. Since I'm implementing my own autoscaling policy, I will not use to auto scaling EC2 service that I imagine is well integrated with the Load Balancer. Basically I will scale out istances all from the same AMI. I notice that the load balancer ask to specify all the instances ids whose workload have to be balanced. My question is: it is possible to instruct the load balancer to automatically distribute the workload among all the instances belonging to a given AMI? In this way every time my scaling system scale out an instance of the given AMI, I don't need to add the new instance to the load balancer configuration. I search about this on google, but I didn't find any useful information. There is maybe something I'm misunderstanding about the load balancer usage? Because to me it seems to be a quite common feature a load balancer should have. Maybe apply balancing over a given AMI would cause some problems I cannot see? Thank you all in advance for the help.

Upvotes: 0

Views: 208

Answers (1)

Ben Whaley
Ben Whaley

Reputation: 34446

An AMI is just an operating system image, and has no relationship to load balancers. There is no feature that will automatically add new instances of a particular AMI and join them to an ELB.

The easiest way to accomplish this would be to use EC2 User Data and the AWS CLI tool to add the instance to the ELB when it first boots.

But I have to ask - why not use the native AWS autoscaling feature? It's actually quite flexible and is integrated with cloudwatch so there's a lot less you have to build yourself.

Upvotes: 1

Related Questions