News for hackers. Stuff that matters.
Re:Building a static serverless website using S3 and CloudFront by awb on Monday February 17, 2020 @04:03PM (#22350732)
For me, Netlify is the right mix (I'm not affiliated with them). It has the 90s ease of use with modern tools and performance out of the box. It's simple to upload files or sync a repo and it it's free. I'm not sure why anyone would host a static website on the AWS stack.
Re:Building a static serverless website using S3 and CloudFront by xienze on Monday February 17, 2020 @04:21PM (#22350905)
> I'm not sure why anyone would host a static website on the AWS stack.

Well, I do that, so I guess I'll chime in.

First and foremost is the idea of not tying your site's build process and hosting to a company that could go under. Yes, Amazon could, but if I had to bet Netlify will either cease to exist, be bought out, have its free offering discontinued/changed/etc. long before that.

Second is that sometimes your site's build process is more complicated than what Netlify provides. For example, my site is a static Hugo site, which Netlify supports, but there's one crucial step in the build process where I turn my "resume.html" page into "resume.pdf" -- I have to run a Docker image that starts headless Chrome in order to render the PDF properly. As far as I can tell, that can't be rigged up in Netlify.

Finally, I was able to learn a lot about AWS by hosting my site this way -- setting up a Lambda to listen for GitHub commits, using the AWS API to launch an EC2 instance to build my site, how to configure S3 and CloudFront to serve up content properly, etc. And at the end of the day I get a site that I have complete control over and is approximately free to run.

Re:Building a static serverless website using S3 and CloudFront by seanwilson on Monday February 17, 2020 @08:35PM (#22352675)
> First and foremost is the idea of not tying your site's build process and hosting to a company that could go under.

Sounds like you're imposing a complex build process on yourself while getting locked into a web of AWS features to be honest.

Could you not skip generating the PDF resume since you've already got the HTML version to keep life simple?

If you stick to running a basic NPM script to build your site there's little lock-in with Netlify. You could also build your site on a CI platform then push the generated pages + assets to Netlify after.

Re:Building a static serverless website using S3 and CloudFront by xienze on Monday February 17, 2020 @10:33PM (#22353236)
> Sounds like you're imposing a complex build process on yourself while getting locked into a web of AWS features to be honest.

I should elaborate a little. My whole site is contained within a Docker container that has NPM, Yarn, headless-chrome, Hugo, etc. I can generate everything with a single command. The AWS bits are just there for hosting and responding to a GitHub commit. So the build process is portable-ish, but from what I saw Netlify doesn’t just let you do headless-chrome on a free plan[1].

> Could you not skip generating the PDF resume

Not really, the point is to automate everything away behind a single Git push.

1: https://community.netlify.com/t/using-zipped-binaries-how-to...

Re:Building a static serverless website using S3 and CloudFront by seanwilson on Tuesday February 18, 2020 @05:13AM (#22354828)
Why do you need a PDF resume that's built automatically though? Does it need to be in PDF? Does it change that often? Aren't resumes something you customise per job application?
Re:Building a static serverless website using S3 and CloudFront by JeanSebTr on Monday February 17, 2020 @05:15PM (#22351381)
For the first point, I'd say it's best to save the setup time by using a service like Netlify and keep that for if/when they shut down.

For the PDF, there's probably some service that could be used to wire that quick. But I agree that can be the cut-off point where it might be simpler for some to use docker.

Re:Building a static serverless website using S3 and CloudFront by mprev on Monday February 17, 2020 @04:33PM (#22351033)
Who is downvoting this? It seems to be a polite answer to the question asked.
Re:Building a static serverless website using S3 and CloudFront by meritt on Monday February 17, 2020 @04:49PM (#22351151)
I didn't vote on the comment but it came across to me as emblematic of what I feel is "wrong" with technology trends over the past decade. Where instead of solving business problems it's mostly building tools on top of tools or reinventing the wheel in the latest language/ecosystem. Programmers rarely produce anything of value anymore, but instead parade around their mastery of an increasingly complex toolchain that delivers the same end result.
Re:Building a static serverless website using S3 and CloudFront by ilovenetlify on Monday February 17, 2020 @07:41PM (#22352409)
You could use something like LaTeX to create your PDFs on Netlify during the build process. e.g. https://github.com/frangio/netlify-latex
Re:Building a static serverless website using S3 and CloudFront by xienze on Monday February 17, 2020 @07:49PM (#22352436)
It’s a page with some pretty fancy styling, a lot of it shared with the regular pages of my website. So it would be a ton of effort to port it to LaTeX.
Re:Building a static serverless website using S3 and CloudFront by ilovenetlify on Monday February 17, 2020 @07:52PM (#22352453)
You can install and run just about any binary: LaTeX being an example of a binary that generates PDFs. Just curious: what do you use to generate your PDFs?
Re:Building a static serverless website using S3 and CloudFront by xienze on Monday February 17, 2020 @08:20PM (#22352598)
The site is generated by Hugo, and the resume is one page on the site with some custom styling bits. Then a Docker container running headless Chrome plus some JS bits is used to export it to PDF.
Re:Building a static serverless website using S3 and CloudFront by ilovenetlify on Tuesday February 18, 2020 @06:33AM (#22355178)
Thanks. I’ll give that a try as I’m still not happy with my PDF generation from headless CMS.
Re:Building a static serverless website using S3 and CloudFront by philistine on Monday February 17, 2020 @05:35PM (#22351556)
I’ll give you my answer: I optimized for the lowest cost for a solution I could forget about. And not any suspicious free option like Github pages that might go away next year. True lowest cost hosting for a static website. AWS was the cheapest for me.
Re:Building a static serverless website using S3 and CloudFront by wexxy on Monday February 17, 2020 @04:08PM (#22350787)
Well... technically netlify is AWS behind the scenes isn't it?
Re:Building a static serverless website using S3 and CloudFront by endorphone on Monday February 17, 2020 @04:33PM (#22351031)
Does it matter? To people at our distance from it the process is a magical one where a git repo becomes a website. What technology stack they use, on which services, etc, is an abstraction that isn't particularly relevant to us.
Re:Building a static serverless website using S3 and CloudFront by bathtub365 on Monday February 17, 2020 @04:38PM (#22351074)
Until it breaks. Then you are either completely stuck, or trying to untangle the thick, multilayer abstraction hosting your "static" website.
Re:Building a static serverless website using S3 and CloudFront by endorphone on Monday February 17, 2020 @05:47PM (#22351652)
If it broke it would take me all of minutes to have it hosted elsewhere. There is essentially zero lock-in with the service, even if you're using some of more complicated build steps.
Re:Building a static serverless website using S3 and CloudFront by ilovenetlify on Monday February 17, 2020 @04:45PM (#22351114)
Yup. Netlify have nailed it.
Re:Building a static serverless website using S3 and CloudFront by zelly on Tuesday February 18, 2020 @04:24AM (#22354624)
"growth hacking"
Re:Building a static serverless website using S3 and CloudFront by sintaxi on Monday February 17, 2020 @07:04PM (#22352181)
It's sad how Netlify feels the need to shill their service when others are launching their product - like you have done with this account.
Re:Building a static serverless website using S3 and CloudFront by tomcam on Monday February 17, 2020 @07:32PM (#22352347)
How do you know?
Re:Building a static serverless website using S3 and CloudFront by ilovenetlify on Monday February 17, 2020 @07:37PM (#22352382)
I don’t work for or have any relationship with Netlify. I do think their service is wonderful.
Re:Building a static serverless website using S3 and CloudFront by touristtam on Tuesday February 18, 2020 @03:30AM (#22354403)
To the point that your handle on HN is your proclaimed love for the company? That's weird for an account less than 24 hour old.
Re:Building a static serverless website using S3 and CloudFront by ilovenetlify on Tuesday February 18, 2020 @06:32AM (#22355172)
It‘a not weird. It’s just a username.