We know that in order to attach an Application/Network load balancer for an auto-scaling group, we need to attach the target group(s) to the existing Auto-scaling group in order to distribute the load. In the case of the Classic Load Balancer, we directly attach the load balancer to the ASG
but in case of an ALB
, we do it through the target groups consisting of targets which can be either an instance, IP or a lambda function.
My question is, are the instances in these target groups defined for an ALB and the instances in ASG
different? Or are they the same? If they are the same, then do we have to create a new target group again with targets defined as the EC2
instances in ASG
? I can't understand the mapping of instances in target-groups to the instances in ASG. I went through the documentation for attaching a load balancer to an existing ASG
, but all it says is to select an existing target group.