Reading30 min read·Module 2High exam weight

Route 53 Health Checks & Failover

Key concepts

  • Health check types

  • Calculated health checks

  • Failover routing policy

  • Private hosted zones

  • Health check thresholds

Introduction

Amazon Route 53 health checks monitor the health and performance of your web applications, servers, and other resources. When combined with DNS failover, health checks enable automatic routing of traffic away from unhealthy endpoints to healthy ones. This is fundamental to building highly available architectures on AWS.

Route 53 Health Checks Core Concept

Route 53 health checks can monitor three types of targets: endpoints (HTTP/HTTPS/TCP), other health checks (calculated), and CloudWatch alarms. When associated with DNS records, health checks enable automatic failover to healthy resources when primary endpoints become unavailable.


Types of Health Checks

Endpoint Health Checks

Endpoint health checks directly monitor the health of a resource by sending automated requests.

Endpoint Health Check Configuration

Monitoring Targets:

  • IP address (IPv4 or IPv6)
  • Domain name (resolves to IP)
  • HTTP, HTTPS, or TCP endpoints

Key Parameters:

  • Request Interval: 10 seconds (fast) or 30 seconds (standard)
  • Failure Threshold: Number of consecutive failures (1-10)
  • Health Checker Regions: Choose specific regions or let AWS choose
  • Port: TCP port to check (1-65535)
  • Path: URL path for HTTP/HTTPS checks (e.g., /health)
  • Search String: Text that must appear in response body (optional)
  • Latency Graphs: Enable for performance monitoring

How It Works: Route 53 health checkers in multiple data centers worldwide send requests to your endpoint. If 18% or more of health checkers report the endpoint as healthy, Route 53 considers it healthy.

Exam Tip

Endpoint health checks require the target to be publicly accessible from Route 53 health checker IP ranges. For private resources (internal ALB, private EC2), use CloudWatch alarm-based health checks or VPC endpoint monitoring patterns.

Calculated Health Checks

Calculated health checks aggregate the status of multiple child health checks into a single parent health check.

Calculated Health Check Logic

Aggregation Options:

  1. AND Logic: Healthy only if ALL child health checks are healthy

    • Use for critical dependencies that must all be available
  2. OR Logic: Healthy if at least ONE child health check is healthy

    • Use for redundant resources where any one being healthy is sufficient
  3. Threshold: Healthy if at least N of M child health checks are healthy

    • Use for minimum quorum scenarios (e.g., 2 of 3 database replicas)

Inversion: Any health check can be inverted (healthy becomes unhealthy and vice versa)

JSONCalculated Health Check Configuration
```json
{
  "HealthCheckConfig": {
    "Type": "CALCULATED",
    "HealthThreshold": 2,
    "ChildHealthChecks": [
      "health-check-id-1",
      "health-check-id-2",
      "health-check-id-3"
    ]
  }
}
```

CloudWatch Alarm Health Checks

CloudWatch alarm health checks monitor the state of a CloudWatch metric, enabling health checks for private resources or complex conditions.

CloudWatch Alarm Integration

How It Works:

  1. Create a CloudWatch alarm monitoring a metric (e.g., CPU, error rate, custom metric)
  2. Create a Route 53 health check that monitors the alarm's data stream
  3. Health check status reflects the alarm state:
    • Alarm state = OK → Health check = Healthy
    • Alarm state = ALARM → Health check = Unhealthy
    • Alarm state = INSUFFICIENT_DATA → Configurable (healthy or unhealthy)

Limitations:

  • Must be in the same AWS account
  • Does not support metric math alarms
  • Only supports standard-resolution metrics (not high-resolution)
Exam Tip

CloudWatch alarm-based health checks are the solution for monitoring private resources (private subnets, internal load balancers) that aren't accessible from Route 53 health checkers. Create a CloudWatch alarm on the resource's metrics and link it to a Route 53 health check.


Comparison of Health Check Types

Health Check Type Comparison

FeatureEndpointCalculatedCloudWatch Alarm
TargetPublic IP/domainOther health checksCloudWatch metric
ProtocolsHTTP, HTTPS, TCPN/AN/A
Private ResourcesNoVia child checksYes
Response ValidationStatus code, stringN/AAlarm threshold
Cost$0.50-$1.00/month$0.50/month$0.50/month + alarm
Latency MonitoringYesNoVia metric
Use CaseWeb servers, APIsAggregate statusPrivate endpoints

DNS Failover Configurations

Active-Passive Failover

