Notes on Setting Up a Static Website With AWS (Route 53, S3, ACM)
Published on September 4, 2024 (↻ September 18, 2024), filed under Development (RSS feed for all categories).
After Cloudflare came AWS. This time not merely putting a service in front of a website, I wanted to test the whole process around setting up a full-blown static website on AWS.
Superquick notes again—happy if anything helps, also happy if I can learn something from you.
-
Flying start: For most purposes, Configuring a Static Website Using a Custom Domain Registered With Route 53 is a great guide. The tutorial walks through getting the domain, setting up S3 buckets, uploading files, and testing.
-
To set up SSL, however, the AWS tutorial falls short. How to Set Up an AWS S3 Static SSL Website helps, until it doesn’t anymore:
-
To properly set up SSL via CloudFront, you need a certificate in us-east-1, and if you hadn’t set the certificate(s) up in that region, you cannot copy or import the respective certificates—you need to request them again in us-east-1.
-
To make this all work, now, it’s necessary to go back to Route 53, to update the A records to point to the CloudFront distribution(s), as opposed to the S3 buckets. (Thank you, Avinash Dalvi and Stack Overflow.)
-
(If that’s your cup of tea, too, you can use Transmit to connect and upload to S3.)
-
Setting up redirects is awkward. Here, too, Amazon’s documentation gives a leg up with Configuring a Webpage Redirect, but it could offer better examples, including a quick one for external redirects. Angelo Mandato’s URL Redirection on AWS Using JSON Rules helped with that. (Why awkward? Redirects should be closer to the source to be usable, I think, and the syntax can and should be simpler.)
-
Setting custom HTTP headers seems possible but looks verbose. I’m also not sure about automated invalidation when uploading new content, but that, too, seems possible. I stopped here.
Is AWS Worth It?
Is it worth setting up a static website on AWS? Before sharing my view on this, here are the pros and cons I see in doing so:
Pros
-
Stellar global performance—from the tests I ran using WebPageTest, AWS is, on international average, twice as fast as my shared hosting providers (even when the respectives test sites already used CloudFront). Performance is also largely equal and consistent across the globe. AWS is really good (that’s why we use them in so many commercial setups, sure).
-
(Estimated) low cost—from my experience using CloudFront (where I pay 2 cents per month for all my websites), AWS is likely a lot cheaper than any “standard” hosting provider.
Cons
-
Poor usability and DX. AWS is terrible to use. Yes, you can learn and get used to it. But that doesn’t change the fact that it’s terrible to use. The setup is complicated, involving 5+ AWS products (more if you also want to set up budget control, user access, and security), and the way cache invalidations, headers, redirects work is all way too convoluted. Even once you have it all set up and figured out, it will probably feel brittle.
But, is it worth it?
I think only if you have an international audience and a lot of traffic. (What “a lot” is, is up to you.)
Personally, which I cannot separate from professionally here, I’m now tearing down my tests, and will for the moment not run my sites entirely on AWS. But, I think it’s a real and likely option for me to move select projects here in a few years, like meiert.com as well as Frontend Dogma. Yet that’s going to be a time investment, and the sites aren’t at the point yet where that has to happen.
That has been my experience, that’s my view at the moment—as mentioned in the beginning, great if something in here has been useful for you, and let me know if you think something could be of interest for me to know! Cheers!
About Me
I’m Jens (long: Jens Oliver Meiert), and I’m a frontend engineering leader and tech author/publisher. I’ve worked as a technical lead for companies like Google and as an engineering manager for companies like Miro, I’m a contributor to several web standards, and I write and review books for O’Reilly and Frontend Dogma.
I love trying things, not only in web development (and engineering management), but also in other areas like philosophy. Here on meiert.com I share some of my experiences and views. (Please be critical, interpret charitably, and give feedback.)
Read More
Maybe of interest to you, too:
- Next: The HTML History and Optimization Cheat Sheet
- Previous: Notes on Hooking Up a Website With Cloudflare
- More under Development
- More from 2024
- Most popular posts
Looking for a way to comment? Comments have been disabled, unfortunately.
Get a good look at web development? Try WebGlossary.info—and The Web Development Glossary 3K. With explanations and definitions for thousands of terms of web development, web design, and related fields, building on Wikipedia as well as MDN Web Docs. Available at Apple Books, Kobo, Google Play Books, and Leanpub.