4

I just created two new ELBs, and I'm trying to figure out how to add one of them to an existing autoscaling group; so far the only way that this seems to be possible is by recreating the already existing autoscaling group, adding the new ELB to the one already present at creation time.

I've checked google several times trying to find out if there's another way to do this; with no luck. Is there any other way to do this or is this the only way to add an ELB to an existing autoscaling group?

Alexej Magura
  • 161
  • 2
  • 9

4 Answers4

2

Now this is possible in EC2, you can attach and detach Elastic Load Balancers from Auto Scaling Groups. This is very helpful for Blue/Green deployments.

Attach/Detach an ELB to an ASG allows to change the cluster an ELB is distributing traffic, without make changes in DNS or using additional proxies.

See the official blog post of this new feature: https://aws.amazon.com/es/blogs/aws/attach-and-detach-elastic-load-balancers-from-auto-scaling-groups/

0

To quote The Fine Manual : http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-as-group.html#cfn-as-group-loadbalancernames

LoadBalancerNames

A list of load balancers associated with this Auto Scaling group.

...

Update requires: Replacement

Important - When you update LoadBalancerNames, the entire Auto Scaling group is replaced.

0

This can be done in the EC2 Console by editing the Auto Scaling Group and changing the value of "Load Balancers".

It can also be done programatically, for example using PowerShell:

Add-ASLoadBalancer -AutoScalingGroupName "MyASG" -LoadBalancerName "MyELB"
Greg Sansom
  • 131
  • 7
-2

You are correct, Elastic Load Balancers can only be assigned to the Autoscaling Group at the time the ASG is created. There is no way via the GUI or the CLI to add an ELB to an existing ASG.

user2962402
  • 57
  • 1
  • 5