This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-01-06
Channels
- # announcements (16)
- # aws (9)
- # babashka (76)
- # beginners (92)
- # boot (1)
- # cider (18)
- # clara (7)
- # clj-kondo (26)
- # clojure (104)
- # clojure-europe (4)
- # clojure-nl (11)
- # clojure-spec (11)
- # clojure-survey (101)
- # clojure-uk (35)
- # clojuredesign-podcast (18)
- # clojurescript (8)
- # core-async (29)
- # data-science (1)
- # datomic (13)
- # emacs (4)
- # fulcro (20)
- # graalvm (14)
- # instaparse (2)
- # jobs (1)
- # juxt (6)
- # malli (5)
- # off-topic (30)
- # onyx (3)
- # planck (1)
- # project-updates (7)
- # re-frame (38)
- # reagent (30)
- # reitit (14)
- # remote-jobs (2)
- # shadow-cljs (50)
- # sql (8)
Hi everyone. I have an issue with an existing static website on S3 fronted by CloudFront. I’m migrating it to use CDK for deployment. I redirect www to apex domain, so I have both http://domain.com and http://www.domain.com buckets set up, and the www one redirects to the apex address. This all worked fine when set up manually but when deploying via CDK I get AccessDenied errors when accessing the www address. The apex one works fine.
Tangent: we switched from an s3 hosted website to Netlify and it's fantastic. Big win over s3.
I looked at Netlify, but I’d also have to migrate my lambda functions, Dynamo DB etc, it would end up being a pretty big rewrite. CDK actually makes AWS much more palatable once all the bits are figured out.
Plus I’m increasingly reluctant to build infrastructure on venture-backed startups. At least I know AWS isn’t going anywhere.
Haha that's fair. For us it's simply static website hosting -- no code changes needed. Switching Netlify <-> S3 would take no time at all. The automatic build previews and rollback features are fantastic.
The s3 bucket endpoint address looks like http://www.domain.com.s3-website-us-east-1.amazonaws.com. If I hit that address manually it works fine. However looking at the CloudFront configuration, the origin is being set up using an address like http://www.domain.com.s3.us-east-1.amazonaws.com - previously when I set CloudFront up by hand I used the endpoint address from the S3 console, and it all worked ok.
Actually, the origin address seems to be a red herring. The issue seems to be that the bucket is being treated as a content bucket even though the console says it’s configured to redirect all requests. But this only happens when I access it via CloudFront. Directly hitting the endpoint URL works.
Ok, TIL that S3 has a website mode and a REST mode, and that the REST mode doesn’t do website-like things such as redirects: https://stackoverflow.com/a/22750923