AWS Route 53: Failover Routing Policy
Introduction
The Failover Routing Policy in Amazon Route 53 ensures high availability by automatically switching traffic from a primary resource to a secondary (disaster recovery) resource when the primary becomes unhealthy. This is achieved by associating health checks with DNS records.
How Failover Routing Works
- Primary and Secondary Setup:
- Route 53 contains a primary DNS record pointing to a primary EC2 instance.
- A secondary DNS record points to a backup EC2 instance.
- Health Check Association:
- The primary record must be associated with a Route 53 health check.
- If the health check fails (instance becomes unreachable), Route 53 automatically fails over to the secondary record.
- Automatic DNS Resolution:
- When a client makes a DNS request, Route 53 responds with the healthy resource.
- If the primary instance is healthy, Route 53 returns the primary IP.
- If the primary fails, Route 53 switches to the secondary automatically.
Configuring Failover Routing in Route 53
Step 1: Create a Primary Failover Record
- Go to Route 53 → Hosted Zones.
- Click Create Record.
- Set Record Name:
- Example:
failover.stephanetheteacher.com
- Choose Record Type:
- A Record (for EC2 instance IP)
- Set the Value:
- Example: IP of EU-central-1 instance
- Choose Routing Policy:
- Set Failover Record Type:
- Associate with a Health Check:
- Example:
EU-central-1 Health Check
- Set TTL (Time to Live):