I'm trying to get up and running with ECS and Load Balancing in AWS and I'm trying to understand the roles of the various components involved: load balancer, security group, target group.
From what I understand, security groups act as firewalls to open ports from the load balancer to specific EC2 instances. However what I don't understand is what's the purpose of a target group. If the security group routes traffic from the load balancer to the EC2 instance, what is the target group doing?