hashicorp / terraform-provider-google

Terraform Provider for Google Cloud Platform
https://registry.terraform.io/providers/hashicorp/google/latest/docs
Mozilla Public License 2.0
2.33k stars 1.73k forks source link

google_dns_record_set NS create fails on apex #836

Closed matti closed 6 years ago

matti commented 6 years ago

with

resource "google_dns_managed_zone" "apex" {
  name     = "mydomain-com"
  dns_name = "mydomain.com."
}

resource "google_dns_managed_zone" "sub" {
  name     = "sub-mydomain-com"
  dns_name = "sub.mydomain.com."
}

resource "google_dns_record_set" "apex_sub_ns" {
  name = "sub.mydomain.com."
  type = "NS"
  ttl  = 300

  managed_zone = "${google_dns_managed_zone.apex.name}"

  rrdatas = ["${google_dns_managed_zone.sub.name_servers}"]
}

I get

* google_dns_record_set.apex_sub_ns: Error creating DNS RecordSet: googleapi: Error 400: The resource record set 'entity.change.deletions[0]' is invalid because a zone must contain exactly one resource record set of type 'NS' at the apex., invalidZoneApex

but if I change the "NS" type to "TXT", apply and then change it back to "NS" it works.

rosbo commented 6 years ago

Hi Matti,

@paddycarver fixed this bug in #807.

The next release will include a fix for this bug.

Thanks.

paddycarver commented 6 years ago

That release just went out! terraform init -upgrade should fix this. If it doesn't, feel free to reply to this issue and we can take a look.

ghost commented 4 years ago

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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!