AWS Static Website
AWS Static Website
AWS Static Website
Table of Contents
Hosting a Static Website ................................................................................................................ 1
Static Website Hosting Architectures ........................................................................................ 1
Tutorial ................................................................................................................................ 4
Pricing ................................................................................................................................. 5
Setting Up ................................................................................................................................... 6
Sign Up for AWS .................................................................................................................. 6
Create an IAM User .............................................................................................................. 6
Step 1: Create the Buckets for Your Website .................................................................................... 9
Bucket Requirements ............................................................................................................ 9
Buckets and Website URLs .................................................................................................. 10
Creating the Buckets ........................................................................................................... 10
Step 2: Configure Your Buckets .................................................................................................... 13
Add Permissions ................................................................................................................. 13
Enable Logging ................................................................................................................... 15
Step 3: Deploy Your Website ........................................................................................................ 17
Create an Index Document and a Custom Error Document ........................................................ 17
Upload Files to Your Bucket ................................................................................................. 18
Configure Your Bucket as a Website ...................................................................................... 19
Set Up a Redirect ............................................................................................................... 21
Test Your Website .............................................................................................................. 21
Step 4 (Optional): Register Your Domain Name ............................................................................... 24
Step 5 (Optional): Associate a Domain Name with Your Website ........................................................ 25
Create a Hosted Zone for Your Domain .................................................................................. 25
Create Record Sets for Your Domain and Subdomain ............................................................... 26
(Optional) Set Up a DNS Provider ......................................................................................... 26
Step 6 (Optional): Speed Up Your Website ..................................................................................... 29
Create a CloudFront Distribution ............................................................................................ 29
Update the Record Sets for Your Domain and Subdomain ......................................................... 31
(Optional) Check the Log Files .............................................................................................. 32
Step 7: Clean Up ........................................................................................................................ 34
Delete the Amazon Route 53 Hosted Zone ............................................................................. 34
Delete the CloudFront Distribution ......................................................................................... 35
Delete the Amazon S3 Bucket .............................................................................................. 35
Related Resources ...................................................................................................................... 36
iii
Getting Started with AWS Hosting a Static Website
Static Website Hosting Architectures
You can easily and inexpensively use Amazon Web Services (AWS) to host a website that uses client-
side technologies (such as HTML, CSS, and JavaScript) and does not require server-side technologies
(such as PHP and ASP.NET). This type of site is called a static website, and is used to display content
that does not change frequently.
If you want to deploy a website that requires server-side technologies instead, see Getting Started with
AWS: Hosting a Web App for Linux or Getting Started with AWS: Hosting a .NET Web App.
After you complete this tutorial, you'll know how to do the following:
Deploy a static website Host your static website using the Amazon Simple Storage Service
(Amazon S3) so that it is secure, fast, protected against data loss, and can scale to support
enterprise-level traffic. You'll store your website files in Amazon S3 and use Amazon S3 to deliver
your content to visitors to your website.
Associate your domain name with your website You can use Amazon Route 53 to tell the
Domain Name System (DNS) where to find the resources for your domain, such as your website
content in Amazon S3. Alternatively, you can use your domain registrar to route queries to your
website.
Speed up your website Use Amazon CloudFront to create a content delivery network (CDN) that
makes your website content available from data centers around the world, called edge locations.
Using edge locations improves the speed of your website. Doing so is especially important if your
website displays large media files such as high-resolution images, audio, or video.
Requirement Solution
Low-cost, reliable, online Amazon S3 is a low-cost, highly reliable web service for hosting
storage to host your static static websites.
website
1
Getting Started with AWS Hosting a Static Website
Static Website Hosting Architectures
Requirement Solution
1. Create a locationan Amazon S3 bucketwhere you will store the files for your website, for
example HTML, CSS, JavaScript, and image files.
2. Upload the files to this bucket.
3. Configure the bucket to act as a website.
After you complete these first steps, visitors can access your website with a URL in the
form http://example.com.s3-website-us-east-1.amazonaws.com or http://
www.example.com.s3-website-us-east-1.amazonaws.com.
2
Getting Started with AWS Hosting a Static Website
Static Website Hosting Architectures
Next, you can add a custom domain to your static website by registering a domain name and
configuring AWS as your DNS service provider. Visitors can now access your website with a URL in
the form http://example.com or http://www.example.com.
3
Getting Started with AWS Hosting a Static Website
Tutorial
Finally, you can improve performance of your website by distributing it through a CDN. Visitors can still
access your website with a URL in the form http://example.com or http://www.example.com,
but now they download the files from the edge location closest to them.
Tutorial
The following tutorial walks you through the process of hosting a static website on AWS. We'll use
the AWS Management Console to access AWS. Before you start this tutorial, be sure to follow the
procedures in Setting Up to Host a Static Website on AWS (p. 6).
4
Getting Started with AWS Hosting a Static Website
Pricing
Steps 1 through 3 show you how to create buckets for, configure, and deploy your website. If you want
to just create a static website in Amazon S3 and send a link to a customer for review, you perform only
steps 1, 2, 3, and 7. However, if you want to associate a domain name with your website, you also do
steps 4, 5, and 6.
Pricing
You can use the AWS Simple Monthly Calculator to estimate what it would cost to host your static
website on AWS using Amazon S3, Amazon Route 53, and CloudFront.
Note that if you created your AWS account within the last 12 months, you are eligible for the AWS Free
Tier.
5
Getting Started with AWS Hosting a Static Website
Sign Up for AWS
Before you start this tutorial, complete the following steps if you haven't already.
To set up
Sign Up for AWS (p. 6)
Create an IAM User (p. 6)
If you created your AWS account less than 12 months ago, you can get started with AWS for free. For
more information, see AWS Free Tier.
If you have an AWS account already, skip to the next step. If you don't have an AWS account, use the
following procedure to create one.
Part of the sign-up procedure involves receiving a phone call and entering a PIN using the phone
keypad.
6
Getting Started with AWS Hosting a Static Website
Create an IAM User
we recommend that you use AWS Identity and Access Management (IAM) instead in order to better
protect your AWS resources from unauthorized access.
Create an IAM user, and then add the user to an IAM group with administrative permissions or and
grant this user administrative permissions. You can then access AWS using a special URL and the
credentials for the IAM user.
If you signed up for AWS but have not created an IAM user for yourself, you can create one using the
IAM console.
To create an IAM user for yourself and add the user to an Administrators group
You can use this same process to create more groups and users, and to give your users access to
your AWS account resources. To learn about using policies to restrict users' permissions to specific
AWS resources, go to Access Management and Example Policies for Administering AWS Resources.
To sign in as this new IAM user, sign out of the AWS console, then use the following URL, where
your_aws_account_id is your AWS account number without the hyphens (for example, if your AWS
account number is 1234-5678-9012, your AWS account ID is 123456789012):
https://your_aws_account_id.signin.aws.amazon.com/console/
Enter the IAM user name and password that you just created. When you're signed in, the navigation
bar displays "your_user_name @ your_aws_account_id".
If you don't want the URL for your sign-in page to contain your AWS account ID, you can create an
account alias. From the IAM dashboard, click Customize and enter an alias, such as your company
name. To sign in after you create an account alias, use the following URL:
https://your_account_alias.signin.aws.amazon.com/console/
7
Getting Started with AWS Hosting a Static Website
Create an IAM User
To verify the sign-in link for IAM users for your account, open the IAM console and check under IAM
users sign-in link on the dashboard.
8
Getting Started with AWS Hosting a Static Website
Bucket Requirements
If you plan to associate a domain name with your website, you can perform the following additional
tasks, which are optional for this tutorial:
Contents
Bucket Requirements (p. 9)
Buckets and Website URLs (p. 10)
Creating the Buckets (p. 10)
Bucket Requirements
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 example.com 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 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.
9
Getting Started with AWS Hosting a Static Website
Buckets and Website URLs
http://example.com.s3-website-us-east-1.amazonaws.com/
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.
a. 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).
Important
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.
10
Getting Started with AWS Hosting a Static Website
Creating the Buckets
b. 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.
c. Choose Create.
4. After Amazon S3 creates your bucket, the console displays it in the Buckets pane, similar to the
following.
5. Repeat step 3 to create two additional subdomain buckets, logs.example.com (for the log files)
and www.example.com (for the www subdomain). When you are finished, the console displays all
three buckets, which should look similar to the following.
11
Getting Started with AWS Hosting a Static Website
Creating the Buckets
12
Getting Started with AWS Hosting a Static Website
Add Permissions
When you configure your root domain bucket in Amazon S3 as a website, Amazon S3 delivers the
files in that bucket to web browsers as if they were hosted on a web server. To make sure everyone
can view the files for your website, you must add permissions to your root domain bucket. We also
recommend that you enable logging to record information about traffic to your website.
To configure the buckets for your website, use Amazon S3 to complete the following tasks.
Tasks
Add Permissions (p. 13)
Enable Logging (p. 15)
Add Permissions
When you first create an Amazon S3 bucket, only you can access the bucket and its contents. This
default behavior ensures that you don't accidentally expose your data to other users. The point of a
website, however, is to be visited, so you will apply a policy to the root domain bucket so that anyone
can view its contents in web browser. For more information, go to Using Bucket Policies and User
Policies in the Amazon Simple Storage Service Developer Guide.
13
Getting Started with AWS Hosting a Static Website
Add Permissions
3. Copy the following policy and paste it into the Bucket Policy Editor. In the Amazon Resource
Name (ARN) for the resource in the "Resource" entry, replace example.com with the name of
your bucket, and then choose Save. This policy gives everyone permission to view any file in the
example.com bucket.
{
"Version":"2012-10-17",
"Statement": [{
"Sid": "Allow Public Access to All Objects",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::example.com/*"
}
]
}
For more information on bucket policies, go to Using Bucket Polices and User Policies in the
Amazon Simple Storage Service Developer Guide.
4. For Permissions, choose Save.
14
Getting Started with AWS Hosting a Static Website
Enable Logging
Enable Logging
To track the number of visitors accessing your website, you must enable logging for the root domain
bucket. Enabling logging is optional. If you don't want to track traffic to your website, you can skip the
following procedure.
With logging enabled, you can track information such as data in and out of your bucket and the IP
addresses of whoever is accessing your bucket. There is no extra charge for enabling logging on a
bucket; however, you will accrue charges to store the resulting log files in the bucket that you specify.
(You can delete the log files from this bucket at any time.) Amazon S3 does not assess data transfer
charges for log file delivery, but does charge the normal data transfer rate for accessing the log files.
For more information, see Server Access Logging in the Amazon Simple Storage Service Developer
Guide.
15
Getting Started with AWS Hosting a Static Website
Enable Logging
16
Getting Started with AWS Hosting a Static Website
Create an Index Document and a Custom Error Document
Now that you've created and configured your Amazon S3 buckets, you are ready to deploy your
website. If you don't already have files for a website, you can just use the simple HTML files we create
in this step.
To deploy your static website, use Amazon S3 to complete the following tasks.
Tasks
Create an Index Document and a Custom Error Document (p. 17)
Upload Files to Your Bucket (p. 18)
Configure Your Bucket as a Website (p. 19)
Set Up a Redirect (p. 21)
Test Your Website (p. 21)
<!DOCTYPE html>
<html>
<body>
<p>Hello, World!</p>
</body>
</html>
<!DOCTYPE html>
<html>
<body>
<p>This is an error page.</p>
17
Getting Started with AWS Hosting a Static Website
Upload Files to Your Bucket
</body>
</html>
For more information on index documents and custom error documents, go to Index Document Support
and Custom Error Document Support in the Amazon Simple Storage Service Developer Guide.
18
Getting Started with AWS Hosting a Static Website
Configure Your Bucket as a Website
If your website files have a folder hierarchy on your local computer, such as storing image files in
an images subfolder, you need to recreate that hierarchy in your buckets. To do so, simply create
folders inside the root domain bucket that match your folder hierarchy. For example, consider the
case where you have a file /images/check.gif referenced in index.html as follows.
<!DOCTYPE html>
<html>
<body>
<p>Hello, World!</p>
<img src="/images/check.gif">
</body>
</html>
To create this folder, open your root domain bucket, choose Create Folder, create the images
folder, and then upload check.gif to the new images folder.
19
Getting Started with AWS Hosting a Static Website
Configure Your Bucket as a Website
20
Getting Started with AWS Hosting a Static Website
Set Up a Redirect
Set Up a Redirect
Before you can associate your domain name with your website, you must redirect traffic from the www
subdomain bucket to the root domain bucket. Then, Amazon S3 forwards any requests that are sent
to the www subdomain bucket to the root domain bucket instead. By redirecting traffic in this way, you
can maintain a single version of your website files in Amazon S3 while still supporting both the root and
www subdomain versions of your website's address.
To redirect traffic from your www subdomain bucket to your root domain bucket
1. Choose your root domain bucket, choose Properties, and then choose Static Website Hosting.
The default URL assigned by AWS is the Endpoint. In the following image, this default URL is
example.com.s3-website-us-east-1.amazonaws.com.
21
Getting Started with AWS Hosting a Static Website
Test Your Website
2. Choose the endpoint. If your website is correctly deployed, you'll see its home page.
22
Getting Started with AWS Hosting a Static Website
Test Your Website
3. (Optional) To verify that the subdomain bucket is properly redirecting visitors, try to access
http://www.example.com.s3-website-us-east-1.amazonaws.com. If your website
is correctly deployed, you are redirected to http://example.com.s3-website-us-
east-1.amazonaws.com.
4. (Optional) To verify that the error page is working, try to access a page on your new website that
doesn't exist, such as http://example.com.s3-website-us-east-1.amazonaws.com/
bogus.html. If your website is correctly deployed, you are redirected to your custom error page.
Anyone who has the endpoint URLs for your Amazon S3 buckets can view the contents of your static
website in a web browser. If you don't have a registered domain name or you dont plan to associate
your website with a domain, we recommend cleaning up the resources so you no longer accrue
charges. For more information on how to do so, see Clean Up (p. 34).
Otherwise. perform the following additional tasks to associate your website with your domain name,
and then clean up resources:
23
Getting Started with AWS Hosting a Static Website
If you plan to associate a domain name with your website and you haven't already registered that
domain name, now is a good time to do so.
The Internet Corporation for Assigned Names and Numbers (ICANN) manages domain names on
the Internet. You register a domain name using a domain name registrar, an ICANN-accredited
organization that manages the registry of domain names. The website for your registrar will provide
detailed instructions and pricing information for registering your domain name.
Before you pay to register a domain name, check that the domain name that you used when
you created your buckets in Amazon S3 (as described in Step 1: Create the Buckets for Your
Website (p. 9)) is available with a domain name registrar. If the domain name is not available, you
should delete the buckets in Amazon S3, find a domain name that is available, and create new buckets
in Amazon S3 with the same name as your domain. We recommend this approach because Amazon
S3 requires buckets with the same name as your domain for a static website, and you can't change the
name of a bucket after you create it.
You can get further help with registering a domain name from the following:
To use Amazon Route 53 to register a domain name, go to Registering Domain Names Using
Amazon Route 53 in the Amazon Route 53 Developer Guide.
For a list of accredited registrars, go to the Accredited Registrar Directory.
24
Getting Started with AWS Hosting a Static Website
Create a Hosted Zone for Your Domain
The easiest way for your customers to access your website is through a memorable domain name. In
the procedures on this page, replace example.com with your domain name. If you haven't done so
already, register your domain name (p. 24).
A Domain Name System (DNS) web service routes visitors to websites by translating domain names
(such as www.example.com) into the numeric IP addresses (such as 192.0.2.1) that computers use
to connect to each other.
You can use your DNS service, such as your domain registrar, to create a CNAME record to route
queries to your static website. For more information, see the documentation for your DNS service.
Alternatively, you can use Amazon Route 53 as your DNS service. It is designed to be highly available,
scalable, and cost effective. To associate a domain name with your website using Amazon Route 53,
complete the following tasks.
Tasks
Create a Hosted Zone for Your Domain (p. 25)
Create Record Sets for Your Domain and Subdomain (p. 26)
(Optional) Set Up a DNS Provider (p. 26)
25
Getting Started with AWS Hosting a Static Website
Create Record Sets for Your Domain and Subdomain
1. On the Hosted Zones page, choose the hosted zone that you created for your domain.
2. Choose Go to Record Sets.
3. Choose Create Record Set.
4. For Create Record Set, do the following:
Next, you create an alias resource record set, which routes queries for your www subdomain name to
the Amazon S3 domain name for your bucket.
To configure the alias resource record set for your www subdomain
1. On the Hosted Zones page, select the hosted zone that you created for your domain.
2. Choose Go to Record Sets.
3. Choose Create Record Set.
4. For Create Record Set, do the following:
a. For Name, type www. The root domain is already specified for you, and the connecting period
(.) appears when you start typing.
b. For Type, choose A IPv4 address.
c. For Alias, choose Yes.
d. Choose Alias Target. Select your www subdomain website endpoint from the list (for example,
www.example.com). Do not select the root domain endpoint (for example, example.com).
e. For Routing Policy, choose Simple.
f. Leave Evaluate Target Health set to No.
g. Choose Create.
26
Getting Started with AWS Hosting a Static Website
(Optional) Set Up a DNS Provider
Alternatively, if you're reusing a domain name that was previously associated with another website, you
might need to transfer other DNS records from your current DNS provider to Amazon Route 53 in order
to ensure the continued availability of the services hosted under the domain name. To determine which
DNS records you must replicate in Amazon Route 53, check the DNS record settings configured for the
domain in your current DNS provider. Two records that you should not transfer to Amazon Route 53
are the Start of Authority (SOA) and Name Server (NS) records. These records were set by Amazon
Route 53 when the name servers were allocated, and they should not be changed.
First, log into the domain name registrar that you used to register your domain name. Use the web
interface provided by the registrar to set the name servers for your domain to the name server values
displayed under Name Servers in the details for the hosted zone. How you do this depends on the
registrar that you used.
Then, wait 2 to 48 hours for the Internet DNS resolver network to propagate name server changes. To
see if the name server change has gone through, use a command line utility such as dig (for Mac OS
X, Unix, or Linux) or nslookup (for Windows). The following example shows how use dig to see which
name servers are associated with your domain.
dig example.com
When the output shows AUTHORITY SECTION values that are the AWS name servers that you
allocated using Amazon Route 53, as in the following example, the DNS changes have propagated
through the DNS resolver network.
;; AUTHORITY SECTION:
example.com. 118928 IN NS ns-806.awsdns-36.net.
example.com. 118928 IN NS ns-1456.awsdns-54.org.
example.com. 118928 IN NS ns-1713.awsdns-22.co.uk.
example.com. 118928 IN NS ns-105.awsdns-13.com.
After your DNS changes have propagated, you can view your website using your custom domain
name.
27
Getting Started with AWS Hosting a Static Website
(Optional) Set Up a DNS Provider
If you open your www subdomain (such as www.example.com) in your web browser, the browser is
redirected to your domain (such as example.com).
28
Getting Started with AWS Hosting a Static Website
Create a CloudFront Distribution
You can use Amazon CloudFront to improve the performance of your website. CloudFront makes
your website's files (such as HTML, images, and video) available from data centers around the world
(called edge locations). When a visitor requests a file from your website, the request is automatically
redirected to a copy of the file at the nearest edge location, which results in faster download times than
if the visitor had requested the content from a data center farther away. CloudFront caches content
at edge locations for a period of time that you specify. When a visitor requests content that has been
cached for longer than the expiration date, CloudFront checks the origin server to see if a newer
version of the content is available. If a newer version is available, CloudFront copies the new version to
the edge location. In this manner, changes that you make to the original content are replicated to edge
locations as visitors request the content.
Tasks
Create a CloudFront Distribution (p. 29)
Update the Record Sets for Your Domain and Subdomain (p. 31)
(Optional) Check the Log Files (p. 32)
29
Getting Started with AWS Hosting a Static Website
Create a CloudFront Distribution
3. On the Select a delivery method for your content page, for Web, choose Get Started.
4. On the Create Distribution page, for Origin Settings, type the Amazon S3 static website hosting
endpoint for your bucket in the Origin Domain Name box, for example: example.com.s3-
website-us-east-1.amazonaws.com.
Important
Do not select the name of your bucket from the list, such as
example.com.s3.amazonaws.com.
a. Leave Price Class set to Use All Edge Locations (Best Performance).
b. Set Alternate Domain Names (CNAMEs) to the root domain and www subdomain; in this
tutorial, these are example.com and www.example.com. These values must be set in order
to create aliases for the A records that connect the specified domain names to the CloudFront
distribution.
c. Set Default Root Object to index.html. This page is the default page that the CloudFront
distribution returns if the URL used to access the distribution doesn't contain a file name.
This value should match the index document value that you set in Step 3: Deploy Your
Website (p. 17).
d. Set Logging to On.
e. For Bucket for Logs, choose the logging bucket that you created.
f. To store the logs generated by traffic to the CloudFront distribution in a folder named cdn in
the log bucket, type cdn/ forLog Prefix.
g. Leave the other settings at their default values.
7. Choose Create Distribution.
To view the current status of the distribution, find it in the console and check the Status column. A
status of InProgress indicates that the distribution is not yet fully deployed.
After your distribution is deployed, you can reference your content with your new CloudFront domain
name. Make a note of the value of Domain Name in the CloudFront console. You'll need this value in
the next step. In this example, the value is dj4p1rv6mvubz.cloudfront.net.
To verify that your CloudFront distribution is working, type the domain name of the distribution in a web
browser. If it is working, you will see your website display.
30
Getting Started with AWS Hosting a Static Website
Update the Record Sets for Your Domain and Subdomain
The update to the record sets takes effect within 2 to 48 hours. To see if the new A records have taken
effect, open a web browser and go to http://www.example.com. If the browser no longer redirects
you to http://example.com, the new A records are in place.
This change in behavior occurs because traffic routed by the old A record to the www subdomain S3
bucket is redirected by the settings in Amazon S3 to the root domain. When the new A record has
taken effect, traffic routed by the new A record to the CloudFront distribution is not redirected to the
root domain.
Tip
Browsers can cache redirect settings. If you think the new A record settings should have taken
effect but your browser still redirects http://www.example.com to http://example.com,
31
Getting Started with AWS Hosting a Static Website
(Optional) Check the Log Files
try clearing your browser history and cache, closing and reopening your browser application,
or using a different web browser.
When the new A records are in effect, any visitors who reference the site by using http://
example.com or http://www.example.com are redirected to the nearest CloudFront edge location,
where they benefit from faster download times.
If you created your site as a learning exercise only, you can delete the resources that you
allocated so that you no longer accrue charges. To do so, continue on to Step 7: Clean Up Your
Resources (p. 34). After you delete your AWS resources, your website is no longer available.
When you check the log files in your bucket, you should see older Amazon S3 log files in the folder
root. All new log files should be CloudFront logs written in the folder cdn. Amazon S3 website access
logs are written to your log bucket every two hours. CloudFront logs are written to your log bucket
within 24 hours of the corresponding requests, so you might have to wait for them to show up.
4. Open your log file or files. Log files are either text files written by Amazon S3, which you can open
in the browser, or gzip files written by CloudFront, which you can download and then open.
32
Getting Started with AWS Hosting a Static Website
(Optional) Check the Log Files
33
Getting Started with AWS Hosting a Static Website
Delete the Amazon Route 53 Hosted Zone
If you created your static website as a learning exercise only, be sure to delete the AWS resources
that you allocated so that you no longer accrue charges. After you delete your AWS resources, your
website is no longer available.
Tasks
Delete the Amazon Route 53 Hosted Zone (p. 34)
Delete the CloudFront Distribution (p. 35)
Delete the Amazon S3 Bucket (p. 35)
34
Getting Started with AWS Hosting a Static Website
Delete the CloudFront Distribution
1. Continuing from the previous procedure, open the context (right-click) menu for a disabled
distribution, and then choose Delete.
2. When prompted for confirmation, choose Yes, Delete.
To delete a bucket
35
Getting Started with AWS Hosting a Static Website
Related Resources
The following table lists some of the AWS resources that you'll find useful as you work with AWS.
Resource Description
AWS Products & Services Information about the products and services that AWS
offers.
AWS Support Center The hub for creating and managing your AWS Support
cases. Also includes links to other helpful resources, such
as forums, technical FAQs, service health status, and AWS
Trusted Advisor.
AWS Support The home page for AWS Support, a one-on-one, fast-
response support channel to help you build and run
applications in the cloud.
AWS Architecture Center Provides the necessary guidance and best practices to
build highly scalable and reliable applications in the AWS
cloud. These resources help you understand the AWS
platform, its services and features. They also provide
architectural guidance for design and implementation of
systems that run on the AWS infrastructure.
AWS Security Center Provides information about security features and resources.
36
Getting Started with AWS Hosting a Static Website
Resource Description
AWS Technical Whitepapers Provides technical whitepapers that cover topics such as
architecture, security, and economics. These whitepapers
have been written by the Amazon team, customers, and
solution providers.
AWS Blogs Provides blog posts that cover new services and updates to
existing services.
37