This segment focuses on implementing a failover routing policy using AWS Route 53, which involves redirecting traffic from a primary to a secondary resource in case of failure. Here's a concise summary and key points:
Failover Routing Policy in AWS Route 53
- Objective: Ensure high availability by automatically redirecting DNS queries from an unhealthy primary resource to a healthy secondary resource.
- Components:
- Route 53: Manages DNS records and health checks.
- EC2 Instances: Serve as primary and secondary (disaster recovery) resources.
- Health Checks: Monitor the health of the resources.
Implementation Steps
- Health Check Association:
- Mandatory for the primary resource.
- Optional for the secondary resource.
- Determines the health status of the resources.
- DNS Request Handling:
- Route 53 responds with the primary record if the primary resource is healthy.
- Route 53 automatically fails over to the secondary record if the primary resource is unhealthy.

Hands-on Example
- Domain:
failover.stephanetheteacher.com
- Record Type: A (Address Record)
- TTL (Time to Live): Set to a low value (60 seconds) to quickly propagate changes.
- Routing Policy: Failover, with options for primary or secondary records.
- Health Check Association:
- Primary record associated with a health check named
EU-central-1.
- Secondary record can optionally be associated with its health check.
- Implementation:
- Create primary and secondary records in Route 53.
- Associate the primary record with a health check.
- Optionally associate the secondary record with a health check.
- Test failover by simulating a failure (e.g., editing security group rules to block traffic).
Testing Failover
- Triggering a Failure: Edit inbound rules of the security group to block traffic to the primary instance, causing the health check to fail.
- Observation: After the health check fails, Route 53 automatically redirects traffic to the secondary instance.
- Recovery: Edit the security group to allow traffic again, which restores the health check status and fails back to the primary instance.
Conclusion