Target groups for your Application Load Balancers - Elastic Load Balancing

Target Group은 Elastic Load Balancer와 함께 사용되는 중요한 구성 요소로 Load Balancer의 Routing Rule에 따라서 알맞은 Target(예: Instance, Port)으로 트래픽을 전달하는 역할을 수행합니다.
Target Group은 VPC Level의 서비스입니다.
Target Group의 Target Type으로 Instance, IP, Lambda, Application Load Balncer를 사용할 수 있습니다.
Target Group 생성 시, Load Balancer가 트래픽을 어떤 Protocol과Port를 사용하여 Target으로 전달할 것인지 지정할 수 있습니다.
Health Check를 수행하며, Health Check 결과에 따라서, Load Balancer가 트래픽을 전달하거나 전달하지 못하도록 할 수 있습니다.1.Target Group 생성합니다.
aws elbv2 create-target-group \
--name <Target_Group_Name> \
--protocol HTTP \
--port 80 \
--vpc-id <VPC_ID> \
--target-type instance \
--health-check-protocol HTTP \
--health-check-port 80 \
--health-check-path / \
--health-check-interval-seconds 30 \
--health-check-timeout-seconds 5 \
--healthy-threshold-count 5 \
--unhealthy-threshold-count 2 \
--matcher HttpCode=200-299
2.Target Group에 Target을 등록합니다.
aws elbv2 register-targets \
--target-group-arn <Target_Group_ARN> \
--targets Id=i-0aa5de1e416ade697 Id=<Instance_ID>