Target groups & Application Load Balancer

Beginner
9 min read
Updated: Nov 2026
5 examples
ALB / EC2 / ELB

Definition and Usage

A target group tells an Application Load Balancer which registered backends should receive forwarded traffic, on which target port, and how to health check them. Listeners (for example HTTP on 80 or HTTPS on 443) live on the load balancer; listener rules choose which target group handles each client request.

What does a target group do?

It is a pool of targets—commonly EC2 instances—plus protocol, port, load-balancing algorithm, and health-check settings. The ALB never “listens” on the target group port for clients; clients hit the ALB, then traffic is forwarded to healthy targets.

When should you create one?

Create a target group before or during ALB creation whenever you need a forward action. Use multiple groups for blue/green capacity, microservices, or path-based routing behind one DNS name.

What you will configure

Target type (instances), protocol and port, VPC, health check path and matcher, registered EC2 targets (including pending), then association via an ALB listener rule. Optional attributes such as stickiness come later.

After targets are healthy

Finish or update the ALB listeners, then publish the load balancer hostname with Route 53 alias records when you are ready for a custom domain.

Listeners vs target ports.

Clients may use HTTPS on 443 on the ALB while targets receive HTTP on 80 or 8080. That split is normal when the ALB terminates TLS.

Security groups both ways.

Allow client→ALB on the listener ports, and ALB→instance on the target group port. Missing the second rule is a common cause of perpetual unhealthy targets.

Health checks decide traffic.

Keep checks cheap (for example GET /health) and aligned with what your app needs to serve. Unhealthy targets stop receiving new requests.

Core Concepts

Terms you will use while creating and wiring a target group:

ConceptMeaning
Target groupRegistered backends plus health checks and routing algorithm
Target typeInstances, IP addresses, or Lambda (this guide uses instances)
ListenerALB front-end protocol/port that accepts client connections
Listener ruleConditions + actions that forward (or redirect) to a target group
Health checkPeriodic probe path, port, interval, and success codes
Pending registrationTarget staged for the group until registration and checks complete
Deregistration delayTime in-flight requests may finish after a target is removed
StickinessOptional cookie-based affinity so a client returns to the same target

Prerequisites

Have these ready before you open Target Groups:

  • An AWS account with permission to manage Elastic Load Balancing and EC2 in your Region.
  • One or more running EC2 instances in the VPC you will select, with your app listening on the planned target port.
  • Optional but recommended: know the ALB you will attach (or follow create an ALB after this group exists). Review target group concepts if you need attribute background.
EC2 instances list with instance in running state
Amazon EC2

Examples

Create the target group, configure health checks, register EC2, confirm creation, then associate it with an ALB.

Example 1 — Open Create Target Group

Start the wizard from the EC2 Load Balancing menu.

  1. Open the EC2 console in your Region.
  2. In the left navigation, under Load Balancing, choose Target Groups.
  3. Choose Create target group.
EC2 Target Groups create target group button
Amazon EC2

How It Works

  1. Target Groups is an EC2 console section shared by ALB and NLB workflows.
  2. Region must match the VPC and instances you will register.
  3. Create opens a multi-step wizard; nothing is live until you finish.
  4. Existing groups stay listed here when you return to edit registration or health checks.

Example 2 — Basic Configuration and Health Checks

Choose instances, protocol, VPC, and a health check path your app can answer.

  1. Select target type Instances (for this tutorial).
  2. Enter a name, choose protocol and port (for example HTTP and 80), and select the VPC of your instances.
  3. Under health checks, set a path such as / or /health and confirm the success codes match your app.
Target group basic configuration protocol VPC and health check
Amazon EC2

How It Works

  1. Protocol/port is what the ALB uses to talk to instances—not the client-facing listener port.
  2. VPC must contain the instances you plan to register.
  3. Health checks must return a success code on that path or targets stay unhealthy. See a deeper ALB health checks guide when you tune thresholds.
  4. Next moves you to register targets before the group is finalized.

Example 3 — Register EC2 Instances

Select instances and include pending registration when the console offers it.

  1. On the register targets step, select one or more EC2 instances.
  2. Confirm the port matches the target group (override per instance only if needed).
  3. If shown, use Include as pending below so instances appear under pending registration until checks succeed.
  4. Choose Include as pending below / continue as prompted, then proceed to review.
