Step 1: Create the Buckets for Your Website
In this tutorial, you do the following:
Create the buckets for your website
Configure your buckets
Deploy your website
If you plan to associate a domain name with your website, you can perform the following additional tasks, which are optional for this tutorial:
Register your domain name
Associate a domain name with your website
Speed up your website
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.
In addition to creating the
root 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
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
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 as follows:
For more information, see Amazon Simple Storage Service Website Endpoints.
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
To create the buckets for your website
Open the Amazon S3 console at https://console.aws.amazon.com/s3/.
Choose Create Bucket to open the Create Bucket dialog box.
In the Create a Bucket dialog box, do the following:
For Bucket Name, type a name for the bucket. Later in this tutorial, you'll upload the files for your website into this bucket (that is, the bucket for the root domain).
You must use the same name that you intend to use for your domain. This name must also be unique across all existing bucket names in Amazon S3. In some AWS regions, there might be additional restrictions on bucket names. For more information, see Bucket Restrictions and Limitations in the Amazon Simple Storage Service Developer Guide.
For Region, choose a region. By default, Amazon S3 creates buckets in the US Standard region. To reduce latency, minimize costs, or address regulatory requirements, you can choose a region that is closer to the users for your website. Objects that you store in a region never leave that region unless you explicitly transfer them to another region.
After Amazon S3 creates your bucket, the console displays it in the Buckets pane, similar to the following.
Repeat step 3 to create two additional subdomain buckets,
logs.(for the log files) and
wwwsubdomain). When you are finished, the console displays all three buckets, which should look similar to the following.