I created a GCP storage bucket named for a domain managed by Google Domains. I have uploaded the files, created a CNAME record for c.storage.googleapis.com, and changed the ACLs to public-read. However, I'm still getting the error:
<Error>
<Code>NoSuchBucket</Code>
<Message>The specified bucket does not exist.</Message>
</Error>
Note that I wasn't asked to verify the domain when I created the bucket. I assume this is normal for a domain managed by Google Domains as it says "automatically verified."
I'm not sure how to debug this issue.
I got it. I just needed to add www. to the beginning of the bucket name.
In other words:
www.domain.com instead of domain.com
Related
I am unable to access S3 objects and Bucket via cloud front URL.
I have created CLOUDFRONT Distribution ( Web ) and setup origin path to media folder in my S3 bucket. ( /media)
CF url is pointing to bucket/media , but i am unable to access it from my web application as well as browser.
I am trying to access like below:
http://d1xdpXXXXX.cloudfront.net/media/images/Tiger.jpg
Tiger.jpg can be accessed via s3 url.
I also tried http://d1xdpXXXXX.cloudfront.net but i am getting below error:
<Error>
<Code>NoSuchBucket</Code>
<Message>The specified bucket does not exist</Message>
<BucketName>d1xdpwiqgrffrd.cloudfront.net</BucketName>
<RequestId>484BBB2F7907172F</RequestId>
<HostId>+bLr4Qx+uawbq4YNIOuKGCQVDGQQQsifGnNt9J5Pn+r3mqbDiVYcpNZRUfnCyPnHxewfMVp3QYc=</HostId>
</Error>
Please help.
CF Distribution settings
Access denied error
You have already added the path in cloudfront origin.
So, you don't have to add that in cloudfront url you are using to download.
Just use
http://d1xdpXXXXX.cloudfront.net/images/Tiger.jpg
as /media is already part of the distribution.
I'm working on getting a static website deployed with AWS Codebuild, hosted in an S3 bucket, and accessed via Cloudfront. Everything seems to work except from accessing from Cloudfront. From Cloudfront, I can access files that I manually upload, and using the bucket URL, I can access all the files. Looking through the individual file settings/permissions, they all look to be the same, regardless of whether they were manually uploaded, or deployed via Codebuild. I've tried invalidating the Cloudfront cache, and re-deployed via Codebuild several times.
Additional Information:
I provided the S3 bucket as an origin when setting up the Cloudfront distribution.
Accessing via Cloudfront gives the following error:
<Error>
<Code>AccessDenied</Code>
<Message>Access Denied</Message>
<RequestId>0211CBE618946F</RequestId>
<HostId>
7sRZhaJS4x2W7Iaeo4y8KAjvsOJcNWh3PxCdgnhXPE22oyp1RxZhwpjrqbsWapsUSaqBK+jqE=
</HostId>
</Error>
What else should I check?
For some reason, adding a default root object fixed the issue.
FWIW, I initially changed the value to dist/index.html, which allowed me to access the deployed bucket contents via the Cloudfront URL, but required the index.html suffix. Once I changed it to index.html, everything worked fine.
I have created a record set for my webiste volcalc.io and www.volcalc.io which is stored in an s3 bucket.
When I try to browse to the website I see this error:
404 Not Found
Code: NoSuchBucket
Message: The specified bucket does not exist
BucketName: volcalc.io
RequestId: xxx
HostId: xxx
The bucket name is www.volcalc.io, not volcalc.io
How do I change it to make it look for bucket named www.volcalc.io?
See Setting Up a Static Website Using a Custom Domain.
To allow requests for both example.com and www.example.com, you need to create two buckets even though you will host content in only one of them. You will need to configure the other bucket to redirect requests to the bucket that hosts the content.
I was using s3 for for my static websites, we had three websites/paths in s3:
example.com
example.com/website1
example.com/website2
Website1 and Website2 were folders inside the bucket example.com as expected. But now we need https urls so we decided to go with aws cloudfront for the redirects. Cloudfront generated for example a url like this, https://123455678.cloudfront.net .
When I navigate to the url, it gets the example.com correctly, but when I try to put like https://123455678.cloudfront.net/website1 it seems like its not entering the /website1 path in the s3. So it gives me this error because it's not finding the index.html inside the /website1 path.
<Error>
<Code>AccessDenied</Code>
<Message>Access Denied</Message>
<RequestId>C5259E1658595A69</RequestId>
<HostId>
B1HYQsr0Xv4M1avKlJ3G8t0rkVfCvbOoJadxm5z1BwapblBeERm3c6Ni+jZWxB8FlXEaF6bUAik=
</HostId>
</Error>
I guess I have to do something in the origins and behaviours of my cloudfront distribution, but I can't figure out what to do there...
I fixed my problem by changing the origin domain name in my cloudfront distribution to my s3 bucket endpoint, located in the properties of my bucket in Static Website Hosting area.
Saved, waited for cloudfront to use the updated changes and it worked. Also my Default Root Object is set to index.html .
Hope it helps someone =)
I would like to use a subdomain instead of the direct url to my s3 bucket at amazon.com. So instead of downloading images via an url like http://bucket-images.s3-eu-west-1.amazonaws.com/path/to/image.pngI would like to use http://assets.domain.com/path/to/image.png. I tried setting a CNAME like this:
CNAME assets domain.com bucket-images.s3-eu-west-1.amazonaws.com
But after setting this CNAME I receive such error from amazon, when I visit the domain:
<Error>
<Code>NoSuchBucket</Code>
<Message>The specified bucket does not exist</Message>
<BucketName>assets.domain.com</BucketName>
<RequestId>45646DFSDFSFASDF</RequestId>
<HostId>
dfasdcvcvd546456454ds5fasdf4ad5f64asdfasdfccdfgvggtg
</HostId>
</Error>
Over here they're telling to change the bucketname: https://forums.aws.amazon.com/message.jspa?messageID=237562
But that doesn't make sense. I worked on a project earlier, who used a bucketname totally different from the subdomain. So there has to be a way... Anyone who can help me out?
For S3 you need the CNAME and bucket name to match:
The bucket name must be the same as the CNAME. So http://images.johnsmith.net/filename would be the same as http://images.johnsmith.net.s3.amazonaws.com/filename if a CNAME were created to map images.johnsmith.net to images.johnsmith.net.s3.amazonaws.com
So in your specific example you need to name the bucket assets.domain.com.
http://docs.aws.amazon.com/AmazonS3/latest/dev/VirtualHosting.html#VirtualHostingCustomURLs
If you need more flexibility, you can create a CloudFront distribution for your S3 bucket and assign a CNAME to your CloudFront distribution.
http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/CNAMEs.html
Addtional to #Samuel Neff's information:
Just remember to name your AWS S3 bucket same as your Cloudflare CNAME record. Otherwise it will not work.
Here I tried and worked for me:
Converted
https://s3-eu-west-2.amazonaws.com/cdn.domain.com
to
http://cdn.domain.com