Register EC2 instances including pending targets in target group
Amazon EC2

How It Works

  1. Registration adds instance IDs to the group; traffic waits on health.
  2. Pending is expected briefly while checks start—prolonged pending usually means SG or app issues.
  3. Port override helps when one instance serves a different process port.
  4. You can register more targets later from the group’s Targets tab.

Example 4 — Review and Create

Confirm settings and create the target group.

  1. Review name, protocol, VPC, health check, and selected targets.
  2. Choose Create target group.
  3. Open the new group and watch target health move from initial / unused toward healthy once the ALB (or checks) can reach the app.
Target group created successfully in the EC2 console
Amazon EC2

How It Works

  1. The group exists independently until a listener rule references it.
  2. Unused health can appear when no load balancer is attached yet—attach a listener next.
  3. Healthy means checks succeeded; only then should you expect production traffic.
  4. Edit anytime to change health checks or register/deregister targets.

Example 5 — Associate the Group with an ALB

Point a listener default (or rule) action at this target group.

  1. Create or open your ALB with the ALB step-by-step guide.
  2. On an HTTP or HTTPS listener, set the default action (or a rule) to Forward to this target group.
  3. On the target group details page, confirm the associated load balancer appears.
  4. Test the ALB DNS name, then map a domain with Route 53 when ready. For gradual cutovers, consider weighted target groups.
Target group details and load balancer association in console
Amazon EC2

How It Works

  1. Association is via listener rules—not a separate “attach” checkbox alone.
  2. One ALB, many groups is normal for path/host routing or blue/green.
  3. HTTPS listeners need an ACM certificate; targets can still speak HTTP.
  4. DNS last: prove the ALB hostname works before changing production Route 53 records.

Edge Cases & Pitfalls

Most unhealthy targets are security groups, wrong ports, or health check paths.

sg

ALB cannot reach the instance port

Allow inbound from the ALB security group to the target port on the instance security group.

health

Health check path returns 404 or 301

Match the success codes to what the app returns, or change the path to a real health endpoint.

port

Listener 443 vs target 80 confusion

Clients hit 443 on the ALB; targets often listen on 80/8080. Configure both sides correctly.

vpc

Wrong VPC selected

Instances outside the target group VPC cannot register. Recreate or pick the matching VPC.

unused

Targets show unused

No listener rule forwards to this group yet. Attach a default action or rule on the ALB.

drain

Requests fail during deploy

Tune deregistration delay and drain connections before terminating instances during rolling updates.

Key Takeaways

  • Listeners accept clients; target groups define backends, ports, and health checks.
  • Register EC2, then wait for healthy before trusting production traffic.
  • Wire via listener rules on the ALB; multiple groups enable routing and blue/green.
  • Next: prove the ALB DNS name, then point your domain with Route 53.

One line: create group → health check → register EC2 → forward from ALB listener → DNS.

Frequently Asked Questions

Listeners accept client connections on a load balancer front-end port and protocol, such as HTTPS on 443. A target group is a pool of backends (for example EC2 instances) with a protocol and port for forwarded traffic plus health checks. Listener rules decide which target group receives each request.
The target is staged for the group but may not yet receive traffic until health checks pass and any registration workflow completes. Ensure security groups and the application listen on the target port the group expects.
Yes. Common patterns include host-based or path-based routing to different services, blue/green deployments with two groups, or separate groups per microservice behind one ALB DNS name.
Clients connect to 443 on the load balancer. The ALB terminates TLS when configured and forwards to targets over the protocol and port on the target group, commonly HTTP to instance port 80 or 8080.
Check security groups (ALB nodes must reach the target port), that the application listens on the expected interface, and the health check path, port, and matcher code. Mismatched VPC or wrong port is a frequent cause.
Both are valid. Creating the group first (this guide) lets you verify registration and health before attaching a listener. You can also create or select a target group while creating the ALB.

Next: DNS for your ALB

When targets are healthy and the ALB responds on its DNS name, point your hostname at the load balancer with Route 53 alias records.

Route 53 →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

8 people found this page helpful