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년 전3590회 조회
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년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