Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Route 53 for hosting different environments on multiple AWS accounts

I'm having real difficulty in getting the environments setup on 2 AWS accounts which are related to each other by the virtue of Organisation Hierarchy. My root DNS provider is GoDaddy which is hosting DNS record for example.com. We have multiple services which needs to be hosted on subdomain services.example.com. My setup is like:

  1. GoDaddy -> Root DNS provider for example.com. Has NS record entries for services.example.com pointing to AWS Prod Account's Hosted Zone
  2. AWS Prod Account -> Has Hosted Zone as services.example.com. Within this hosted zone I have A Records for production services service1.services.example.com, service2.services.example.com, etc.
  3. AWS Dev Account -> Need a way to host environments such as test, uat, release on Prod account subodmain as:

Service 1:

  • test.service1.services.example.com
  • uat.service1.services.example.com
  • release.service1.services.example.com

Service 2:

  • test.service2.services.example.com
  • uat.service2.services.example.com
  • release.service2.services.example.com

Is there any way that I can achieve this. I have attached an image for visually simplifying this setup. enter image description here

like image 629
kk. Avatar asked Sep 16 '25 03:09

kk.


1 Answers

Create a hosted zone for service1.services.example.com in Acc 2.

Note the 4 name servers that Route 53 assigns to it the new hosted zone.

Back in the services.example.com (master zone) on Acc 1, create a new resource record, with hostname service1 using record type NS, and enter the 4 name servers that Route 53 assigned, in the box below.

You just delegated the service1.services.example.com subdomain, and any hosts and subdomains in it, to a different hosted zone, which you can now break to your heart's content, without impacting the the other records.

And just can just repeat the same process for all other services you want to delegate as well. You will end up with a new hosted zone for each service, but that is a totally fine way of doing so.

The hosted zone for the subdomain can be in the same account or a different account.

like image 151
Tobias Lindberg Avatar answered Sep 17 '25 20:09

Tobias Lindberg