Static Site with AWS S3


<- back | tags: /dev/journal webdev AWS

This site was deployed into AWS. Partly out of convenience because I work in AWS at my day job. Also, I wanted a little extra experience because I'm studying for the associate level Solutions Architect certification (my work wants me to have it).

In any case, doing things is a good way for me to learn new things, I've realized about myself. So I have deployed this static site into AWS.

I followed this guide if you're interested in trying it out yourself: Hosting a static website on Amazon S3

Serving a static site

Infrastructure includes:

  • S3
  • Route53
  • Cloudfront

S3

Simple storage service (S3) is AWS's object storage service. There's a lot of selling points about the service (e.g. "11 9's of durability") that make it seem like an over-powered medium for being the holder of a static webpage like this.

Route53

Route53 is AWS's DNS service. I don't have much to say about it. At face value it's just a DNS and it does that job just as well as any other one so far as I can tell. Other than that, it's worth mentioning that it was straight-forward adding new keys into the service when related to other infrastructure deployed inside of AWS.

As an example, creating an A record that alias' your domain to an existing CloudFront distribution is as simple as selecting the distribution from a drop-down menu.

CloudFront

CloudFront is a contend delivery network (CDN). Works with Shield standard (AWS's free DDoS mitigation service) and S3 with little to no configuration.

How it's put together

Static website deployed into AWS

I have some automation that publishes changes to an S3 bucket via awscli. The bucket is configured to serve the files as a static site. Additionally, there is a second bucket that is used as a landing point for requests to www.prograham.dev. It doesn't make much sense to serve the static content to both locations so I've setup a redirect to the shorter URL.

CloudFront sits in front of the bucket and distributes the site to edge locations and enables the use of https (S3 buckets by themselves only allow for http). Honestly, CloudFront might be a bit much for a modest site that expects little to no real traffic. It was easy enough to configure following documentation though and serving via https is desirable over not. The SSL certificate is managed in AWS by the Certificate Manager.

Overall, it took a couple hours of my time - most of which was spent just groking the docs. Now, you get this wonderful little site that provides little value to you but tickles me quite a bit. You're welcome.