The most common failover pattern uses a primary and secondary (standby) resource.

Active-Passive Failover

Configuration:

  1. Create health check for primary resource
  2. Create two records with same name, different values:
    • Primary: Points to main resource, associated with health check
    • Secondary: Points to backup resource (can have health check too)
  3. Use Failover routing policy

Behavior:

  • When primary is healthy → Route 53 returns primary record
  • When primary fails → Route 53 automatically returns secondary record
  • When primary recovers → Route 53 returns to primary (failback)
Active-Passive Failover Architecture
DNS failover from primary region to secondary region when health check detects failure

Active-Active Failover

Multiple resources actively serve traffic, with unhealthy ones removed from rotation.

Active-Active Failover

Supported Routing Policies:

  • Weighted: Distribute traffic by weight; unhealthy endpoints get zero traffic
  • Latency: Route to lowest latency endpoint; skip unhealthy ones
  • Geolocation: Route by user location; fail to next match if unhealthy
  • Multivalue Answer: Return up to 8 healthy IPs per query

Key Difference from Active-Passive:

  • All resources actively serve traffic
  • No single "standby" resource
  • Automatic removal of unhealthy endpoints from DNS responses
Exam Tip

Multivalue Answer routing returns up to 8 healthy IP addresses and can be used for simple client-side load balancing. However, it's NOT a replacement for a load balancer - it doesn't provide health check granularity, sticky sessions, or intelligent traffic distribution. Use ELB for true load balancing.


Health Check Configuration Deep Dive

Health Check Parameters

Request Interval:

  • Standard (30 seconds): Lower cost, suitable for most workloads
  • Fast (10 seconds): Faster detection, 3x the cost, requires more health checker regions

Failure Threshold:

  • Number of consecutive failures before marking unhealthy (1-10)
  • Lower threshold = faster failover but more false positives
  • Recommended: 3 for production workloads

Health Checker Regions:

  • Minimum of 3 regions required
  • More regions = more accurate health assessment
  • Can customize to match your user base geography

String Matching (HTTP/HTTPS):

  • Search first 5,120 bytes of response body
  • Must appear within 4 seconds of request
  • Case-sensitive exact match
  • Useful for validating application health, not just server availability
SHCreating Endpoint Health Check (CLI)
```bash
# Create HTTP health check with string matching
aws route53 create-health-check \
    --caller-reference "my-health-check-$(date +%s)" \
    --health-check-config '{
        "Type": "HTTP",
        "IPAddress": "203.0.113.10",
        "Port": 80,
        "ResourcePath": "/health",
        "RequestInterval": 30,
        "FailureThreshold": 3,
        "MeasureLatency": true,
        "EnableSNI": false,
        "SearchString": "OK"
    }'

# Create HTTPS health check with SNI
aws route53 create-health-check \
    --caller-reference "my-https-check-$(date +%s)" \
    --health-check-config '{
        "Type": "HTTPS",
        "FullyQualifiedDomainName": "api.example.com",
        "Port": 443,
        "ResourcePath": "/api/health",
        "RequestInterval": 10,
        "FailureThreshold": 2,
        "EnableSNI": true
    }'
```

Complex Failover Architectures

Multi-Region with Latency-Based Routing

Complex Configuration Pattern

Architecture:

                        ┌─────────────────┐
                        │   Route 53      │
                        │ Hosted Zone     │
                        └────────┬────────┘
                                 │
              ┌──────────────────┼──────────────────┐
              │                  │                  │
    ┌─────────▼─────────┐ ┌─────▼─────┐ ┌─────────▼─────────┐
    │  Latency Record   │ │  Latency  │ │  Latency Record   │
    │    us-east-1      │ │  Record   │ │    eu-west-1      │
    │  (Health Check)   │ │ ap-south-1│ │  (Health Check)   │
    └─────────┬─────────┘ └─────┬─────┘ └─────────┬─────────┘
              │                 │                  │
    ┌─────────▼─────────┐ ┌─────▼─────┐ ┌─────────▼─────────┐
    │       ALB         │ │    ALB    │ │       ALB         │
    │   (Primary)       │ │           │ │   (Primary)       │
    └───────────────────┘ └───────────┘ └───────────────────┘

Behavior:

  1. Route 53 routes users to lowest-latency healthy region
  2. If regional endpoint fails health check, excluded from responses
  3. Users automatically routed to next-lowest-latency region

Failover with Static Error Page

S3 Static Failover Pattern

A common disaster recovery pattern uses S3 to host a static error page when the primary application is unavailable.

