When I began my blog this year I decided to host it on AWS. Since I'm using Hugo to generate the site, the infrastructure backing it has very few needs. A place to store and serve up the generated files and a place to create a DNS record for visitors to use would be sufficient to start.
AWS S3 has a static website hosting feature and AWS Route53 is a nice cheap place to register a domain and manage DNS records. The infrastructure for hosting a static site on AWS could be as simple as this:
Part of my day job is automating the creation and management of cloud infrastructure on AWS, so I thought I would start out blogging how to automate simple pieces behind this blog using a few different techniques to see how they compare. I plan to start with CloudFormation, follow up with Terraform, and then perhaps tackle the Cloud Development Kit.
Part of managing infrastucture is evolving it over time, so I'll show how to augment the initial setup with AWS CloudFront, primarily to add HTTPS support and show rewriting requests using CloudFront Functions. After adding those pieces the final infrastructure will look like this:
Let's go build!
Updated February 1, 2022