Skip to content
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

Cannot Manage Google Cloud DNS NS Records #95

Closed
hashibot opened this issue Jun 13, 2017 · 2 comments
Closed

Cannot Manage Google Cloud DNS NS Records #95

hashibot opened this issue Jun 13, 2017 · 2 comments
Labels
bug forward/review In review; remove label to forward service/cloud-dns

Comments

@hashibot
Copy link

This issue was originally opened by @j0sh3rs as hashicorp/terraform#14796. It was migrated here as part of the provider split. The original body of the issue is below.


When Terraform creates a google_dns_managed_zone, the zone automatically gets created with NS records specific to Google Cloud (nameservers they provide that the zone will live on). Terraform does not import these NS records into state, so all future attempts to add or manipulate NS records in any Google Cloud Zone will fail, citing that the record set already exists:

* google_dns_record_set.clouddns_ns: Error creating DNS RecordSet: googleapi: Error 409: The resource 'entity.change.additions[0]' named 'domain.com. (NS)' already exists, alreadyExists

Terraform Version

$ terraform -v
Terraform v0.9.5

Affected Resource(s)

Please list the resources as a list, for example:

  • google_dns_managed_zone
  • google_dns_record_set

Terraform Configuration Files

resource "google_dns_managed_zone" "public" {
  name        = "domain-name"
  dns_name    = "domain.com."
  description = "domain.com"
}

resource "google_dns_record_set" "clouddns_ns" {
  count = "${var.type == "NS" ? 1 : 0}"
  name = "${var.name == "" ? format("%v.", var.domain) : format("%v.%v.",var.name,var.domain)}"
  type = "${var.type}"
  ttl  = "${var.ttl}"

  managed_zone = "${replace(var.domain, ".", "-")}"

  rrdatas = ["${formatlist("%v.", var.value)}"]
}

module "domain-com-NS" {
  source = "../../modules/pub_dns_record"
  domain = "domain.com"
  name   = ""
  type   = "NS"
  value  = ["ns1.example.com", "ns2.example.com"]
  ttl    = "172800"
}

Expected Behavior

Terraform should either automatically import the NS records into state for management, or provide some method for managing them

Actual Behavior

NS records are completely unmanageable and must be manually adjusted

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform apply

Important Factoids

This generally applies to all GCE zone sets, not just to ones Terraform creates

@danielcompton
Copy link
Contributor

It would also be useful to be able to import existing zones as resources I think?

luis-silva pushed a commit to luis-silva/terraform-provider-google that referenced this issue May 21, 2019
@ghost
Copy link

ghost commented Mar 30, 2020

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 👉 [email protected]. Thanks!

@ghost ghost locked and limited conversation to collaborators Mar 30, 2020
@github-actions github-actions bot added forward/review In review; remove label to forward service/cloud-dns labels Jan 14, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug forward/review In review; remove label to forward service/cloud-dns
Projects
None yet
Development

No branches or pull requests

3 participants