5

I have a static website hosted on S3 which works fine when accessed through my bucket's endpoint. However, when I create a CloudFront distribution and try access it through using the CloudFront domain I keep getting the error below.

d1xu3mknlk0sbd.cloudfront.net Code: NoSuchBucket Message: The specified bucket does not exist BucketName: d1xu3mknlk0sbd.cloudfront.net RequestId: 656B653A2ED5B2B1 HostId: 9etNAX1XEJmbVKUAMylBDz3xEky+7RhAnr9b8HhpkIb9+pkMnn920v/MSAUjr78oyONEUdlba50= 

I have set up my CloudFront origin domain name to the s3 url of my static site which works when I type it in the browser so why can't CloudFront find the bucket ...

5
  • Did you name your bucket actually d1xu3mknlk0sbd.cloudfront.net? Probably not as the name is random. Commented Mar 12, 2021 at 10:37
  • That is my Cloudfront Domain name serving my s3 bucket Commented Mar 12, 2021 at 10:43
  • 1
    The error message says its bucketname: BucketName: d1xu3mknlk0sbd.cloudfront.net. Can you double check that please? Commented Mar 12, 2021 at 10:51
  • 1
    No it's not. I configured my origin to my s3 bucket using the dropdown so not sure why it is looking there. I also have another distribution running using the same settings which strangely works .. Commented Mar 12, 2021 at 11:50
  • I have the same issue Commented Apr 1, 2021 at 4:53

1 Answer 1

5

Ended up solving this by changing my s3 bucket name from 'sample' to 'www.sample.com' .Strangely CloudFront started resolving the correct bucket name. Why this works remains a mystery ...

Sign up to request clarification or add additional context in comments.

2 Comments

It works! some how you need the 'www' included in the bucket name.
to use an S3 bucket as a website, you need the bucket name to be the fully-qualified domain name (FQDN) of the site

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.