amazon-web-servicesdnsaws-route53

AWS domain setup in multiple organizations - handle prod environment separated from root


I have root account where I bought domain xy.com. My plan is to have dev, staging, prod environments, and each environment should be in separate AWS Organization.

Root as parent -> {dev, staging, prod} as children.

My problem is to setup valid NS record for prod enviroment.

I setup my dev environment well. It is on dev.xy.com. I created hosted zone on dev organization and copy NS records from dev hosted zone to Root hosted zone and it is working perfect. So all my records I can set in dev environment and they are separated.

I tried the same approach on prod environment. prod environment should serve xy.com domain. So I copy NS records from prod hosted zone and update NS records on Root hosted zone. And this setup is not working.

How can I serve xy.com from prod environment but not from Root ?


Solution

  • I managed to solve my problem.

    The only thing missing in my setup is to update NS on my Domain in my root account. Now root & production environment are sharing the same NS.

    Now all records should be added on prod environment since now it is "main" for xy.com domain.

    I will share the entire solution to make it easier for people to follow.

    1. Copy name server from production environment hosted zone details
    2. Switch back to root account
    3. In Go to Route 53 and go to Domains -> Registered domain (I bought domain in AWS)
    4. In Details section there is Actions dropdown and Edit name server option
    5. Replace root Nameservers with production NS and save
    6. Go to hosted zone for your domain and add new NS record and add all prod nameservers as Value

    Hope that helps.