Skip to Content

Health checks

Route 53 health checks for endpoints, other health checks and CloudWatch alarms, how health is decided, private endpoints, and automated DNS failover.

What it is

A Route 53 health check regularly tests whether a resource is working. Linked to a record, it gives automated DNS failover: Route 53 stops answering with a resource that fails its check.

For example, an app runs behind ALBs in us-east-1 and eu-west-1, with latency records for both. Each record has a health check. If eu-west-1 fails, Route 53 sends European users to us-east-1 until it recovers.

Health checks are also published as CloudWatch metrics, so alarms can be set on them.

Three kinds of health check

Three kinds of Route 53 health check: one that monitors an endpoint, from checkers around the world or from a source in the VPC; a calculated check that combines up to 255 child checks with AND, OR or NOT; and one that monitors a CloudWatch alarm on any metric Three kinds of Route 53 health check: one that monitors an endpoint, from checkers around the world or from a source in the VPC; a calculated check that combines up to 255 child checks with AND, OR or NOT; and one that monitors a CloudWatch alarm on any metric

What a health check can watch.
  1. Health checks that monitor an endpoint: an application, server or other resource.
  2. Calculated health checks: monitor other health checks.
  3. Health checks that monitor a CloudWatch alarm: full control, for example DynamoDB throttling, an RDS alarm or a custom metric. Useful for private resources.

Monitoring an endpoint

  • Health checkers in locations around the world (about 15 in the slides) send requests to the endpoint. The locations to use are configurable.
  • Interval: every 30 seconds (standard) or 10 seconds (fast, costs more).
  • Failure threshold: how many checks in a row must fail (or pass) to change the status; 3 by default.
  • Protocols: HTTP, HTTPS and TCP.
  • The endpoint is healthy if more than 18% of the health checkers report it healthy; otherwise it's unhealthy.
  • An HTTP or HTTPS check passes only when the endpoint answers with a 2xx or 3xx status code (within 2 seconds of connecting).
  • String matching: the check can also look for text in the first 5,120 bytes of the response.
  • The endpoint's firewall or security group must allow requests from the Route 53 health checkers' IP ranges (published in AWS's ip-ranges.json).

Calculated health checks

A calculated health check: the parent is healthy when at least two of its three child health checks pass, and each child monitors one web server A calculated health check: the parent is healthy when at least two of its three child health checks pass, and each child monitors one web server

One parent check combining several children.
  • Combine the results of several health checks into one.
  • Use OR, AND or NOT, or say how many children must pass.
  • Up to 255 child health checks.
  • Use case: take one web server down for maintenance without the parent check, and so the whole site, failing.

Private resources

Route 53's public health checkers are outside the VPC, so they can't reach private endpoints (a private subnet, or an on-premises server over VPN or Direct Connect). Two options:

  • CloudWatch alarm: create a CloudWatch metric and alarm for the private resource (for example the EC2 StatusCheckFailed metric), then a health check that monitors the alarm. This is the method in the slides.
  • Private endpoint health checks: create a health check source in the VPC (it gets an IP address in each of three AZs), and Route 53 checks private endpoints from inside the VPC. One source can serve up to 200 checks.

Updated since the slides

The slides say Route 53 health checks can't reach private resources, so a CloudWatch alarm is required. AWS has since added private endpoint health checks, run from a source inside the VPC. Both answers now work; on the exam, the CloudWatch alarm method is still a correct choice.

Pricing

Up to 50 health checks of AWS endpoints in an account are free. After that, a basic check costs $0.50 a month for an AWS endpoint and $0.75 for a non-AWS endpoint. Optional features (HTTPS, string matching, fast interval, latency measurement) cost extra each.

Exam tips

  • "Automatic DNS failover to a healthy Region" → health checks linked to records (failover, latency, weighted…).
  • "Health check for a resource in a private subnet" → health check on a CloudWatch alarm (or a private endpoint health check).
  • "Keep the site healthy while one server is in maintenance" → calculated health check.
  • "Health checks keep failing although the app works" → allow the Route 53 health checker IP ranges through the firewall.
  • "Check that the page contains specific text" → string matching (first 5,120 bytes).

Common traps

  • "Route 53 public health checkers can reach private IPs." They can't; use a CloudWatch alarm or a private endpoint health check.
  • "A 404 means healthy because the server answered." Only 2xx and 3xx pass.
  • "Simple routing records can use health checks." They can't.

Hands-on lab: a health check on a website

Goal: create a health check for a public web server and watch it turn unhealthy.

Costs money

A health check on an AWS endpoint is free (up to 50); the saa-web instance and its public IPv4 address cost about $0.02 an hour. Any Region works.

Before you start: run saa-web with its web server from the EC2 basics lab, with port 80 open.

Create the health check

Route 53 → Health checks → Create health check. Name saa-web-hc, monitor Endpoint, specify by IP address: the public IP of saa-web, protocol HTTP, port 80, path /. Keep the 30-second interval. Create.

Watch it pass

After a minute or two the status is Healthy. Open the Health checkers tab: each location reports its own result.

Break it

On saa-web, run sudo systemctl stop httpd. Within about two minutes the health check turns Unhealthy. Start the web server again and it recovers.

Expected result: a health check that follows the state of your web server, ready to drive DNS failover.

Clean up: delete saa-web-hc. Stop or terminate saa-web if you don't need it.

AWS documentation

On this page

Open notes

Spotted a mistake?

These notes are open source. Suggest a fix, or star the repo if they helped you.

Suggest an edit

For AI agents: llms.txt · llms-full.txt