Ref: https://learn.cantrill.io/courses/1820301/lectures/41301585 and https://learn.cantrill.io/courses/1820301/lectures/41301586
PART A - Configuring a R53 Failover Routing Policy
STEP 1: Create a Health Check for your Primary Resource
R53 → Health checks → Create health check
- Create an endpoint health check for the EC2 application
- UI screenshots and steps available in theory lesson
- Endpoint can be defined with public IP address or public DNS name
- if using IP address, be sure to use an Elastic IP address so that the address will be static even if the EC2 instance is stopped or has problems
- 💡 Health checks start with unknown status!
- Need to gather enough info of the website first
- Will take some time to become healthy/unhealthy
STEP 2: Create Failover Records
R53 → Hosted zones → <SELECT_HOSTED_ZONE> → Create record
- Quick create vs Wizard → select Wizard to be guided step-by-step
- Select a routing template in the UI
- Primary failover record configuration:
- Associate created health check to the primary failover record
- Secondary failover record configuration:
- Two failover records (primary and secondary) should now be in place, with a health check associated to the primary health record
STEP 3: Test the Failover Routing
- Simulate failure by stopping EC2 instance
- After a few minutes, S3 website should be shown instead when querying the IP address
- Restart the EC2 instance to simulate system being recovered
- After a few minutes, EC2 website should be shown again when querying the IP address
PART B - Configuring a R53 Private Hosted Zone