3

I have an on-premises load balancer that I wish to use to distribute traffic on EC2s in an Autoscaling group(ASG).

When AWS's Elastic Load Balancer(ELB) registers an ASG as a target, during a scale-out,new instances are automatically registered to ELB to route traffic to.

Can the same functionality be achieved in any way with an on-prem load balancer?

Shitij Mathur
  • 385
  • 2
  • 10

2 Answers2

2

There is in-built integration between Amazon EC2 Auto-Scaling and Elastic Load Balancers. The Auto Scaling systems knows how to modify Target Groups to add/remove instances. However, it has no knowledge about your on-premises load balancer.

You could use Amazon EC2 Auto Scaling lifecycle hooks to trigger additional code (that you write) to add/remove the instances to your own load balancer, but that would require an AWS Lambda function to communicate with the on-premises load balancer to update the configuration.

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
1

If you wanted to get the IPs of your target group you can do that do with an API call, and put that into your LB, but I think you may as well proxy calls from your LB to an ELB sitting on AWS which does the actual LoadBalancing. IMO there is way too much work and a lot could go wrong if you were to try and re-implement ELB features using Lambda functions.

Derrops
  • 7,651
  • 5
  • 30
  • 60