By using AWS re:Post, you agree to the Terms of Use

How can I use the same domain name in different AWS accounts?

0

I want to use the same domain name in different AWS account. The domain is hosted by AWS.
I have two accounts: Account A and Account B. In Account A, I have created a certificate with AWS Certificate Manager to have a custom domain name like example.com. What I want to achieve is using the same domain name in Account B. In order to do that I have created a new certificate with the same domain name in Account B and then in Route53 I have created a new hosted zone with the same domain name. The certificate is issued via email validation for Account B. I have created a S3 static website hosting and created CloudFront distribution with this domain name in Account B. I have followed all the steps to create static website hosting from this url: https://aws.amazon.com/premiumsupport/knowledge-center/cloudfront-serve-static-website/ When I call the link example.com instead of navigating to the static website it gives the following error: example.com’s server IP address could not be found. ERR_NAME_NOT_RESOLVED

My question is what should I do to use the same domain name in different AWS accounts.

2 Answers
0

I have come up with a solution. It seems that the record set in Account B does not work and requests the address to hosted zone in Account A so creating the record set in Account A and using the CNAME of the distribution in Account B is the solution. The request goes to the record set in Account A and then it routes to the distribution in Account B.

The below link has the diagram presents the solution:
https://i.stack.imgur.com/1e8Pv.png

answered 3 years ago
0

I also ran into this and a "cleaner" option seems to be with using delegating responsibility for a subdomain to a hosted zone

https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-routing-traffic-for-subdomains.html

answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions