In the video at left,
Diego shows you how to
create a Route 53 health check

In the video at right,
Przemyslaw shows you how to
fail over to an S3 bucket if
a Route 53 health check fails

fail-over-s3-r53-diego
fail-over-s3-r53-Przemyslaw

I want to set up a static endpoint that my dynamic website can fail over to in the event there’s an issue with my infrastructure. How do I do that?

This article assumes you already have an active Amazon Route 53 hosted zone, that the dynamic version of your website is hosted on an EC2 instance, and that the Route 53 hosted zone is already successfully routing website traffic to your EC2 instance.

To configure the hosted zone to fail over to a static website hosted in an Amazon S3 bucket when a Route 53 health check returns unhealthy, start by creating a static website following the instructions at Configure a Bucket for Website Hosting. This static website will be what users see when your hosted zone fails over. Once your health check returns healthy again, the hosted zone will automatically start routing traffic to your primary endpoint.

Note: When naming the bucket, be sure that the S3 bucket name is the same as the name of your record.

Next, create the Route 53 health check:

  1. Sign in to the Amazon Route 53 console, and then from the navigation bar on the left, choose Health checks.
  2. Choose Create health check, and input the following:
    For Name, type a meaningful 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, type the IP and host name for your EC2 instance.
    For Port, choose 80.
    Leave Path empty, or specify the page you want to check.
  3. Choose Next.
  4. Choose Create health check.

Note: These instructions omit advanced configuration steps that you can use to customize aspects of your health check. For more details, see Advanced Configuration.

Next, create a record set for your primary endpoint:

  1. From the Amazon Route 53 console, choose Hosted zones.
  2. Select Domain Name of the hosted zone in which you want to create the record.
  3. Choose Create Record Set, and create a record set with the following (for all other fields, use values that fit your use case):
    For Name, type the value, making sure it is the same as the S3 bucket name.
    For Type, use A – IPV4 address.
    For Alias, leave it as No.
    For Routing Policy, choose Failover.
    For Failover Record Type, leave it as Primary.
    For Associate with Health Check, choose Yes, and choose the health check you created previously.
  4. Choose Create.

Last, create the failover endpoint:

  1. In the Hosted zones pane, select the hosted zone in which you want to create the record.
  2. Choose Go to Record Sets.
  3. Choose Create Record Set, and input the following:
    For Name, use the same value you entered for the primary record.
    For Type, choose A – IPV4 address.
    For Alias, choose Yes.
    Note: Aliases automatically use a time to live (TTL) that matches the alias target.
    For Alias Target, choose the S3 bucket you created previously.
    For Routing Policy, choose Failover.
    For Failover Record Type, choose Secondary.
    For Set ID, type a name.
    Note: The name for the Set ID on your failover endpoint must be different from the name of the Set ID on your primary endpoint.
    For Associate with Health Check, choose No.
  4. Choose Create.

Did this page help you? Yes | No

Back to the AWS Support Knowledge Center

Need help? Visit the AWS Support Center

Published: 2016-08-11

Updated: 2017-11-13