Amazon S3 requires that you give your bucket the same name as your domain.This requirement is so
that Amazon S3 can properly resolve the host headers sent by web browsers when a user requests
content from your website.Therefore, we recommend that you create your buckets for your website in
Amazon S3 before you pay to register your domain name. (If the domain name that you want to use is
not available to register, you'll have to delete your bucket and create a new one, because you can't change
the name of your bucket after you create it.) In this tutorial, we use the root domain bucket.
In addition to creating the example.comroot domain bucket, you will create the logs.example.com
bucket and www.example.com subdomain bucket. Be sure to create these buckets in the same AWS
region where you created the example.com bucket. Amazon S3 stores log information about traffic to
your website in the logs.example.com bucket.You'll set up the www.example.com bucket so that you
can redirect traffic to the root domain bucket if a user specifies the www subdomain.
Buckets and Website URLs
When you host a website on Amazon S3, AWS assigns it a URL based on the name of the bucket that
you create to store the website files and the region where you created the bucket. For example, if you
create the bucket example.com in the US East (N.Virginia) region, the default URL for your website is
If this URL is acceptable for your purposes, such as creating a prototype website for a client to review,
you can simply use the default URL and skip the steps in this tutorial that are related to registering a
custom domain name and associating it with your website.
Creating the Buckets
To create the buckets for your website, use Amazon S3 to complete the following procedure. Note that
you must replace example.com with the name of your domain.
Getting Started with AWS Hosting a Static Website