Reputation: 5531
I have two aws account , I want to configure route 53 from one account to redirect the request to s3 in the another account.
I have enabled web-hosting and public access in the s3 bucket. The end point was accessible from the browser and application is loaded.
In another aws account I have created CNAME
record and pointed to the S3 bucket url but getting below error
CNAME Details:
CNAME: www.mydomainname.com
Type : CNAME-Canonical name
Value: myS3bucketNAme.s3-website-us-east-1.amazonaws.com
404 Not Found
Code: NoSuchBucket
Message: The specified bucket does not exist
DO i need to set any header or need to add any additional configuration
Upvotes: 2
Views: 826
Reputation: 1966
You need to create an s3 bucket with the same name as the domain: www.example.com
or example.com
and enable the web hosting on the bucket. Then you can point the dns record to them.
Here you have the steps to follow:
https://docs.aws.amazon.com/AmazonS3/latest/dev/website-hosting-custom-domain-walkthrough.html
If you want to keep the name of your bucket, you will need to create a cloudfront distribution to send the request to that bucket and change de DNS record pointing the value to the CF distribution URL, the good part about this option is that you can use https
, just with route53 and s3 setup that is not possible.
Also here you have the steps to follow:
https://docs.aws.amazon.com/AmazonS3/latest/dev/website-hosting-cloudfront-walkthrough.html
Upvotes: 2
Reputation: 35176
Make sure the S3 bucket has a bucket policy allowing the other account to retrieve objects.
Please visit the below URL:
https://aws.amazon.com/premiumsupport/knowledge-center/cross-account-access-s3/
Upvotes: 1