I want to set up an Amazon Simple Storage Service (Amazon S3) bucket as a static endpoint that my Amazon Route 53 hosted zone can fail over to when there's an issue with my infrastructure.
Resolution
Configure a static website on Amazon S3
To configure an S3 bucket as a static endpoint for your Route 53 hosted zone to fail over to, see Tutorial: Configuring a static website on Amazon S3.
The static website is what you see when the hosted zone fails over. After your health check returns to healthy, the hosted zone automatically routes traffic to your primary endpoint in Amazon Elastic Compute Cloud (Amazon EC2).
Note:
Create the Route 53 health check
Complete the following steps:
- Open the Amazon Route 53 console.
- In the navigation pane, choose Health checks.
- Choose Create health check, and then enter the following values:
For Name, enter a name for the health check.
For What to monitor, choose Endpoint.
For Specify endpoint by, choose IP address.
For Protocol, choose HTTP.
For IP address and Host name, enter the IP address and hostname for your EC2 instance.
For Port, choose 80.
Keep Path empty, or specify the page that you want to check.
- Choose Next.
- For Create alarm, choose Yes.
- Choose Create health check.
Note: For more information, see Creating and updating health checks.
Create a record set for your primary endpoint
Complete the following steps:
- Open the Amazon Route 53 console.
- In the navigation pane, choose Hosted zones.
- For Domain name, choose the domain of the hosted zone that you want to create the record for.
- Choose Create record, and then create a record set with the following values:
For Record Name, enter the same name as your S3 bucket name.
For Record type, choose A – Routes traffic to an IPV4 address and some AWS resources.
For Alias, keep it Off.
For Routing Policy, choose Failover.
For Failover Record Type, choose Primary.
For Record ID, enter a name.
For Health check ID, select your health check.
Enter other values for your use case.
- Choose Create records.
Create the failover endpoint
Complete the following steps:
- Open the Amazon Route 53 console.
- In the navigation pane, choose Hosted zones.
- Choose the hosted zone that you want to create the record for.
- Choose Create record, and then enter the following values:
For Record name, use the same value that you entered for the primary record.
For Record type, choose A – Routes traffic to an IPV4 address and some AWS resources.
For Alias, choose Yes.
Note: Aliases automatically use a time to live (TTL) that matches the alias target.
Under Route traffic to, for Alias to S3 website endpoint, select your S3 bucket.
For Routing Policy, choose Failover.
For Failover Record Type, choose Secondary.
For Record ID, enter a name.
Note: The name for the Record ID on your failover endpoint must be different from the name of the Record ID on your primary endpoint.
(Optional) For Health check ID, choose a health check.
(Optional) For Evaluate target health, turn off the option. When the target is an S3 bucket, the option doesn't work. For more information, see Failover routing.
- Choose Create records.
Related information
Choosing between alias and non-alias resource records
Configuring DNS failover
Monitoring health check status and getting notifications