Looks very similar to my project https://github.com/kkuchta/scarr from a while back. It even uses the same acronym (I assume that's just a coincidence, since we both just picked a cool-sounding english-language word using the initials from S3, Cloudfront, ACM, and ACM.
At a glance:
- Mine handles domain registration + ACM verification automatically
- This one wisely uses clioudformation instead of api calls
- This one does apex->ww redirects, whereas mine uses the apex and has no redirect
GitHub pages [0] gives you static sites with HTTPS and a custom domain without nearly as much complexity as this if you're looking for an alternative to Netlify.
Maintenance is my primary concern. I deal with software for a living. I want my blog to just work without me having to worry about maintaining the VM. Netlify makes this dead simple.
I used to host Wordpress sites for myself and family members. I've now moved nearly all of those sites to Netlify (for hosting) and Forestry (for editing/CMS). I no longer have to worry about malicious hacking attempts, Wordpress updates, or anything else outside of the site content.
I disagree with encouraging people to do this. You are not accounting for a CDN here, like the post. A website on the HN front page went down yesterday on a $5 VM.
And S3 just holds your HTML files, for super cheap. There’s no lock-in concern there. You can easily migrate to nginx in the future if you really want, but start with S3
There are some low end VPS providers too that go as low as $1/mo. I usually stick to $2/mo or higher just for stability, reliability. Even you even got hosts like Hetzner Cloud, Scaleway (see European hosts) that provide great service, bandwidth, and VPS. I don't know why people use Amazon... I don't find their value proposition very good unless you need dynamic scaling for unpredictable demand.
I host my site on Apache running on an ARM board in my garage.
I'll consider moving to a VM if/when the ARM board eventually fails, but it's been running for 6 years so far. I have 6TB of storage, which mostly serves as a NAS but includes about 200GB of photos for the website.
There is no deployment process; the web root is mounted by NFS on my desktop. I can share large files with people just with "mv" or "ln -s".
> how many 9s do my personal websites actually need?
My router seems to crash every 3-4 months, and I need to reset it. There's around 15-30 minutes of power failure every year. I don't worry about this.
yes. I host my personal website (maddo.xxx) on a single EC2 instance with just nginx. It's easy. It's fast. When I want to over-engineer the shit out of it for fun, it's ready.
I served a static website off nginx from a docker container for a while. At some point there was a breaking change and it would have taken 3 minutes to fix, but I didn't bother. Static hosting is a solved problem and there's not really a reason to do it yourself unless you just want to learn.
If it’s a static site and you own the domain then vendor lock-in isn’t really a problem regardless of if you use cloud services or not. Because you can just dump those files on a different provider and change your DNS entry. It’s not even remotely the same level of complexity as other services when people normally talk about vendor lock-in.
I don't know why anyone cares about vendor lock in. It's either trivial to move an aws lambda to a google cloud function because you don't have a lot going on, or it's not trivial to move stuff from even your own servers to other servers because it's under huge load and you have considerable amount of data you'd have to migrate under complex conditions.
Moving around is either hard or easy based on things that don't really have anything to do with vendor lock in.
As an aside, I genuinely wonder under which circumstances a CDN will be useful for a static website nowadays.
I have a static website that has been on the HN homepage a few times and got picked up by the Chrome mobile recommendations and a nginx/https with slightly tweaked configuration never had a problem handling the traffic even on the smallest DO droplet.
The CDN makes the site load faster by caching the content on edge nodes close to the client. It’s not for taking load off the origin, but purely for network latency.
What I like about static sites is that you can serve the site in its entirety from a CDN. So you can literally just CNAME www.yoursite.com to yoursite.gitlab.io (or w/e static site host you use). This dramatically cuts down on latency worldwide. It also removes your web server as a single point of failure for short-term outages.
The technical reason to use a CDN with aws s3 is so that you can have a custom domain name with https. s3 will do http custom domains, but to get https you proxy it. In this case, you can think of Cloudfront as the proxy.
We use a combination of Netlify + Webflow + Hugo for our website (www.facetdev.com). With that we get a global CDN and our website will never go down.
Netlify has been awesome and it made it stupid easy to combine our www site on Webflow with a hugo static blog in a subfolder (/blog). This might be my favorite web publishing workflow ever.
If you haven't tried Netlify yet, definitely give it a look.
How much does this cost? I put in some more effort to setup my HAProxy and nginx containers on a Vultr node, but I get LetsEncrypt for free, so I'm just paying for a Vultr node (or DO droplet) and the price of the domain name:
It costs at least $0.50/month but probably not much more than that for most small to medium sites.
The $0.50 is the monthly cost of the Route 53 hosted zone; the CloudFront and S3 costs typically amount to pennies, but of course it depends on traffic.
I have a two-line Makefile that with one target that sync's my website with an S3 bucket. Deploys are instant. The rest is handled by Cloudflare an AWS. The sheer number of moving parts in this system is outrageous for a static website. A fun project for sure, though.
Bundling service config and launch makes the whole process easier, for sure. There's also more than one way to configure this depending on what your needs are, so it'd be cool to have a few different versions of SCAR.
I started with a setup similar to your diagram and tweaked it when I realized S3 didn't serve index.html when the URL was just the parent "directory", i.e. example.com/foo/ doesn't resolve to s3://example.com/foo/index.html. To get this working I had to write a bit of JS in a Lambda function and deploy it at the edge of my CloudFront distribution to do some URL rewriting.
Given that's the behavior most people expect, might be worth considering?
That should indeed be the default behavior out of the box with the way the S3 buckets are configured. I have a couple Jekyll sites deployed this way, and a request to the parent directory does get served by the contents in `index.html`. Are you not seeing that behavior?
I'd definitely like to add more variants of the default stack. At the minimum, I'm sure there are folks that prefer `www` redirects to the apex domain, or removing the `www` subdomain altogether.
Recently moved some static sites from S3 to AWS Amplify Console. Super easy setup and even easier maintenance with the Git-based workflow: https://aws.amazon.com/amplify/console/
Anyone have an a average monthly fee for using these as hosting solution? last time i ran the numbers using all that services go from 5 to 10 USD per month and was better to use amazon lightsail (3.5 per month) or other cheaper alternatives at lowendbox
For anyone looking for a hosted solution, https://surge.sh/ is super nice and simple without any of the complexity of managing the stack yourself. Deploying uses one simple command, and you get hosting and custom domains for free, though I believe SSL is paid for custom domains. (I'm not affiliated with Surge at all, just a happy user.)
great job! I wish more projects have 1-click deploy to Heroku, aws, gcp or azure. This is a good habit more people should get into.
Running this project on aws can give a cloud beginner an interesting way to expose them to many concepts. Now I just have to figure out what static website I want to run in this!
Please do the same for running your own scalable wordpress install!
The technology is awesome, but I won't use Cloudformation, Azure Resource Manager templates, etc. until AWS, Azure, etc. support spending limits. Getting into the habit of clicking "Deploy Stack" when you're credit card is attached to an account that allows unlimited spending seems risky to me.
I just built my first static page since middle school this last weekend using netlify and a static site generator [Publii]. I was amazed at how simple and fast netlify is.
I’m confident I could figure out how how to do something much more complicated. But I want to focus on other things and it’s nice to not have to think about it.
The AWS CloudFormation console has a "Designer" tool that allows drag-and-drop creation of template files, and also visualizes existing JSON or YAML template files with these diagrams.
[+] [-] fishtoaster|6 years ago|reply
At a glance: - Mine handles domain registration + ACM verification automatically - This one wisely uses clioudformation instead of api calls - This one does apex->ww redirects, whereas mine uses the apex and has no redirect
Seems pretty cool!
[+] [-] jaden|6 years ago|reply
[0] https://pages.github.com/
[+] [-] gtirloni|6 years ago|reply
[+] [-] jkarneges|6 years ago|reply
[+] [-] fjp|6 years ago|reply
[+] [-] Scarbutt|6 years ago|reply
https://help.github.com/en/articles/githubs-products#github-...
[+] [-] NateEag|6 years ago|reply
It's pretty simple to configure nginx for static sites, and by doing it yourself you reduce vendor lockin to just about nil.
Even if S3 is massively cheaper, $5/month for a tiny VM seems like a small price to pay for being vendor-abstract.
I suppose S3 is way less likely to suffer a meaningful outage than my little VM, but how many 9s do my personal websites actually need?
[+] [-] clintonb|6 years ago|reply
I used to host Wordpress sites for myself and family members. I've now moved nearly all of those sites to Netlify (for hosting) and Forestry (for editing/CMS). I no longer have to worry about malicious hacking attempts, Wordpress updates, or anything else outside of the site content.
Here is my post on this transition for those interested: https://dev.clintonblackburn.com/2019/03/31/wordpress-to-jek....
[+] [-] shshhdhs|6 years ago|reply
And S3 just holds your HTML files, for super cheap. There’s no lock-in concern there. You can easily migrate to nginx in the future if you really want, but start with S3
[+] [-] WhiteOwlLion|6 years ago|reply
[+] [-] Symbiote|6 years ago|reply
I'll consider moving to a VM if/when the ARM board eventually fails, but it's been running for 6 years so far. I have 6TB of storage, which mostly serves as a NAS but includes about 200GB of photos for the website.
There is no deployment process; the web root is mounted by NFS on my desktop. I can share large files with people just with "mv" or "ln -s".
> how many 9s do my personal websites actually need?
My router seems to crash every 3-4 months, and I need to reset it. There's around 15-30 minutes of power failure every year. I don't worry about this.
[+] [-] tyre|6 years ago|reply
Deploys? One line of `scp`
scp -r -i ./certs/maddoxxxnginx.pem ./app/* [email protected]:/var/www/maddo.xxx/
(that deploy script just bulk uploads everything, but that's fine for now. The whole site is measured in KB.)
[+] [-] jniedrauer|6 years ago|reply
[+] [-] jakelazaroff|6 years ago|reply
[+] [-] dmitriid|6 years ago|reply
[+] [-] pushpop|6 years ago|reply
[+] [-] wolco|6 years ago|reply
[+] [-] klodolph|6 years ago|reply
[+] [-] mevile|6 years ago|reply
I don't know why anyone cares about vendor lock in. It's either trivial to move an aws lambda to a google cloud function because you don't have a lot going on, or it's not trivial to move stuff from even your own servers to other servers because it's under huge load and you have considerable amount of data you'd have to migrate under complex conditions.
Moving around is either hard or easy based on things that don't really have anything to do with vendor lock in.
[+] [-] gvand|6 years ago|reply
As an aside, I genuinely wonder under which circumstances a CDN will be useful for a static website nowadays. I have a static website that has been on the HN homepage a few times and got picked up by the Chrome mobile recommendations and a nginx/https with slightly tweaked configuration never had a problem handling the traffic even on the smallest DO droplet.
Edit: Thanks for these replies.
[+] [-] Xylakant|6 years ago|reply
[+] [-] zachruss92|6 years ago|reply
[+] [-] tedshroyer|6 years ago|reply
[+] [-] rsweeney21|6 years ago|reply
Netlify has been awesome and it made it stupid easy to combine our www site on Webflow with a hugo static blog in a subfolder (/blog). This might be my favorite web publishing workflow ever.
If you haven't tried Netlify yet, definitely give it a look.
[+] [-] triangleman|6 years ago|reply
[+] [-] singingwolfboy|6 years ago|reply
Sometimes it’s nice to understand how all the pieces fit together, instead of using an automated system!
[+] [-] djsumdog|6 years ago|reply
https://github.com/sumdog/bee2
[+] [-] 1023bytes|6 years ago|reply
[+] [-] cloudkj|6 years ago|reply
The $0.50 is the monthly cost of the Route 53 hosted zone; the CloudFront and S3 costs typically amount to pennies, but of course it depends on traffic.
[+] [-] whalesalad|6 years ago|reply
[+] [-] kaiku|6 years ago|reply
I started with a setup similar to your diagram and tweaked it when I realized S3 didn't serve index.html when the URL was just the parent "directory", i.e. example.com/foo/ doesn't resolve to s3://example.com/foo/index.html. To get this working I had to write a bit of JS in a Lambda function and deploy it at the edge of my CloudFront distribution to do some URL rewriting.
Given that's the behavior most people expect, might be worth considering?
[+] [-] IanCal|6 years ago|reply
[+] [-] cloudkj|6 years ago|reply
I'd definitely like to add more variants of the default stack. At the minimum, I'm sure there are folks that prefer `www` redirects to the apex domain, or removing the `www` subdomain altogether.
[+] [-] huphtur|6 years ago|reply
[+] [-] SadWebDeveloper|6 years ago|reply
[+] [-] iBelieve|6 years ago|reply
[+] [-] jareware|6 years ago|reply
[+] [-] tamalsaha001|6 years ago|reply
[+] [-] timClicks|6 years ago|reply
[+] [-] morenoh149|6 years ago|reply
Running this project on aws can give a cloud beginner an interesting way to expose them to many concepts. Now I just have to figure out what static website I want to run in this!
Please do the same for running your own scalable wordpress install!
[+] [-] donmcronald|6 years ago|reply
[+] [-] t0astbread|6 years ago|reply
[+] [-] triangleman|6 years ago|reply
[+] [-] pier25|6 years ago|reply
[+] [-] anvarik|6 years ago|reply
[+] [-] blairanderson|6 years ago|reply
I will be staying with netlify
[+] [-] d-sc|6 years ago|reply
I’m confident I could figure out how how to do something much more complicated. But I want to focus on other things and it’s nice to not have to think about it.
[+] [-] vnglst|6 years ago|reply
It’s still a cool project though, since it shows exactly how many problems Netlify solves for us
[+] [-] pier25|6 years ago|reply
[+] [-] cloudkj|6 years ago|reply