4 ms·
I just stick CloudFront in front of those buckets. You don't need to expose the bucket at all then and can point it at a canonical hostname in your DNS.
by crinkly 1y ago
I just stick CloudFront in front of those buckets. You don't need to expose the bucket at all then and can point it at a canonical hostname in your DNS.
- hnlmorg 1y agoThat’s definitely the “correct” way of doing things if you’re writing infra professionally. But I do also get that more casual users might prefer not to incur the additional costs nor complexity of having CloudFront in front. Though at that point, one could reasonably ask if S3 is the right choice for causal users.
- crinkly 1y agoIt's actually incredibly cheap. I think our software distribution costs, in the account I run, are around $2.00 a month. That's pushing out several thousand MSI packages a day.
- oblio 1y agoWith CloudFront?
- hnlmorg 1y agoS3 is actually quite expensive compared to the competition for both storage costs and egress costs. At a previous start-up, we had terrabytes of data on S3 and it was our second largest cost (after GPUs) and by some margin. For small scale stuff, S3s storage and egress charges are unlikely to be impactful. But it doesn’t mean they’re cheap relative to the competition. There are also ways you can reduce S3 costs, but then you're trading the costs received from AWS with the costs of hiring competent DevOps. Either way, you pay.
- gchamonlive 1y agoS3 + cloudfront is also incredibly popular so you can just find recipes for automating that in any technology you want, Terraform, ansible, plain bash scripts, Cloudformation (god forbid)
- gigatexal 1y agoYeah holy crap why is cloud formation so terrible?
- SteveNuts 1y agoLast time I tried to use CF, the third party IAC tools were faster to release new features than the functionality of CF itself. (Like Terraform would support some S3 bucket feature when creating a bucket, but CF did not). I'm not sure if that's changed recently, I've stopped using it.
- tkjef 1y agoI have been on the terraform side for 7 years-ish. eksctl just really impressed me with its eks management, specifically managed node groups & cluster add-ons, over terraform. that uses cloudformation under the hood. so i gave it a try, and it’s awesome. combine with github actions and you have your IAC automation. nice web interface for others to check stacks status, events for debugging and associated resources that were created. oh, ever destroy some legacy complex (or not that complex) aws shit in terraform? it’s not going to be smooth. site to site connections, network interfaces, subnets, peering connections, associated resources… oh, my. so far cloudformation has been good at destroying, but i haven’t tested that with massive legacy infra yet. but i am happily converted tf>cf. and will happily use both alongside each other as needed.
- gchamonlive 1y agoIt's designed to be a declarative DSL, but then you have to do all sorts of filters and maps in any group of resources and suddenly you are programming in yaml with both hands tied behind your back
- gigatexal 1y agoYeah it’s just terrible. If Amazon knew what was good they’d just replace it with almost anything else. Heck just got all in on terraform and call it a day.
- tayo42 1y ago>S3 is the right choice for causal users. It's so simple for storing and serving a static website. Are there good and cheap alternatives?
- MaKey 1y agoYeah, your classic web hoster. Just today I uploaded a static website to one via FTP.
- fodkodrasz 1y agoReally? If I remember correctly: My Static website served from S3 + CF + R53 by about 0.67$ / mo, 0.5 being R53 from that, 0.16 being CF, S3 being 0.01 for my page. BTW: Is GitHub Page still free for custom domains? (I don't know the EULA)
- daydream 1y agoGitHub Pages are still free but commercial websites are forbidden.
- damieng 1y agoI'd argue putting CloudFront on top of S3 is less complex than getting the permissions and static sharing setup right on S3 itself.
- hnlmorg 1y agoI do get where you're coming from, but I don't agree. With the CF+S3 combo you now need to choose which sharing mode to work with S3 (there are several different ways you can link CF to S3). Then you have the wider configuration of CF to manage too. And that's before you account for any caching issues you might run into when debugging your site. If you know what you're doing, as it sounds like you and I do, then all of this is very easy to get set up (but then aren't most things easy when you already know how? hehe). However we are talking about people who aren't comfortable with vanilla S3, so throwing another service into the mix isn't going to make things easier for them.
- herpderperator 1y agoFor the sake of understanding, can you explain why putting CloudFront in front of the buckets helps?
- bhattisatish 1y agoCloudfront allows you to map your S3 with both - signed url's in case you want a session base files download - default public files, for e.g. a static site. You can also map a domain (sub-domain) to Cloudfront with a CNAME record and serve the files via your own domain. Cloudfront distributions are also CDN based. This way you serve files local to the users location, thus increasing the speed of your site. For lower to mid range traffic, cloudfront with s3 is cheaper as the network cost of cloudfront is cheaper. But for large network traffic, cloudfront cost can balloon very fast. But in those scenarios S3 costs are prohibitive too!
- dcminter 1y agoNot always that simple - for example if you want to automatically load /foo/index.html when the browser requests /foo/ you'll need to either use the web serving feature of S3 (bucket can't be private) or set up some lambda at edge or similar fiddly shenanigans.