Host a Static Website on AWS

Introduction

In my previous article, we talk about hosting a static website on GCP, this time we will use AWS. In fact, the steps are almost the same with different user interface.

AWS S3

Amazon Simple Storage Service (Amazon S3) is an object storage service that offers industry-leading scalability, data availability, security, and performance. This means customers of all sizes and industries can use it to store and protect any amount of data for a range of use cases, such as data lakes, websites, mobile applications, backup and restore, archive, enterprise applications, IoT devices, and big data analytics. Amazon S3 provides easy-to-use management features so you can organize your data and configure finely-tuned access controls to meet your specific business, organizational, and compliance requirements. Amazon S3 is designed for 99.999999999% (11 9’s) of durability, and stores data for millions of applications for companies all around the world.

Solution Diagram

Similar to GCP, it is very easy to host a static website. What we have to do is just put all the required files on AWS S3 and allow access to others.

Create a Bucket

Search S3 on search bar.

Click Create bucket on right hand side.

Enter the necessary information e.g. unique bucket name, uncheck the block public option, then create bucket.

Click the bucket we just created.

Directly drag the file into the white space.

If you do not have existing web site, please paste the following code and name it as .html extention.

<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>

<h1>This is a Heading</h1>
<p>This is a paragraph.</p>

</body>
</html>

Check this button.

Move down and select upload.

Click the uploaded file.

We firstly select “make public”, then click the object URL.

Cool, we have done!

If we want to use our own domain, we can use AWS Route 53 service or any other DNS services to point to the bucket.

Cleanup

To cleanup, we choose the bucket and select empty.

Then we back to the S3 main page and click delete.

All the things gone!

Leave a Reply