Settings

Theme

Show HN: Simple CDN backed static website in AWS

github.com

18 points by lifebeyondfife 4 years ago · 11 comments

Reader

mulmboy 4 years ago

What's novel about this? And why use it over any of the more polished/simplified offerings like netlify?

  • lifebeyondfifeOP 4 years ago

    Nothing particularly novel but the setup of configuring CloudFront to connect to S3 and handle SSL termination, a DNS record pointing to CloudFront, an S3 bucket to hold the contents, an S3 bucket security policy which restricts access just to CloudFront... well, it's complex and easy to misconfigure.

    In terms of pricing, you can store 1GB in S3 for a year for a fraction of a dollar. The majority of the cost comes from CloudFront. Unless you have serious traffic, this is extremely cheap:

    https://aws.amazon.com/cloudfront/pricing/

    The interface (just put files in S3) suits me. I have a site where I deploy and invalidate the CloudFront cache in a GitHub Action: https://github.com/lifebeyondfife/whisky-menu/blob/master/.g...

  • tylergetsay 4 years ago

    It's probably cheaper

jamjamjamjamjam 4 years ago

Why not use github actions and github pages? Free and easier, all in one place with one account.

iSloth 4 years ago

Is there any advantage to this over something like cloudflare pages?

  • lifebeyondfifeOP 4 years ago

    Cloudflare Pages looks like a more productionised version of this, yes.

    In terms of advantages, I'd say price, and the maturity of using AWS. I deploy a static site with a GitHub Action (look at my other repo whisky-menu for how to do this) which builds a React app, copies it to S3, and invalidates the CloudFront cache.

    • iSloth 4 years ago

      Price?... Cloudflare is completely Free, so surely it beats AWS on cost?

      • lifebeyondfifeOP 4 years ago

        You're correct, yes, I didn't realise how generous the free tier is. If you're doing fewer than 500 updates per month, Cloudflare looks good https://pages.cloudflare.com/

        Because I have other resources and projects in AWS I'll keep this setup. It's so close to free that cost doesn't bother me.

hilalh 4 years ago

Why not use Amplify Console for hosting with a CDN?

  • lifebeyondfifeOP 4 years ago

    Familiarity with S3, Route53, and CloudFront was a draw for me personally.

    AWS is all about abstractions. Some of them are worth learning but increasingly there's a wall of options in AWS and, for me, it's not worth spending time staying on top of all of them. The few services needed for this setup are some of the most popular and will be there in the future.

sgallant 4 years ago

Very cool. Thanks for sharing this.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection