Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How is "Target Groups" different from "Auto-Scaling Groups" in AWS?

I'm a little too confused on the terms and its usage. Can you please help me understand how are these used with Load Balancers?

I referred the aws-doc in vain for this :(

like image 869
karthiks Avatar asked Jan 30 '18 19:01

karthiks


People also ask

What is a target group and what is an Auto Scaling group How do target group and Auto Scaling group work together?

Target groups are just a group of Ec2 instances. Target groups are closely associated with ELB and not ASG. We can just use ELB and Target groups to route requests to EC2 instances. With this setup, there is no autoscaling which means instances cannot be added or removed when your load increases/decreases.

What is a target group in AWS?

A target group tells a load balancer where to direct traffic to : EC2 instances, fixed IP addresses; or AWS Lambda functions, amongst others. When creating a load balancer, you create one or more listeners and configure listener rules to direct the traffic to one target group.

Can you associate multiple target groups under Auto Scaling?

Amazon EC2 Auto Scaling adds instances to the attached target group when they are launched. You can attach one or multiple target groups, and configure health checks on a per target group basis.

What is difference between load balancer and target group?

Yes, the load balancer is an EC2 instance to provide the networking and compute services needed for load balancing. This also means that there is a per hour charge for the load balancer EC2 instance. A Target Group is used to route requests to one or more registered targets (your backed EC2 instances).


1 Answers

Target groups are just a group of Ec2 instances. Target groups are closely associated with ELB and not ASG.

  • ELB -> TG - > Group of Instances

We can just use ELB and Target groups to route requests to EC2 instances. With this setup, there is no autoscaling which means instances cannot be added or removed when your load increases/decreases.

  • ELB -> TG - > ASG -> Group of Instances

If you want autoscaling, you can attach a TG to ASG which in turn gets associated to ELB. Now with this setup, you get request routing and autoscaling together. Real world usecases follow this pattern. If you detach the target group from the Auto Scaling group, the instances are automatically deregistered from the target group

Hope this helps.

like image 105
VimalKumar Avatar answered Sep 18 '22 20:09

VimalKumar