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

google_dns_record_set has no Resource.UpdateFunc #6129

Closed
billf opened this issue Apr 11, 2016 · 1 comment · Fixed by #6575
Closed

google_dns_record_set has no Resource.UpdateFunc #6129

billf opened this issue Apr 11, 2016 · 1 comment · Fixed by #6575

Comments

@billf
Copy link
Contributor

billf commented Apr 11, 2016

changes that are possible to make atomic cause recreation of a resource:

resource "google_dns_record_set" "cn-global-anycast-all" {
    managed_zone = "${var.dns-name}"
    name = "gcp.${var.dns-zone}"
    type = "A"
    ttl = 300
    rrdatas = ["${compact(split(",", terraform_remote_state.project.*.output.cn-global-anycast-addresses))}"]
}

even a simple re-order causes a record to be deleted and created:

-/+ google_dns_record_set.projectname
    managed_zone: "root-gcp-projectname" => "root-gcp-projectname"
    name:         "gcp.projectname.com." => "gcp.projectname.com."
    rrdatas.#:    "4" => "4"
    rrdatas.0:    "a.b.c.216" => "a.b.c.216"
    rrdatas.1:    "a.b.c.98"  => "a.b.c.98"
    rrdatas.2:    "a.b.c.136" => "a.b.c.143" (forces new resource)
    rrdatas.3:    "a.b.c.143" => "a.b.c.136" (forces new resource)
    ttl:          "300" => "300"
    type:         "A" => "A"

this change is not atomic and exposes a window during which a DNS record disappears.
this makes it unusable for anything besides create/destroy.

GCP API support for this exists:

// Change: An atomic update to a collection of ResourceRecordSets.
type Change struct {
    // Additions: Which ResourceRecordSets to add?
    Additions []*ResourceRecordSet `json:"additions,omitempty"`

    // Deletions: Which ResourceRecordSets to remove? Must match existing
    // data exactly.
    Deletions []*ResourceRecordSet `json:"deletions,omitempty"`
@ghost
Copy link

ghost commented Apr 23, 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 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.

@ghost ghost locked and limited conversation to collaborators Apr 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants