very∙united
/ˈvɛɹi juːˈnaɪtɪd/ about this page
this wimpy page could've just been a handful of html pages, uploaded to some cheap hoster like easyname and i would've been done with it. but that wouldn't have been any fun, right? so i lunged at some good old over-engineering. the three html files you can marvel at here are backed by the following infrastructure:
- a cdk app consisting of two stacks: one for all the dns, and one for everything else. of course there's a construct library that encapsulates the concept of a »static website«, among other things.
- a s3 bucket that holds all the files.
- a cloudfront distribution with the s3 bucket as origin.
- little things like: deploymeny role, dns records, etc.
on the development side of things, i wanted to under-engineer everything: no node, no webpack, no static-site-generator with thousands of lines of code, no minification. nothing of the modern frontend stack, just me editing a html file in a text editor like i did 20 years ago. the only thing i did want is hashed asset file names, so i can have long cache times and don't need to invalidate all the assets on a deploy. so the website part consists of:
- around 30 lines of python to spin up a webserver that serves local files
- 150 lines of python to build the thing. it basically adds a hash to every assets file and replaces the urls in all html documents referencing them.
- github actions to lint + deploy
all of this neatly fits into the AWS free tier, the only thing that actually costs money is route53 + the hosted zone. sadly, the only way to have cloudfront point to the apex domain is an alias record, for which you need to use route53. all of this comes down to around 1$ a month, which is okay.