0PricingLogin
AWS Solutions Architect · Lesson

Target Groups and Health Checks

Register EC2 instances, IP addresses, or Lambda functions as targets, and configure health check paths, thresholds, and intervals.

What Are Target Groups?

A target group is a logical collection of targets that the load balancer routes requests to. Each target group has a target type, a protocol/port, and a health check configuration. The load balancer distributes requests to registered targets in the target group that pass health checks.

Target groups are associated with load balancer listeners through listener rules. One listener can route to multiple target groups based on request attributes. This is the core mechanism behind path-based and host-based routing in ALB.

# Create a target group for an ALB
aws elbv2 create-target-group \
  --name my-web-targets \
  --protocol HTTP \
  --port 80 \
  --vpc-id vpc-12345678 \
  --target-type instance \
  --health-check-path /health \
  --health-check-interval-seconds 30

Target Types: Instance, IP, Lambda

Target groups support three target types:

  • instance: routes to EC2 instances by instance ID; the load balancer sends traffic to the instance's primary network interface on the specified port
  • ip: routes to private IP addresses—useful for targets in containers (ECS/EKS), on-premises servers reachable via VPN/Direct Connect, or EC2 instances' secondary IPs
  • lambda: routes to a single Lambda function (ALB only); ALB converts the HTTP request to a JSON event and invokes the function synchronously

IP target type is required for ECS tasks with the awsvpc network mode (each task gets its own IP), for EKS pods, and for hybrid architectures with on-premises targets.

All lessons in this course

  1. ALB vs NLB vs GLB: When to Use Which
  2. Target Groups and Health Checks
  3. Listener Rules and Path-Based Routing
  4. SSL Termination and Sticky Sessions
← Back to AWS Solutions Architect