A running EC2 web instance with an health check defined for it in Route 53
- Create a failover record that will failover to another record if an health check isn't passing
- Make sure TTL is 30
- Associate the failover record with the health check you have
- Go to Route 53 service
- Click on "Hosted Zones" in the left-side menu
- Click on your hosted zone
- Click on "Created record"
- Insert "failover" in record name and set record type to A
- Insert the IP of your instance
- Set the routing policy to failover
- Set TTL to 30
- Associate with an health check
- Add another record with the same properties as the previous one
- Click on "Create records"
- Go to your EC2 instance and edit its security group to remove the HTTP rules
- Use your web app and if you print the hotsname of your instance then you will notice, a failover was performed and a different EC2 instance is used