1
votes

I have a AWS deployment setup like below.

An ELB which directs traffic to target-group 'abc-tg' An auto-scaling group which scales the number of instances (with a given name tag)

I manually registered two targets to the target group, I am wondering if there is any configuration which automatically registers any newly spawned (by autoscaling) target to the target group 'abc-tg'

Thanks for your time.

1

1 Answers

5
votes

You can add a target group to the autoscaling configuration. After you attach a target group to an Auto Scaling group, Auto Scaling registers your targets with the target group for you when it launches them.

https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-target-groups.html

https://docs.aws.amazon.com/autoscaling/ec2/userguide/attach-load-balancer-asg.html