Deploying a Static Website on AWS

Let’s start off with a hypothetical- you’ve got a simple static website for a small project, and you want to host it online. What’s the best way? You can score different methods on a variety of categories:

  • Cost
  • Scalability
  • Simplicity

For the majority of use cases, the best way to do this is going to be to use Amazon S3 to host your content. Why?

Simplicity

As I’ll show you, deploying a static website via S3 is as easy as can be.

Cost of Hosting

https://aws.amazon.com/getting-started/projects/host-static-website/
https://aws.amazon.com/free/

Scalability

Before jumping in- I want to clarify what I mean when I say a static website. A static website is a collection of HTML files and whatever resources you need to make it pretty or to add functionality. A basic static website directory looks something like this:

1
2
3
4
5
6
- css/
|- styles.css
- js/
|- scripts.js
- index.html
- error.html

Amazon S3 makes hosting something like this dead simple. Create an S3 Bucket using the default settings. Once created, go to the ‘Properties’ tab for the bucket, and click ‘Static Website Hosting’. Select the ‘Use this bucket to host a website’ radio button, and declare and index and error document, which should match up with your site structure.