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 can silently overwrite existing record #20659

Open
ruanda opened this issue Dec 11, 2024 · 1 comment
Open

google_dns_record_set can silently overwrite existing record #20659

ruanda opened this issue Dec 11, 2024 · 1 comment
Labels

Comments

@ruanda
Copy link

ruanda commented Dec 11, 2024

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.
  • Please do not leave +1 or me too comments, they generate extra noise for issue followers and do not help prioritize the request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.
  • If an issue is assigned to a user, that user is claiming responsibility for the issue.
  • Customers working with a Google Technical Account Manager or Customer Engineer can ask them to reach out internally to expedite investigation and resolution of this issue.

Terraform Version & Provider Version(s)

Terraform v1.10.1
on linux_amd64

  • provider registry.terraform.io/hashicorp/google v6.13.0
  • provider registry.terraform.io/hashicorp/google-beta v6.13.0

Affected Resource(s)

google_dns_record_set

Terraform Configuration

resource "google_dns_record_set" "a" {
  name         = "backend.${google_dns_managed_zone.prod.dns_name}"
  managed_zone = google_dns_managed_zone.prod.name
  type         = "A"
  ttl          = 300

  rrdatas = ["8.8.8.8"]
}

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

Debug Output

No response

Expected Behavior

If the record already exists the resource creation should fail.

Actual Behavior

If the record already exists the resource overwrite it.

Steps to reproduce

  1. terraform apply

Important Factoids

This is documented behavior. This is similar to 10661. Unfortunately there is no way to detect this situation if DNS records are managed across many terraform workspaces. There should be either attribute which modifies authoritativeness of the resource or secondary resource type which is non-authoritative (just like there are iam_member and iam_binding types).

References

#10661

@ruanda ruanda added the bug label Dec 11, 2024
@github-actions github-actions bot added forward/review In review; remove label to forward service/cloud-dns labels Dec 11, 2024
@c2thorn
Copy link
Collaborator

c2thorn commented Dec 12, 2024

Changing this to a feature request as it is a request to add options to control the authoratative behavior in google_dns_record_set creation

@c2thorn c2thorn added feature-request forward/review In review; remove label to forward and removed bug forward/review In review; remove label to forward labels Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants