Cloud concept · Updated

Health Checks - Health checks are automated tests that determine whether a component is functioning and suitable for receiving work.

In short

Health checks turn observations about infrastructure and applications into signals for traffic routing, deployment decisions, and automated recovery. Their value depends on testing the right behavior and connecting failures to appropriate actions without causing unnecessary restarts or cascading outages.

Cloud Concepts Hub →

6 key aspects of Health Checks

Effective health checks provide meaningful, stable signals that drive appropriate routing, deployment, and recovery actions without amplifying failures.

01
Decision-specific health signals

Separate whether a component is alive, ready for traffic, or still starting. A dependency outage might justify removing traffic without restarting an otherwise functioning process.

02
Meaningful probe coverage

Choose connection, protocol, or functional tests according to the failure modes that matter. A successful HTTP response should represent useful application behavior, not merely a reachable web server.

03
Thresholds and stabilization

Tune timeouts, intervals, and consecutive-result thresholds against measured startup and response times. Startup allowances and recovery thresholds reduce false failures and repeated transitions between healthy and unhealthy states.

04
Explicit recovery integration

Connect health results to routing, replacement, restart, or rollback policies deliberately. A load balancer excluding a target and an orchestrator replacing that target are separate actions.

05
Failure containment

Avoid expensive probes and shared-dependency checks that can simultaneously disable every replica. Maintain spare capacity and understand what the routing layer does when no healthy backend remains.

06
Observable recovery and deployment gates

Use health outcomes alongside logs, metrics, and platform events to diagnose failures and validate releases. Test the complete recovery path against recovery-time requirements rather than assuming fast detection guarantees fast restoration.

Cloud services for Health Checks

Elastic Load Balancing directs requests according to target health, while EC2 Auto Scaling can replace unhealthy instances when the appropriate health-check integration is enabled. ECS and EKS manage container health and lifecycle decisions, which must be coordinated with external traffic eligibility. CodeDeploy adds deployment validation and controlled traffic transitions for supported platforms. CloudWatch supplies broader metrics, alarms, and synthetic checks, including validation for serverless applications without conventional backend probes. Together, these services support detection, traffic isolation, recovery, and release validation, but their settings must align: a load-balancer failure does not automatically imply a container restart, instance replacement, or deployment rollback.

Amazon EC2 Auto ScalingAmazon EC2 Auto Scaling

Auto Scaling replaces instances it determines are unhealthy to maintain desired capacity. Enable Elastic Load Balancing health checks when application-level target failures should trigger replacement, and configure a suitable health check grace period.

AWS CodeDeployAWS CodeDeploy

CodeDeploy coordinates deployment validation and traffic changes for supported compute platforms. Lifecycle validation hooks, load-balancer integration where supported, and CloudWatch alarm-based stopping or rollback help prevent unhealthy revisions from becoming the active deployment.

Amazon CloudWatchAmazon CloudWatch

CloudWatch provides metrics and alarms that complement individual backend health results. CloudWatch Synthetics can exercise application endpoints, while error and latency alarms can detect failures missed by shallow probes and support deployment rollback decisions.

Health Checks exam questions

Real practice exam questions on Health Checks, with the correct answer and its explanation. Answer them with every option in the exam simulator.

DVA-C02

A company uses AWS CodeDeploy in-place deployments to release an application to Amazon EC2 instances behind an Application Load Balancer. The deployment group is already configured to automatically roll back failed deployments. The AppSpec file's ValidateService script currently checks only whether the application process is running.

A recent release started successfully and returned HTTP 200 from its static /health endpoint, but an incorrect application configuration prevented it from reading required data from a downstream service. CodeDeploy marked the deployment successful. The previous revision can still access the downstream service correctly.

The developer must make CodeDeploy detect this type of failure during future deployments and trigger the existing rollback behavior without adding an external monitoring system. Which change should the developer make?

Show answerCORRECT ANSWER

Update the ValidateService script to execute a representative application request that reads from the downstream service, verify the response, and exit with a nonzero status if validation fails.

ValidateService runs after the new application has started. A functional check tests behavior that a process check or static endpoint cannot verify. Returning a nonzero exit status fails the lifecycle event and deployment, allowing the configured automatic rollback to restore the previous revision.

SAP-C03

An industrial equipment company receives UDP telemetry through internet-facing Network Load Balancers (NLBs) in two AWS Regions. Each Region has sufficient capacity and independently replicated configuration data to process all telemetry. Devices can send to either of two destination IPv4 addresses that customers permanently allowlist. The devices cannot refresh DNS records during an outage and retry interrupted transmissions by creating new flows.

Both Regions should receive traffic during normal operation. If either Region becomes unable to process telemetry, new flows must automatically reach the healthy Region without changing the allowlisted addresses. A regional application can stop processing telemetry when its local configuration service fails even though its UDP listener and a separate TCP liveness port remain available. Each application instance exposes an HTTP /ready endpoint that returns success only when telemetry processing and the local configuration service are operational. Currently, the NLB target groups use the TCP liveness port for health checks.

Which solution meets these requirements?