Setup:

  1. Primary: ALB with health check
  2. Secondary: S3 bucket configured for static website hosting
  3. CloudFront distribution with both origins (optional for HTTPS)

Route 53 Configuration:

  • Failover routing policy
  • Primary alias record → ALB (with health check)
  • Secondary alias record → CloudFront/S3 (no health check needed)

Use Case: Graceful degradation when entire application stack is unavailable

Static Failover to S3
Automatic failover to static S3 error page when primary application is unavailable

Application Recovery Controller (ARC)

AWS Application Recovery Controller

ARC provides a simplified way to manage recovery across AWS Regions and Availability Zones.

Key Components:

  • Routing Controls: On/off switches for traffic routing
  • Readiness Checks: Verify resources are ready to handle traffic
  • Safety Rules: Prevent unsafe configuration changes

Integration with Route 53:

  • Routing controls connect to Route 53 health checks
  • Update routing control → triggers health check state change → updates DNS

Benefits:

  • Single API call to fail over entire application
  • Safety rules prevent accidental misconfiguration
  • Works with private resources
  • No dependency on primary region during failover

Health Check Best Practices

Health Check Best Practices
  1. Use meaningful health check endpoints: Check application functionality, not just server reachability
  2. Set appropriate thresholds: Balance between fast failover and false positives
  3. Monitor health check status: Create CloudWatch alarms for health check state changes
  4. Test failover regularly: Verify failover works before you need it in production
  5. Use calculated health checks: Aggregate multiple checks for complex dependencies
  6. Consider TTL impact: Lower DNS TTL = faster failover propagation (but more DNS queries)
  7. Place failover resources in different regions: Ensure true isolation from primary
Common Pitfalls

Avoid These Mistakes:

  • Health checking a load balancer that's always "healthy" even when backends fail
  • Setting failure threshold too low (causes flapping)
  • Forgetting to associate health check with DNS record
  • Using endpoint health checks for private resources
  • Not testing failover before production deployment

CloudWatch Integration

Health Check CloudWatch Metrics

Route 53 publishes health check metrics to CloudWatch for monitoring and alerting.

Available Metrics:

  • HealthCheckStatus: 1 (healthy) or 0 (unhealthy)
  • HealthCheckPercentageHealthy: Percentage of health checkers reporting healthy
  • ConnectionTime: Time to establish TCP connection (ms)
  • SSLHandshakeTime: Time for SSL/TLS handshake (ms)
  • TimeToFirstByte: Time to first response byte (ms)

Alarm Examples:

# Alert when health check fails
Metric: HealthCheckStatus
Threshold: < 1
Period: 1 minute
Evaluation Periods: 1

Common Exam Scenarios

Exam Tip

Health Check Scenarios: Automatic failover to DR → Failover routing + health check | Remove unhealthy from DNS → Weighted/Latency + health checks | Monitor private DB → CloudWatch alarm health check | Failover if 2/3 fail → Calculated health check | Multiple healthy IPs → Multivalue answer | Maintenance page → Failover to S3

Q

A company has a web application running behind an ALB in us-east-1 and wants automatic failover to a static error page hosted in S3 if the application becomes unavailable. What Route 53 configuration should they use?

ASimple routing with two records
BWeighted routing with health checks
CFailover routing with health check on primary record
DMultivalue answer routing
Q

A solutions architect needs to monitor the health of an internal Application Load Balancer in a private subnet for DNS failover purposes. The ALB is not accessible from the internet. What is the BEST approach?

ACreate an endpoint health check using the ALB private IP address
BCreate a CloudWatch alarm monitoring ALB metrics and link it to a Route 53 health check
CUse a calculated health check monitoring EC2 instance health checks
DCreate an HTTP health check using the ALB DNS name
Q

A company wants to implement DNS-based failover for their multi-region application. Which Route 53 features should they use? (Select TWO)

ACNAME records
BHealth checks
CFailover routing policy
DSimple routing policy
EGeoproximity routing

Summary

Route 53 health checks are essential for building highly available applications on AWS. The three types (endpoint, calculated, CloudWatch alarm) cover different monitoring scenarios:

  • Endpoint: Public HTTP/HTTPS/TCP resources
  • Calculated: Aggregating multiple health checks
  • CloudWatch Alarm: Private resources and complex conditions

Combined with DNS failover routing policies, health checks enable automatic recovery from failures with minimal manual intervention. Understanding these concepts is critical for the SAA-C03 exam.

Related services

Route 53CloudWatch