-
Notifications
You must be signed in to change notification settings - Fork 9.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
aws_route53_zone needs to enable insertion of NS record in parent zone. #305
Comments
@delitescere I spent some time working through this and have (tentatively) concluded that doing this automatically is not something we'd want to do from Terraform. Given an example like yours:
I would say the best thing for someone to do would be to create the NS record manually:
If we create it magically due to a parent reference, it won't show up the same way on the dependency graph and break some important assumptions Terraform makes. I agree this isn't a great UX, but I've updated the documentation in c21c766 to help people figure this out. |
Check out http://www.www.who.is/dns/sucuridns.com |
@pearkes in the example you added to the docs there is a Was that just accidentally included from the initial example in this ticket, or am I missing something? As far as I can tell there is still a missing link here in that the Route53 zone resource doesn't expose the create zone's nameservers as an output attribute, so there isn't enough information to create the necessary delegation record in the parent zone. It looks like there is a "nameservers" key in the Route53 API response that could be used to populate this. |
Looks like my final point in my earlier comment will be addressed by PR #1525. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
When creating a subdomain, it is not sufficient to merely create a hosted zone.
The list of nameservers in the NS record in the zone for the subdomain needs to be duplicated in an NS record for the subdomain in the parent zone to allow requests for the subdomain to be referred to the nameservers which hold the zone records for the subdomain's zone.
An example Terraform file follows the AWS Route53 API information.
dev.example.com's zone:
example.com's zone:
Example Terraform file:
Add a simple abstraction in the "aws_route53_zone" resource, which is an attribute to insert an NS record in the parent zone if the parent zone is managed by Route53. I have used the "parent_route53_zone" attribute in the example above. The AWS Provider simply adds the same NS record it added to the new zone to the parent zone. In this case, the commented-out "aws_route53_record" is not needed in the example above.
Additionally, the delegate set is exported by the "aws_route53_zone" resource to be usable by a Provisioner, most likely a command to add a NS record for the new zone to a parent zone which is not managed by Route53.
The text was updated successfully, but these errors were encountered: