Menu
Amazon Route 53
Developer Guide (API Version 2013-04-01)

Routing Traffic to a Website that Is Hosted in an Amazon S3 Bucket

Amazon Simple Storage Service (Amazon S3) provides secure, durable, highly scalable cloud storage. You can configure an S3 bucket to host a static website that can include web pages and client-side scripts. (S3 doesn't support server-side scripting.)

To route domain traffic to an S3 bucket, use Amazon Route 53 to create an alias resource record set that points to your bucket. An alias resource record set is an Amazon Route 53 extension to DNS. It's similar to a CNAME resource record set, except you can create an alias resource record set both for the root domain, such as example.com, and for subdomains, such as www.example.com. You can create CNAME resource record sets only for subdomains.

Note

Amazon Route 53 doesn't charge for alias queries to S3 buckets or other AWS resources.

Prerequisites

Before you get started, you need the following:

  • An S3 bucket that is configured to host a static website. For more information, see Configure a Bucket for Website Hosting in the Amazon Simple Storage Service Developer Guide.

    Important

    The bucket must have the same name as your domain or subdomain. For example, if you want to use the subdomain acme.example.com, the name of the bucket must be acme.example.com.

    You can route traffic for a domain and its subdomains, such as example.com and www.example.com, to a single bucket. Create a bucket for the domain and each subdomain, and configure all but one of the buckets to redirect traffic to the remaining bucket. For more information, see Getting Started with Amazon Route 53.

  • A registered domain name. You can use Amazon Route 53 as your domain registrar, or you can use a different registrar.

  • Amazon Route 53 as the DNS service for the domain. If you register your domain name by using Amazon Route 53, we automatically configure Amazon Route 53 as the DNS service for the domain.

    For information about migrating DNS service to Amazon Route 53, see Using Amazon Route 53 as the DNS Service for Subdomains Without Migrating the Parent Domain.

Configuring Amazon Route 53 to Route Traffic to an S3 Bucket

To configure Amazon Route 53 to route traffic to an S3 bucket that is configured to host a static website, perform the following procedure.

To route traffic to an S3 bucket

  1. Sign in to the AWS Management Console and open the Amazon Route 53 console at https://console.aws.amazon.com/route53/.

  2. In the navigation pane, choose Hosted Zones.

  3. Choose the name of the hosted zone that has the domain name that you want to use to route traffic to your S3 bucket.

  4. Choose Create Record Set.

  5. Specify the following values:

    Name

    Type the domain name that you want to use to route traffic to your S3 bucket. The default value is the name of the hosted zone.

    For example, if the name of the hosted zone is example.com and you want to use acme.example.com to route traffic to your bucket, type acme.

    Type

    Choose A – IPv4 address.

    Alias

    Choose Yes.

    Alias Target

    In the S3 website endpoints section of the list, choose the bucket that has the same name that you specified for Name.

    Routing Policy

    Accept the default value of Simple.

    Evaluate Target Health

    Accept the default value of No.

  6. Choose Create.

    Changes generally propagate to all Amazon Route 53 servers within 60 seconds. When propagation is done, you'll be able to route traffic to your S3 bucket by using the name of the alias resource record set that you created in this procedure.