Build A Static Website With Amazon S3 Activity
Build A Static Website With Amazon S3 Activity
VIRTUAL
PRIVATE
NETWOR
K
README
BEFORE GETTING
STARTED
Here's some important
information to know before
starting this hands-on
activity.
Requirements: You must
have an AWS Educate
account.
Your company, BitBeat, is ready to share information with Activity Time: 60 minutes
prospective customers. They will be launching their product,
BitBanger, in a few months. Right now, they want to setup a static
Getting Help: If you
experience any issues as you
website where customers can learn about their product.
complete this activity, please
ask your instructor for
Amazon Simple Storage Service (Amazon S3) can host static
assistance.
websites without a need for a web server. The website is highly
performant and scalable at a fraction of the cost of a traditional web
server.
Academic Gateway to the Hearts and Minds of the Next Generation of IT Professionals
© Amazon Web Services 2019
1
Build a Static Website with Simple Storage Service (S3)
VIRTUAL
PRIVATE
NETWOR
K
Task Overview
In this hands-on activity, you are going to configure an S3 bucket to host
a static website for BitBeat. You will need to enable the S3 bucket for
website hosting, and you will need to set permissions to allow the general
public to view the website.
Learning Outcomes
After completing this activity, you should be able host a static website for an organization using S3
by:
1. Creating an S3 bucket with most restrictive permissions
2. Enabling static website hosting for an S3 bucket
3. Defining the index document for the static website
4. Set permissions require public permissions for website access
5. Uploading object for a static website to S3
6. Add a bucket policy to make objects in the S3 bucket readable
Academic Gateway to the Hearts and Minds of the Next Generation of IT Professionals
© Amazon Web Services 2019
2
Build a Static Website with Simple Storage Service (S3)
VIRTUAL
PRIVATE
NETWOR
K
A bucket is owned by the AWS account that created it. By default, you can
create up to 100 buckets in each of your AWS accounts. After you create a
bucket, you can't change its Region. Buckets are not transferable.
Before you can upload data to Amazon S3, you must create a bucket in one of the AWS Regions to
store your data in. After you create a bucket, you can upload an unlimited number of data objects to the
bucket.
Create S3 Bucket
1. In the AWS Management Console Find and select S3
2. In the S3 console, click .
3. Enter a name for your bucket.
Note: Your bucket name must be unique across all existing bucket
names in Amazon S3. You cannot change a buckets name after the
buckets has been created. (read more Bucket Restrictions and
Limitations:
https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html)
4. Review default General Configuration and Advanced settings. Click the external link icon
to access and read AWS documentation. Then, scroll down the page and click
Will someone be able to access your bucket from the internet? Why or why not?
________________________________________________________________________
Academic Gateway to the Hearts and Minds of the Next Generation of IT Professionals
© Amazon Web Services 2019
3
Build a Static Website with Simple Storage Service (S3)
VIRTUAL
PRIVATE
NETWOR
K
Now that you have create the S3 bucket and configured it for website
hosting, you are ready to upload the BitBeat website files to the bucket. For this task you need to
download the static website files we have created for you. Go to http://tinyurl.com/s3static and
download and save these two files to your desktop: index.html and bitbangers.png.
Upload Objects
1. After you download the website files to your desktop go to the S3
dashboard, click on the bucket name to open the bucket management
page.
2. Click the Upload button at the top of the screen.
3. Drag and drop the website file you previously downloaded to your
desktop to the bucket upload screen and then click Next
4. Accept the defaults on the Manage User page and click Next
5. Select the Standard storage class and click Next
6. Review the upload data and then click Upload
Academic Gateway to the Hearts and Minds of the Next Generation of IT Professionals
© Amazon Web Services 2019
4
Build a Static Website with Simple Storage Service (S3)
VIRTUAL
PRIVATE
NETWOR
K
{
"Version":"2012-10-17",
Academic Gateway to the Hearts and Minds of the Next Generation of IT Professionals
© Amazon Web Services 2019
5
Build a Static Website with Simple Storage Service (S3)
VIRTUAL
PRIVATE
NETWOR
K
"Statement":[{
"Sid":"PublicReadGetObject",
"Effect":"Allow",
"Principal": "*",
"Action":["s3:GetObject"],
"Resource":["arn:aws:s3:::example-bucket/*"
]
}
]
}
Enter the following URL in the browser, replacing example-bucket with the name of your bucket
and website-region with the name of the AWS Region where you deployed your bucket:
http://example-bucket.s3-website-region.amazonaws.com
____________________________________________________________________
Academic Gateway to the Hearts and Minds of the Next Generation of IT Professionals
© Amazon Web Services 2019
6
Build a Static Website with Simple Storage Service (S3)
VIRTUAL
PRIVATE
NETWOR
K
GREAT JOB!
Let’s Review
You were able to setup a static website hosted on Amazon S3. This website is available at the Amazon
S3 website endpoint. Here are the tasks you successfully completed:
1. Create an S3 bucket
2. Enable S3 bucket static web hosting
3. Upload website files to the S3 bucket
4. Set public access permissions
5. Add a bucket policy
6. Test and troubleshoot public access to the S3 bucket
Resources
1. How to create an S3 bucket - https://docs.aws.amazon.com/AmazonS3/latest/user-
guide/create-bucket.html
2. Permissions required for website access -
https://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteAccessPermissionsReqd.html
3. Working with an S3 bucket -
https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html#bucket-config-options-
intro
4. Bucket Restrictions and Limitations -
https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html
Academic Gateway to the Hearts and Minds of the Next Generation of IT Professionals
© Amazon Web Services 2019
7