0
0
AWScloud~10 mins

Health checks configuration in AWS - Step-by-Step Execution

Choose your learning style9 modes available
Process Flow - Health checks configuration
Start: Configure Health Check
Set Protocol, Port, Path
Define Interval & Timeout
Set Healthy & Unhealthy Thresholds
Load Balancer Sends Health Requests
Check Response: Success or Fail
Update Instance Health Status
Use Health Status for Traffic Routing
End
This flow shows how health checks are configured and used to monitor instance health and route traffic accordingly.
Execution Sample
AWS
HealthCheck:
  Protocol: HTTP
  Port: 80
  Path: /health
  IntervalSeconds: 30
  TimeoutSeconds: 5
  HealthyThresholdCount: 3
  UnhealthyThresholdCount: 2
Defines a health check that sends HTTP requests every 30 seconds to /health on port 80, marking instances healthy or unhealthy based on response.
Process Table
StepActionHealth Check Request SentResponse ReceivedHealth Status UpdateTraffic Routing
1Send health check to instanceHTTP GET /health on port 80200 OKInstance marked healthy count 1Instance does not receive traffic
2Send health check to instanceHTTP GET /health on port 80200 OKInstance marked healthy count 2Instance does not receive traffic
3Send health check to instanceHTTP GET /health on port 80200 OKInstance marked healthy count 3 (healthy threshold met)Instance confirmed healthy, receives traffic
4Send health check to instanceHTTP GET /health on port 80500 ErrorInstance marked unhealthy count 1Instance still receives traffic
5Send health check to instanceHTTP GET /health on port 80TimeoutInstance marked unhealthy count 2 (unhealthy threshold met)Instance marked unhealthy, traffic stopped
6Send health check to instanceHTTP GET /health on port 80200 OKInstance marked healthy count 1Instance still does not receive traffic
7Send health check to instanceHTTP GET /health on port 80200 OKInstance marked healthy count 2Instance still does not receive traffic
8Send health check to instanceHTTP GET /health on port 80200 OKInstance marked healthy count 3 (healthy threshold met)Instance marked healthy, traffic resumes
9End monitoringNo requestNo responseHealth check monitoring continuesTraffic routed based on latest health status
💡 Health check monitoring runs continuously; traffic routing updates based on health status thresholds.
Status Tracker
VariableStartAfter Step 1After Step 2After Step 3After Step 4After Step 5After Step 6After Step 7After Step 8Final
HealthyCount0123001233
UnhealthyCount0000120000
InstanceHealthUnknownHealthy (pending)Healthy (pending)HealthyUnhealthy (pending)UnhealthyUnhealthy (pending)Unhealthy (pending)Healthy (pending)Healthy
TrafficRoutingNo trafficNo trafficNo trafficReceives trafficReceives trafficNo trafficNo trafficNo trafficReceives trafficReceives traffic
Key Moments - 3 Insights
Why does the instance not immediately become healthy after one successful health check?
Because the HealthyThresholdCount is 3, the instance must pass 3 consecutive successful checks before being marked healthy, as shown in steps 1-3 in the execution_table.
Why does traffic stop only after two failed health checks?
The UnhealthyThresholdCount is 2, so the instance must fail 2 consecutive checks before being marked unhealthy and traffic is stopped, as seen in steps 4-5.
What happens if the instance recovers after being unhealthy?
It must pass the healthy threshold count again (3 successful checks) before traffic resumes, as shown in steps 6-8.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution_table, what is the HealthyCount after step 3?
A2
B3
C1
D0
💡 Hint
Check the 'HealthyCount' variable in variable_tracker after step 3.
At which step does the instance stop receiving traffic due to health check failure?
AStep 4
BStep 3
CStep 5
DStep 6
💡 Hint
Look at the 'TrafficRouting' column in execution_table where traffic changes to stopped.
If the UnhealthyThresholdCount was set to 1, how would the traffic routing change after step 4?
ATraffic would stop immediately after step 4
BTraffic would continue as normal
CTraffic would stop after step 5
DTraffic would never stop
💡 Hint
Refer to how UnhealthyThresholdCount affects traffic routing in execution_table steps 4 and 5.
Concept Snapshot
Health checks monitor instance health by sending requests at intervals.
Set protocol, port, and path for checks.
Define thresholds for healthy/unhealthy counts.
Instance marked healthy after consecutive successes.
Instance marked unhealthy after consecutive failures.
Traffic routed only to healthy instances.
Full Transcript
Health checks configuration involves setting up periodic requests from a load balancer to instances to verify their health. The configuration includes protocol, port, path, interval, timeout, and thresholds for marking instances healthy or unhealthy. The load balancer sends requests at the defined interval and waits for responses within the timeout. If an instance responds successfully enough times consecutively, it is marked healthy and receives traffic. If it fails enough times consecutively, it is marked unhealthy and traffic is stopped. This process repeats continuously to ensure traffic is only sent to healthy instances.