Show answerCORRECT ANSWER

Create a standard IPv4 AWS Global Accelerator with a UDP listener and an endpoint group containing the NLB in each Region. Enable traffic to both endpoint groups and give the devices the accelerator's two static IPv4 addresses. Change the NLB target group health checks to use HTTP /ready.

A standard accelerator provides two static anycast IPv4 addresses and supports UDP listeners with NLB endpoints in multiple Regions. It routes new flows to healthy endpoints without requiring client DNS refreshes or address changes. For NLB endpoints, Global Accelerator uses the load balancer's health information. Configuring the NLB target groups to check /ready makes regional endpoint health reflect whether the application can actually process telemetry.

SAA-C03

A company runs an API on Amazon EC2 instances across two Availability Zones behind an Application Load Balancer (ALB). All instances belong to one target group. During an outage of a shared database, every instance's health check endpoint returns HTTP 503. The ALB reports every registered target as unhealthy in both Availability Zones. However, application access logs show that the ALB continues forwarding new API requests to these instances, which return errors.

Which explanation accounts for the ALB's behavior?

Show answerCORRECT ANSWER

The ALB fails open when the target group contains only unhealthy registered targets across its enabled Availability Zones and routes requests to those targets.

When all registered targets in a target group are unhealthy across the enabled Availability Zones, an ALB fails open and routes requests to them rather than withholding all traffic. Health checks therefore do not guarantee that requests will never reach unhealthy targets.

Practice Health Checks in a full exam

Questions on Health Checks in each practice exam, with every answer option and an explanation for each:

Start a free practice exam

What is Health Checks

3 min read

A health check evaluates a component against an explicit definition of acceptable operation. A TCP connection can establish that a port accepts connections, while an HTTP request can verify that an application responds with an expected status. A functional check might exercise a representative transaction. These checks provide different levels of confidence: a running process or successful connection does not prove that an application can serve useful requests.

Health signals should match the decision they control. A liveness check asks whether restarting a component could restore operation. A readiness check asks whether it should receive new work. A startup check allows initialization to finish before other probes enforce their normal limits. For example, an application loading a large cache might be alive but not ready. Restarting it repeatedly during initialization prevents recovery rather than helping it.

Load balancers use health checks to identify backends eligible for traffic. Engineers configure the protocol, port, request path, timeout, interval, and success criteria, along with failure and recovery thresholds. When a backend becomes unhealthy, routing can shift to healthy capacity while another controller repairs or replaces the failed component. Removing a backend from routing does not itself restart it, create replacement capacity, or preserve in-flight requests. Graceful draining, retries, and sufficient spare capacity remain necessary.

Do not assume that an unhealthy status always blocks traffic. Some load balancers deliberately fail open when every backend is unhealthy. For example, an Application Load Balancer routes to its unhealthy targets when a target group contains only unhealthy registered targets across its enabled Availability Zones. Understand the implementation's all-unhealthy behavior and maintain redundancy across failure domains rather than treating health checks as a substitute for available capacity.

Automated replacement requires an explicit connection between the health signal and the recovery controller. An EC2 instance can pass infrastructure status checks while its application fails. An Auto Scaling group must be configured to use Elastic Load Balancing health results if those failures should trigger replacement. Its health check grace period protects newly launched instances from premature health-based replacement; it does not make an unready application eligible for load-balancer traffic.

Container platforms also expose distinct failure signals. In Kubernetes, readiness failures remove Pods from normal Service traffic, while repeated liveness failures can restart containers. Startup probes defer liveness and readiness probing until startup succeeds. In Amazon ECS, inspect task-definition health checks, essential-container exits, load-balancer target health, service events, and the service health check grace period. A service repeatedly replacing tasks may be reacting correctly to a bad application build, or incorrectly to an unsuitable probe.

During deployment troubleshooting, compare failing and working versions, then verify the probe path, listening address, container port mappings, security groups, network ACLs, response codes, and initialization time. An HTTP redirect, authentication requirement, or virtual-host mismatch can fail a probe even when ordinary user requests succeed. Blue/green and rolling deployments should require new capacity to become healthy before removing old capacity. For serverless deployments, use validation invocations, synthetic requests, and error or latency alarms rather than assuming there is a conventional instance health endpoint.

Detection speed trades off against stability. Short intervals and low failure thresholds detect faults quickly but increase probe traffic and sensitivity to transient delays. Deep checks can expose broken dependencies, but making every instance fail liveness during a shared database outage can create a restart storm. Keep checks inexpensive, bound dependency calls with timeouts, and choose whether dependency failure should affect readiness, liveness, or only an alarm.

Finally, measure end-to-end recovery rather than only probe latency. Detection, routing changes, provisioning, initialization, and data recovery all contribute to the recovery time objective. Health checks do not establish the recovery point objective or guarantee data durability; replication, backups, and recovery procedures determine acceptable data loss. Correlate probe results with application logs, platform events, metrics, and recent changes before selecting a recovery action.

Learn Health Checks in lessons

4 short lessons on Health Checks in 3 certification courses.

Open the lessons