I've configured my s3 bucket and bucket policy to allow for Public Read - I dont believe this is an access issue. My cloudfront distribution is pointing to the s3 endpoint (I can also access my website using this endpoint without issues). The weirdest part of this all is I initially solved this problem already - under my globals I had timeout set to 3 seconds, by changing this to 5 seconds this error went away, I was able to access my website using my domain name, it being https and all. The only thing I've done since, is create a lambda function enabling cors (and I am able to invoke this successfully through the API Gateway console production GET invoke URL). A few days later without working on anything I went back to my site to see this error again. I've tried increasing the timeout to 30 seconds, 60 seconds, invalidating files cached in edge locations inside of cloudfront, even replacing my lambda function with the backup I saved of the default hello world function to ensure that wasn't causing the issue. Redeploying after each of these changes and still no luck. Any guidance would be much appreciated, I would be happy to provide more info if needed as I have spent a lot of hours troubleshooting this.
#[SOLVED] CloudFront 504 Error
3 messages · Page 1 of 1 (latest)
I've figured this out, in my cloudfront IaC there is TargetOriginId and under my origins there was DomainName: and Id: (all three have the same value). Rather than the value being something like: my-website-name.s3-website-us-east-1.amazonaws.com - it should be: my-website-name.s3.us-east-1.amazonaws.com - whew I spent hours today and yesterday getting to this info.... going to take a much deserved break haha.
[SOLVED] CloudFront 504 Error