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.

gefragt vor 5 Jahren3590 Aufrufe
2 Antworten
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
beantwortet vor 3 Jahren
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

beantwortet vor 5 Jahren

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen