1
votes

Does domain name needs to match with s3 bucket for static website hosting? Can i map my domain xyz.com to the bucket abc.com.s3-websits.us-east-1.amazonaws.com by creating an alias record? Or bucket name must be xyz.com.s3-websits.us-east-1.amazonaws.com?

1
I think, If we use S3 without cloudfront it's the requirement and If we are using cloudfront its not required.implosivesilence

1 Answers

1
votes

Yes, the Bucket Name MUST match Domain Name, see pictures below.

Ref: https://docs.aws.amazon.com/AmazonS3/latest/dev/website-hosting-custom-domain-walkthrough.html

These bucket names must exactly match your domain name.

For example, I have AppointmentsBook.net domain and also as a bucket name.

Bucket:

enter image description here

Route53 with ALIAS pointing to the Bucket:

enter image description here

I also recommend buying the domain via AWS in my case (AppointmentsBook.net) as its painful transferring one across from another domain name provider. AWS use GoDaddy behind the scenes. I also recommend people reserve their Name as a bucket as bucket names are globally unique.