I'm trying to set up a subdomain test.example.com
that is hosted on AWS. I have some assets hosted on DigitalOcean and some newer assets in AWS.
- My domain DNS is setup with DigitalOcean's 3 nameservers as NS records. (ie, I log into namecheap.com and set the "custom dns" to the 3 DigitalOcean nameservers)
- In DigitalOcean I created 4 NS records with test.example.com pointing to the 4 AWS Namespace servers
- In AWS I have a hosted zone. example.com. Under that I have A record for test.example.com that points to my API Gateway.
I know my AWS configuration is correct. If I go to my hosting company and change the NS records from DigitalOcean to AWS, test.example.com works just fine. What am I doing wrong here? I thought it was DNS propagation that was taking a while but I've waited about 50 hours now.
Update
Example.com is just an example. Not the real domain
My AWS resources are Terraform controlled. So I want the Route53 routing controlled by Terraform -- so if my API gateway or whatever changes, I don't need to adjust DNS. This is why I'm not going to DigitalOcean and setting up an A record for test.example.com to my AWS API Gateway.
So my thought with the NS records in DigitalOcean to AWS's NS servers -- test.example.com routes to DigitalOcean, the NS records point to AWS so DNS lookup is done in AWS, and is routed to test.example.com via my A record is Route53
I've tried changing the Hosted Zone in AWS to test.example.com with an A record to test.example.com but that setup didn't work either.