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

1

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.

已提問 5 年前檢視次數 3591 次
2 個答案
1

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

HarinS
已回答 3 年前
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

已回答 5 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南