0
0
AWScloud~10 mins

Target groups concept in AWS - Step-by-Step Execution

Choose your learning style9 modes available
Process Flow - Target groups concept
Client sends request
Load Balancer receives request
Load Balancer checks Target Group
Select healthy target from Target Group
Forward request to selected target
Target processes request and responds
Load Balancer sends response back to client
The load balancer receives client requests, checks the target group for healthy targets, forwards the request to one, and returns the response.
Execution Sample
AWS
Client -> Load Balancer -> Target Group -> Target Instance
Target Instance -> Load Balancer -> Client
Shows the flow of a request from client through load balancer to a target in the target group and back.
Process Table
StepActionLoad Balancer DecisionTarget Group StateResult
1Client sends requestReceives requestTargets: [Instance1(healthy), Instance2(healthy)]Request accepted
2Load Balancer checks target groupSelects healthy targetTargets: [Instance1(healthy), Instance2(healthy)]Instance1 selected
3Forward request to Instance1ForwardingTargets unchangedRequest sent to Instance1
4Instance1 processes requestNo changeTargets unchangedResponse generated
5Load Balancer sends response to clientNo changeTargets unchangedClient receives response
6Health check detects Instance2 unhealthyNo requestTargets: [Instance1(healthy), Instance2(unhealthy)]Instance2 marked unhealthy
7Next request arrivesSelects healthy targetTargets: [Instance1(healthy), Instance2(unhealthy)]Instance1 selected
8Forward request to Instance1ForwardingTargets unchangedRequest sent to Instance1
9Instance1 processes requestNo changeTargets unchangedResponse generated
10Load Balancer sends response to clientNo changeTargets unchangedClient receives response
💡 Execution stops after client receives response and target group updates health status.
Status Tracker
VariableStartAfter Step 2After Step 6After Step 9Final
Targets Health[Instance1: healthy, Instance2: healthy][Instance1: healthy, Instance2: healthy][Instance1: healthy, Instance2: unhealthy][Instance1: healthy, Instance2: unhealthy][Instance1: healthy, Instance2: unhealthy]
Selected TargetNoneInstance1Instance1Instance1Instance1
Request StatusNoneReceivedReceivedProcessedProcessed
Key Moments - 3 Insights
Why does the load balancer skip Instance2 after it becomes unhealthy?
Because the load balancer only forwards requests to healthy targets in the target group, as shown in steps 6 and 7 where Instance2 is marked unhealthy and skipped.
What happens if all targets in the target group are unhealthy?
The load balancer cannot forward requests to any target, so requests will fail or be dropped. This is implied by the load balancer selecting only healthy targets in the execution table.
How does the load balancer know which target to select?
It uses health checks to determine which targets are healthy and then selects one based on the load balancing algorithm, as shown in step 2 where it selects Instance1 because both are healthy.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution table, which instance is selected at step 7?
AInstance1
BInstance2
CNo instance selected
DBoth instances
💡 Hint
Check the 'Load Balancer Decision' column at step 7 in the execution table.
At which step does Instance2 become unhealthy?
AStep 8
BStep 4
CStep 6
DStep 10
💡 Hint
Look at the 'Target Group State' column for changes in health status.
If Instance1 also became unhealthy, what would happen to the load balancer's selection?
AIt would select Instance1 anyway
BIt would have no healthy targets to select
CIt would select Instance2 anyway
DIt would forward requests to both instances
💡 Hint
Refer to the key moment about what happens if all targets are unhealthy.
Concept Snapshot
Target groups hold registered targets (like servers).
Load balancers send client requests only to healthy targets.
Health checks update target health status.
Unhealthy targets are skipped until healthy again.
This ensures reliable request routing and availability.
Full Transcript
A target group is a set of servers or instances that a load balancer uses to distribute incoming client requests. When a client sends a request, the load balancer receives it and checks the target group for healthy targets. It selects one healthy target and forwards the request. The target processes the request and sends a response back through the load balancer to the client. Health checks run regularly to mark targets as healthy or unhealthy. Unhealthy targets are skipped by the load balancer until they become healthy again. This process ensures requests are only sent to working servers, improving reliability and availability.