Skip to main content

Route 53 Routing Policies

Overview​

Route 53 offers several routing policies to direct traffic based on different criteria.

┌─────────────────────────────────────────────────────────────┐
│ ROUTING POLICIES │
├─────────────────────────────────────────────────────────────┤
│ │
│ ┌─────────────────┐ ┌─────────────────────────────┐ │
│ │ SIMPLE │ │ A single destination │ │
│ └─────────────────┘ └─────────────────────────────┘ │
│ │
│ ┌─────────────────┐ ┌─────────────────────────────┐ │
│ │ WEIGHTED │ │ Weighted distribution │ │
│ └─────────────────┘ └─────────────────────────────┘ │
│ │
│ ┌─────────────────┐ ┌─────────────────────────────┐ │
│ │ LATENCY │ │ Lowest latency │ │
│ └─────────────────┘ └─────────────────────────────┘ │
│ │
│ ┌─────────────────┐ ┌─────────────────────────────┐ │
│ │ FAILOVER │ │ Automatic failover │ │
│ └─────────────────┘ └─────────────────────────────┘ │
│ │
│ ┌─────────────────┐ ┌─────────────────────────────┐ │
│ │ GEOLOCATION │ │ Based on user region │ │
│ └─────────────────┘ └─────────────────────────────┘ │
│ │
│ ┌─────────────────┐ ┌─────────────────────────────┐ │
│ │ GEOPROXIMITY │ │ Based on distance + bias │ │
│ └─────────────────┘ └─────────────────────────────┘ │
│ │
│ ┌─────────────────┐ ┌─────────────────────────────┐ │
│ │ MULTIVALUE │ │ Multiple answers + health │ │
│ └─────────────────┘ └─────────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────┘

1. Simple Routing​

The most basic routing: one request = one response.

┌─────────────────────────────────────────────────────────────┐
│ SIMPLE ROUTING │
├─────────────────────────────────────────────────────────────┤
│ │
│ User Route 53 │
│ │ │ │
│ │ "www.example.com?" │ │
│ ├─────────────────────────────►│ │
│ │ │ │
│ │ 192.0.2.44 │ │
│ │◄─────────────────────────────┤ │
│ │ │ │
│ │ (or multiple IPs, random order) │
│ │ 192.0.2.44, 192.0.2.45 │
│ │ │ │
│ │
│ Features: │
│ • No health checks │
│ • If multiple IPs, the client chooses │
│ • The simplest, but no failover │
│ │
│ Use cases: │
│ • Simple site with a single resource │
│ • Development/testing │
│ │
└─────────────────────────────────────────────────────────────┘

2. Weighted Routing​

Traffic distribution based on assigned weights.

┌─────────────────────────────────────────────────────────────┐
│ WEIGHTED ROUTING │
├─────────────────────────────────────────────────────────────┤
│ │
│ Configuration: │
│ • Record 1: 192.0.2.44 (weight: 70) │
│ • Record 2: 192.0.2.45 (weight: 20) │
│ • Record 3: 192.0.2.46 (weight: 10) │
│ │
│ Result: │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ │ │
│ │ 100 requests │ │
│ │ │ │ │
│ │ ▼ │ │
│ │ ┌─────────────────────────────────────────────┐ │ │
│ │ │▓▓▓▓▓▓▓▓▓▓▓▓▓▓│░░░░░░│████│ │ │ │
│ │ │ 70% │ 20% │ 10%│ │ │ │
│ │ │ .44 │ .45 │ .46│ │ │ │
│ │ └─────────────────────────────────────────────┘ │ │
│ │ │ │
│ └─────────────────────────────────────────────────────┘ │
│ │
│ Use cases: │
│ • A/B testing (90% version A, 10% version B) │
│ • Progressive migration (gradual shift) │
│ • Load distribution between regions │
│ │
│ Note: Weight 0 = no traffic to this target │
│ │
└─────────────────────────────────────────────────────────────┘

CLI Configuration​

# Record 1 - Production (70%)
aws route53 change-resource-record-sets \
--hosted-zone-id Z1234567890ABC \
--change-batch '{
"Changes": [{
"Action": "CREATE",
"ResourceRecordSet": {
"Name": "www.example.com",
"Type": "A",
"SetIdentifier": "production",
"Weight": 70,
"TTL": 60,
"ResourceRecords": [{"Value": "192.0.2.44"}]
}
}]
}'

# Record 2 - Canary (10%)
aws route53 change-resource-record-sets \
--hosted-zone-id Z1234567890ABC \
--change-batch '{
"Changes": [{
"Action": "CREATE",
"ResourceRecordSet": {
"Name": "www.example.com",
"Type": "A",
"SetIdentifier": "canary",
"Weight": 10,
"TTL": 60,
"ResourceRecords": [{"Value": "192.0.2.45"}]
}
}]
}'

3. Latency-Based Routing​

Directs to the AWS region with the lowest latency.

┌─────────────────────────────────────────────────────────────┐
│ LATENCY-BASED ROUTING │
├─────────────────────────────────────────────────────────────┤
│ │
│ Route 53 measures latency and directs to the fastest │
│ region for the user. │
│ │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ │ │
│ │ 🇨🇦 User Canada │ │
│ │ │ │ │
│ │ │ Which region? │ │
│ │ ▼ │ │
│ │ ┌─────────────┐ │ │
│ │ │ Route 53 │ │ │
│ │ │ │ │ │
│ │ │ Latency: │ │ │
│ │ │ us-east: 20ms ← Fastest! │ │
│ │ │ eu-west: 80ms │ │
│ │ │ ap-south: 200ms │ │
│ │ └──────┬──────┘ │ │
│ │ │ │ │
│ │ ▼ │ │
│ │ Response: ALB us-east-1 │ │
│ │ │ │
│ └─────────────────────────────────────────────────────┘ │
│ │
│ Use cases: │
│ • Multi-region application │
│ • Improve user experience globally │
│ • Reduce latency for all users │
│ │
└─────────────────────────────────────────────────────────────┘

4. Failover Routing​

Automatic failover to a backup resource.

┌─────────────────────────────────────────────────────────────┐
│ FAILOVER ROUTING │
├─────────────────────────────────────────────────────────────┤
│ │
│ Configuration: │
│ • Primary: ALB production (with health check) │
│ • Secondary: Static S3 site (maintenance page) │
│ │
│ NORMAL STATE (Primary healthy) │
│ ───────────────────────────── │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ │ │
│ │ User ──────► Route 53 ──────► ALB Prod │ │
│ │ │ ✓ Healthy │ │
│ │ │ │ │
│ │ └──╳── S3 (ignored) │ │
│ │ │ │
│ └─────────────────────────────────────────────────────┘ │
│ │
│ FAILOVER STATE (Primary unhealthy) │
│ ───────────────────────────────── │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ │ │
│ │ User ──────► Route 53 ──╳── ALB Prod │ │
│ │ │ ✗ Unhealthy │ │
│ │ │ │ │
│ │ └──────► S3 Maintenance │ │
│ │ "Site under │ │
│ │ maintenance" │ │
│ │ │ │
│ └─────────────────────────────────────────────────────┘ │
│ │
│ Use cases: │
│ • Disaster Recovery │
│ • Automatic maintenance page │
│ • Failover to secondary region │
│ │
└─────────────────────────────────────────────────────────────┘

Health Checks​

┌─────────────────────────────────────────────────────────────┐
│ HEALTH CHECKS ROUTE 53 │
├─────────────────────────────────────────────────────────────┤
│ │
│ Types of Health Checks: │
│ │
│ 1. ENDPOINT │
│ ───────── │
│ Checks an HTTP/HTTPS/TCP endpoint │
│ • URL: https://example.com/health │
│ • Port: 443 │
│ • Interval: 30 seconds │
│ • Threshold: 3 failures = unhealthy │
│ │
│ 2. CLOUDWATCH ALARM │
│ ───────────────── │
│ Based on a CloudWatch alarm │
│ • If alarm in ALARM state → unhealthy │
│ • Useful for internal metrics │
│ │
│ 3. CALCULATED │
│ ────────── │
│ Combines multiple health checks │
│ • OR: healthy if at least 1 is healthy │
│ • AND: healthy if all are healthy │
│ │
│ Configuration: │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ │ │
│ │ Protocol: HTTPS │ │
│ │ Host: www.example.com │ │
│ │ Path: /health │ │
│ │ Port: 443 │ │
│ │ Request Interval: 30 seconds │ │
│ │ Failure Threshold: 3 │ │
│ │ String Matching: "OK" (optional) │ │
│ │ │ │
│ └─────────────────────────────────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────┘

5. Geolocation Routing​

Routing based on the geographic location of the user.

┌─────────────────────────────────────────────────────────────┐
│ GEOLOCATION ROUTING │
├─────────────────────────────────────────────────────────────┤
│ │
│ Traffic is directed based on the user's country/continent, │
│ NOT based on latency. │
│ │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ │ │
│ │ 🇫🇷 France → server-fr.example.com │ │
│ │ 🇩🇪 Germany → server-de.example.com │ │
│ │ 🇬🇧 UK → server-uk.example.com │ │
│ │ 🌍 Europe (other) → server-eu.example.com │ │
│ │ 🌎 Default → server-us.example.com │ │
│ │ │ │
│ └─────────────────────────────────────────────────────┘ │
│ │
│ Use cases: │
│ • Localized content (language, currency) │
│ • Legal restrictions (GDPR, geo-restricted content) │
│ • Regulatory compliance │
│ • Serve region-specific content │
│ │
│ ⚠️ Important: │
│ Always configure a "Default" record for unmapped users! │
│ │
└─────────────────────────────────────────────────────────────┘

Policy Comparison​

PolicyCriterionHealth CheckUse Case
SimpleNone❌ NoSimple sites
WeightedWeight %✅ YesA/B testing, migration
LatencyPerformance✅ YesGlobal apps
FailoverAvailability✅ RequiredDR, maintenance
GeolocationCountry/Continent✅ YesLocalized content
GeoproximityDistance + bias✅ YesTraffic shaping
MultivalueMultiple IPs✅ YesSimple LB

Summary​

PolicyWhen to use it
SimpleSingle endpoint, no need for failover
WeightedControlled distribution, A/B testing
LatencyBest global performance
FailoverHigh availability, DR
GeolocationCountry-specific content, compliance

Next section: Lab Failover