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 ?
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.
Route 53
and go to Domains
-> Registered domain
(I bought domain in AWS)Actions
dropdown and Edit name server
optionNS record
and add all prod nameservers as ValueHope that helps.