amazon-web-servicesamazon-ecs

Target groups in ECS


What is the use of target groups in ECS services?

How do targets in a target group communicate with ECS tasks?

I explored the setup of my ECS service and the target group to which it is pointed. The IP addresses of the EC2 instances are different. How does the traffic from load balancer reach my ECS tasks?


Solution

  • A Target Group in AWS is a feature of Load Balancers. You configure load balancers to send traffic to Target Groups. The Target Group is only used in relation to Load Balancers. In your ECS Service you would configure it to register tasks with a Target Group, and you would have a Load Balancer send traffic to that Target Group.

    If you are not using a Load Balancer, then you would not use a Target Group either.