Reputation: 153
According to AWS documentation:
I added 2 buckets for my website. (one for route and one for subdomain (example.com and www.example.com).
1a) I added my website files in both buckets.
Named the buckets according to my domain name.
I made all the files public and there is a red box that says publically accessible and I added this bucket policy.
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PublicReadGetObject",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::MyBucketName.com/*"
}
]
}
Both buckets have static website hosting enabled. I also selected index.html and error.html files.
Now, this is important imo, when I click bucket website endpoint link, it perfectly shows my website.
-- On the other hand, in Route 53 where I have my domain. I added 2 records for those buckets, everything is according to documentation AWS provides.
So, I selected my hosted zone, bucket names are matching with the domain name. I created records First one is for the root domain so I left the namespace blank. Record Type : A Routes Traffic to IPv4 and some AWS resources Alias: On Route traffic to Alias to S3 webstie end point. Region: Same as bucket region S3 endpoint (it automatically suggests to choose and it tells me that it's the exact bucket I want. So I select that).
I do the same for other bucket the only difference is that I add www for the namespace.
The tests working fine...
And from now on I am lost because I did everything according to documentation and everything seems like configured well. But when I go to my link, it doesn't show my webpage.
Upvotes: 1
Views: 945
Reputation: 269284
To use a custom domain with an Amazon S3 bucket, you will need to configure the domain (on Google Domains) to use the Route 53 nameservers. This will allow Amazon Route 53 to resolve names within that domain.
Note that any DNS configuration on Google Domains, such as CNAME, A and MX records, will no longer be used. You would need to configure them on Amazon Route 53.
For step-by-step instructions, How To: Connecting Google Domains to Amazon S3 | by Michelle | Medium
Upvotes: 2