You register targets, such as EC2 instances, with a target group. To route requests to the targets in a target group, specify the target group in a rule for one of the listeners for your load balancer.
You define health check settings for your load balancer on a per target group basis. Each target group uses the default health check settings, unless you override them when you create the target group or modify them later on. After you specify a target group in a rule for a listener, the load balancer continually monitors the health of all targets registered with the target group that are in an Availability Zone enabled for the load balancer. The load balancer routes requests to the registered targets that are healthy.
By default, a load balancer routes requests to its targets using the protocol and port number that you specified when you created the target group. Alternatively, you can override the port used for routing traffic to a target when you register it with the target group.
Target groups support the following protocols and ports:
- Protocols: HTTP, HTTPS
- Ports: 1-65535
If a target group is configured with the HTTPS protocol or uses HTTPS health checks, SSL connections to the targets use the security settings from the
ELBSecurityPolicy2016-08
policy.
Your load balancer serves as a single point of contact for clients and distributes incoming traffic across its healthy registered targets. You can register each target with one or more target groups. You can register the same EC2 instance with a target group multiple times using different ports, which enables the load balancer to route requests to ECS containers.
If demand on your application increases, you can register additional targets with one or more target groups in order to handle the demand. The load balancer starts routing requests to a newly registered target as soon as the registration process completes and the target passes the initial health checks.
If demand on your application decreases, or you need to service your targets, you can deregister targets from your target groups. Deregistering a target removes it from your target group, but does not affect the target otherwise. The load balancer stops routing requests to a target as soon as it is deregistered. The target enters the
draining
state until in-flight requests have completed. You can register the target with the target group again when you are ready for it to resume receiving requests.
When you plan to use your load balancer with an Auto Scaling group, you don't need to register your targets with a target group. After you attach a target group to an Auto Scaling group, Auto Scaling registers your targets with the target group when it launches them. For more information, see Attaching a Load Balancer to Your Auto Scaling Group.
Comments
Post a Comment