terraform-provider-ovh icon indicating copy to clipboard operation
terraform-provider-ovh copied to clipboard

Cannot create dns record of type NS

Open Ovski4 opened this issue 5 years ago • 2 comments

Hello,

I'm tying to create NS records with terraform using the ovh_domain_zone_record resource but it seems the NS fieldtype is not supported.

Here is an example where I want to delegate a subdomain to route53, and therefore need to add 4 NS entries in OVH.

resource "aws_route53_zone" "external" {
  name = "delegated.mydomain.ovh"
}

resource "ovh_domain_zone_record" "ns_records" {
    count = "${length(aws_route53_zone.external.name_servers)}"
    subdomain = ""
    zone = "delegated.mydomain.ovh"
    fieldtype = "NS"
    ttl = "0"
    target = "${aws_route53_zone.external.name_servers[count.index]}"
}

I got the following errors:

Error: Error applying plan:

4 error(s) occurred:

* module.delegated_subdomain.ovh_domain_zone_record.ns_records[0]: 1 error(s) occurred:

* ovh_domain_zone_record.ns_records.0: Failed to create OVH Record: Error 404: "This service does not exist"
* module.delegated_subdomain.ovh_domain_zone_record.ns_records[2]: 1 error(s) occurred:

* ovh_domain_zone_record.ns_records.2: Failed to create OVH Record: Error 404: "This service does not exist"
* module.delegated_subdomain.ovh_domain_zone_record.ns_records[3]: 1 error(s) occurred:

* ovh_domain_zone_record.ns_records.3: Failed to create OVH Record: Error 404: "This service does not exist"
* module.delegated_subdomain.ovh_domain_zone_record.ns_records[1]: 1 error(s) occurred:

* ovh_domain_zone_record.ns_records.1: Failed to create OVH Record: Error 404: "This service does not exist"

Thank you for your help

Ovski4 avatar Jan 15 '19 10:01 Ovski4

Are we going to get any update on this?

Quintasan avatar Aug 25 '20 21:08 Quintasan

One year later, ping. @radeksimko would it be possible to shed some light on this?

Quintasan avatar Oct 08 '21 16:10 Quintasan

Hello @Quintasan

Sorry for long time since your issue.

Have you tested with :

resource "ovh_domain_zone_record" "ns_records" {
    count = "${length(aws_route53_zone.external.name_servers)}"
    subdomain = "delegated"
    zone = "mydomain.ovh"
    fieldtype = "NS"
    ttl = "0"
    target = "${aws_route53_zone.external.name_servers[count.index]}"
}

It should work. If it's not working, please share the output with a up-to-date Terraform provider version.

I'm closing this issue, feel free to re-open if it's not working.

Thanks Romain

rbeuque74 avatar Mar 19 '24 17:03 rbeuque74