# Health Checks

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

Cloud concept. Updated 2026-10-29. Page: https://blowstack.com/tools/cloud-concepts-hub/health-checks

> 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.

Practice exams covering Health Checks: [ANS-C01 AWS Certified Advanced Networking - Specialty](https://blowstack.com/practice-exams/aws-certified-advanced-networking-specialty), [DVA-C02 AWS Certified Developer - Associate](https://blowstack.com/practice-exams/aws-certified-developer-associate), [DOP-C02 AWS Certified DevOps Engineer - Professional](https://blowstack.com/practice-exams/aws-certified-devops-engineer-professional), [SAA-C03 AWS Certified Solutions Architect - Associate](https://blowstack.com/practice-exams/aws-certified-solutions-architect-associate), [SAP-C03 AWS Certified Solutions Architect - Professional](https://blowstack.com/practice-exams/aws-certified-solutions-architect-professional).

## 6 key aspects of Health Checks

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

1. **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.
2. **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.
3. **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.
4. **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.
5. **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.
6. **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 Scaling](https://blowstack.com/tools/cloud-services-hub/amazon-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 CodeDeploy](https://blowstack.com/tools/cloud-services-hub/aws-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 CloudWatch](https://blowstack.com/tools/cloud-services-hub/amazon-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.

### Question 1 (DVA-C02)

**Question:**

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?

**Correct 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.

**Explanation:** 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.

### Question 2 (SAP-C03)

**Question:**

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?

**Correct 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.

**Explanation:** 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.

### Question 3 (SAA-C03)

**Question:**

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?

**Correct 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.

**Explanation:** 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.

### Question 4 (DOP-C02)

**Question:**

A company deploys an Amazon ECS service on AWS Fargate by using rolling updates. Each task contains an essential reverse-proxy container and an essential application container. An Application Load Balancer (ALB) checks a static endpoint served by the proxy. Security policy requires this endpoint and its behavior to remain unchanged.

A defective release causes the application's request-processing loop to deadlock several minutes after startup. Both containers remain running, and the proxy continues returning HTTP 200 to ALB health checks. ECS reports the tasks as RUNNING, does not replace them, and completes the deployment even though application requests fail.

The application image already contains a Dockerfile HEALTHCHECK that invokes an installed diagnostic command. The command exits with a nonzero status when the request-processing loop is deadlocked and exits with zero otherwise. Neither container has a healthCheck configured in the ECS task definition. The diagnostic command does not terminate the application process.

A DevOps engineer must make ECS exclude tasks with deadlocked applications from the deployment's healthy task count and automatically replace those tasks. The solution must not change the ALB configuration or introduce custom monitoring automation.

Which change meets these requirements?

**Correct answer:** Configure a healthCheck in the application container's ECS task definition that runs the diagnostic command, and keep the application container essential.

**Explanation:** ECS monitors container health checks specified in the task definition; it does not automatically monitor a Dockerfile HEALTHCHECK. A failing check on an essential application container makes the task unhealthy. The ECS service scheduler replaces unhealthy tasks, and a load-balanced service with essential-container health checks requires those checks and the target group checks to pass before counting a task as healthy during deployment.

### Question 5 (ANS-C01)

**Question:**

A company runs a stateless API on EC2 instances in an Auto Scaling group across three Availability Zones. An Application Load Balancer (ALB) forwards requests to an instance-type target group attached to the group. The Auto Scaling group uses EC2 and Elastic Load Balancing health checks.

During scale-out, new instances enter the InService state before loading a local dataset. Loading takes 4–6 minutes after entering InService. The application's /ready endpoint returns HTTP 503 until loading completes and HTTP 200 afterward. The target group checks /ready every 15 seconds, accepts only HTTP 200, and has healthy and unhealthy thresholds of two checks. The Auto Scaling group's health check grace period is 60 seconds, and its default instance warmup is 600 seconds. No lifecycle hooks are configured.

New instances are repeatedly replaced before loading finishes. Existing instances remain healthy and provide sufficient capacity throughout scale-out. The company must allow new instances to complete initialization without routing application requests to them prematurely. Failure detection and automatic replacement behavior must remain unchanged for established instances that have been InService for at least 15 minutes. A longer replacement-protection window for newly launched instances is acceptable.

Which change meets these requirements?

**Correct answer:** Increase the Auto Scaling group's health check grace period to 480 seconds. Keep the target group's health check configuration unchanged.

**Explanation:** The grace period prevents Auto Scaling from replacing initializing instances because of failed load balancer health checks. The 480-second period accommodates the maximum six-minute initialization time and subsequent successful checks. The ALB independently withholds traffic from initializing targets while healthy existing targets remain available. Instances that have been InService for at least 15 minutes are outside both the original and revised grace periods, so their failure detection and replacement behavior remains unchanged.

## Practice Health Checks in a full exam

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

- [ANS-C01](https://blowstack.com/practice-exams/aws-certified-advanced-networking-specialty): 22 questions
- [DOP-C02](https://blowstack.com/practice-exams/aws-certified-devops-engineer-professional): 11 questions
- [SAP-C03](https://blowstack.com/practice-exams/aws-certified-solutions-architect-professional): 8 questions
- [SAA-C03](https://blowstack.com/practice-exams/aws-certified-solutions-architect-associate): 6 questions
- [DVA-C02](https://blowstack.com/practice-exams/aws-certified-developer-associate): 5 questions

## What is Health Checks

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.

- SAP-C03: Health Checks: regional failover signals (Premium), https://app.blowstack.com/lessons/health-checks-regional-failover-signals-sap-c03
- SAA-C03: Health Checks: target eligibility for load-balanced traffic (Premium), https://app.blowstack.com/lessons/health-checks-target-eligibility-for-load-balanced-traffic-saa-c03
- DOP-C02: Health Checks: application probe semantics (Premium), https://app.blowstack.com/lessons/health-checks-application-probe-semantics-dop-c02
- DOP-C02: Health Checks: load-balancer health signals (Premium), https://app.blowstack.com/lessons/health-checks-load-balancer-health-signals-dop-c02
