Hosting your static site with AWS S3, Route 53, and CloudFront for free
vickylai.com
vickylai.com
Hopefully, it's a good enough of a hook to get you started on AWS that it is worth it to keep it cheap like it is now.
Given the downward pricing trends of cloud providers for past few years as well as increased competition (Azure & GCP primarily) I think we can safely assume pricing tiers will remain reasonable.
There are plenty of gotchas when serving a static site via CloudFront. Let's say you have a page at example.com/foo/index.html. If you want it serve it from example.com/foo/ then you need to write a Lambda@Edge request function to handle the directory index — the article implies that CloudFront's default root objects handle this, but they don't. That's for the domain root only.
There's also the case of redirecting example.com/foo to example.com/foo/ (adding the trailing slash). That requires a Lambda@Edge response function. It's all a lot of fun to get working, but you do start to wonder if your static site really is static.
> CloudFront does allow you to specify a default root object (index.html), but it only works on the root of the website (such as http://www.example.com > http://www.example.com/index.html). It does not work on any subdirectory (such as http://www.example.com/about/). If you were to attempt to request this URL through CloudFront, CloudFront would do a S3 GetObject API call against a key that does not exist.
https://aws.amazon.com/blogs/compute/implementing-default-di...
A request for https://visidata.org/releases (no trailing slash) also results in an HTTP 302 to https://visidata.org/releases/ (with a trailing slash). Is there something other than Lambda@Edge functions handling this on visidata.org?
While it’s not strictly CloudFront only doing the work, it’s still a static site.
I also switched some time ago from Gitlab to CloudFront and S3 because it lets me optimize things that get you to 100% at Pagespeed Insights [2] such as Cache Control.
[1] https://correctme.ifiamwrong.com/posts/cloudfrontcloudformat... [2] https://developers.google.com/speed/pagespeed/insights/?hl=e...
I push, they build.
I can specify versions, build parameters, etc, easy SSL certs, never noticed any down time, etc.
Granted my site sees like <100people/mo, but still -- for a personal/CV site, I don't think you can do much better.
GitHub Pages actually had IPv6 support, but they removed it, because they added HTTPS support (that's what their support said). But I checked and the old IPv6 CDN endpoints actually still work, even with HTTPS.
Netlify actually has also promised IPv6 support "at the start of the year"[0], but I wouldn't count it.
WAF also doesn't seem to be free, where did you read that?
"Is that how you want the web to generally work?"
My suggestions on ways to prevent paying for CloudFront charges from junk requests are not prescriptive. However, they are AWS best practices when dealing with DDoS.
https://aws.amazon.com/answers/networking/aws-ddos-attack-mi...
For example, if I want to purchase southwest airline tickets, I have to use a VPN.
Off-topic but interesting anyways, I've noticed that people who move from the US to elsewhere, often call themselves "expats", while people who move from elsewhere to the US, are called "immigrants". Why is that?
I think it depends on how you view the move. Expat (which in my experience I've heard more Brits use than anything else), implies that you still 'belong' to your home country but are choosing to live elsewhere for a (perhaps very long) while. Immigrant implies that you are leaving your old country with a view of 'belonging' to your new country.
Simplified slightly, if you ask someone where they're from and they answer "I'm from X, but living in Y" they are an expat. If they answer "I'm from Y, but was born in X" they're an immigrant.
I gave an example of running a React app[1]
[1]: https://www.toptal.com/github/unlimited-scale-web-hosting-gi...
https://serverless-stack.com/chapters/deploy-the-frontend.ht...
Please type your payment information so we can verify your identity. We will not charge you unless your usage exceeds the AWS Free Tier Limits.
The only free hosted database that I am aware of is Mongo Atlas a 3 Node cluster with 500MB oh storage.
EDIT: and I've used pretty much all the ISPs we have around
https://www.cox.com/residential/support/internet-ports-block...
They don't block 443 though