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 always wants to update #5497

Closed
matti opened this issue Jan 26, 2020 · 12 comments
Closed

google_dns_record_set always wants to update #5497

matti opened this issue Jan 26, 2020 · 12 comments
Assignees
Labels

Comments

@matti
Copy link

matti commented Jan 26, 2020

like in #863

resource "google_dns_record_set" "google_dot__domainkey-lol-com-txt" {
  name = "google._domainkey.lol.com."

  managed_zone = google_dns_managed_zone.tld-1.name
  type         = "TXT"
  ttl          = 60

  rrdatas = [
    "v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCj8O8aDzmnPwJ8mzo6y8rLXq8r1i45fr3nTGElX9h6Nr3s8w5Ozu27ep5T08YC6Vo00WLPl5N+K91Fb1y/RHHQVfPMHvHD+IDcUiaBOe6RNVMv3AcR0S+pSwaE8KFsYbizdRjH8+qMUwyH9o3c18tNcpS6otCiwBMg1PqJ1i+EyQIDAQAB"
  ]
}
  # module.dns-1.google_dns_record_set.google_dot__domainkey-lol-com-txt will be updated in-place
  ~ resource "google_dns_record_set" "google_dot__domainkey-lol-com-txt" {
        id           = "lol-com-1-1/google._domainkey.lol.com./TXT"
        managed_zone = "lol-com-1-1"
        name         = "google._domainkey.lol.com."
        project      = "katti-makkara"
      ~ rrdatas      = [
          - "\"v=DKIM1;\" \"k=rsa;\" \"p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCj8O8aDzmnPwJ8mzo6y8rLXq8r1i45fr3nTGElX9h6Nr3s8w5Ozu27ep5T08YC6Vo00WLPl5N+K91Fb1y/RHHQVfPMHvHD+IDcUiaBOe6RNVMv3AcR0S+pSwaE8KFsYbizdRjH8+qMUwyH9o3c18tNcpS6otCiwBMg1PqJ1i+EyQIDAQAB\"",
          + "v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCj8O8aDzmnPwJ8mzo6y8rLXq8r1i45fr3nTGElX9h6Nr3s8w5Ozu27ep5T08YC6Vo00WLPl5N+K91Fb1y/RHHQVfPMHvHD+IDcUiaBOe6RNVMv3AcR0S+pSwaE8KFsYbizdRjH8+qMUwyH9o3c18tNcpS6otCiwBMg1PqJ1i+EyQIDAQAB",
        ]
        ttl          = 60
        type         = "TXT"
    }
@edwardmedia edwardmedia self-assigned this Jan 29, 2020
@edwardmedia
Copy link
Contributor

edwardmedia commented Jan 29, 2020

tf plan keeps showing

Plan: 0 to add, 1 to change, 0 to destroy.

@danawillow
Copy link
Contributor

@edwardmedia, when you reproed were you able to get DEBUG logs that you could share? It looks like it has to do with escaping the quotes but it would be good to know for sure whether it's the API doing it or something in our code.

@matti, thanks for the report! Next time, please fill out the bug template- it asks for information that make it easier to figure out what's going on on our side.

@matti
Copy link
Author

matti commented Jan 29, 2020

@danawillow Which particular piece of information did I leave out by not following the template? Honest question.

@danawillow
Copy link
Contributor

Debug logs and provider version

@danawillow
Copy link
Contributor

Oh and there's also some metadata in the template that helps our automation label issues so that our teammates don't have to hunt down issues without a label.

@matti
Copy link
Author

matti commented Jan 29, 2020

Okay, the template is missing information on how to get DEBUG logs - I have used terraform and google provider for 3 years and I have no idea what is DEBUG log

@danawillow
Copy link
Contributor

The template has the following block in the debug logs section:

To obtain the debug output, see the Terraform documentation on debugging.

If that documentation is confusing or could be improved, I'd recommend filing an issue against https://github.com/hashicorp/terraform so they can try to improve clarity there. Or if you'd just prefer that our bug template be phrased in a different way, you're welcome to propose a PR to change it (the source is at https://github.com/terraform-providers/terraform-provider-google/blob/master/.github/ISSUE_TEMPLATE/bug.md) or file an issue against us to do so (no issue template needed in that case)

@matti
Copy link
Author

matti commented Jan 29, 2020 via email

@danawillow
Copy link
Contributor

Hey @matti, aside from the perpetual diff, do the record sets actually get created correctly? Our documentation says:

For TXT record, if the string data contains spaces, add surrounding " if you don't want your string to get split on spaces.

which was added after #232, which implies the record might be invalid with the extra quotes. I don't know if that's the case with a record like your example or just SPF, do you know?

@andrew-s
Copy link

andrew-s commented Apr 4, 2020

I came here for the same issue on TXT records (DKIM/SPF, etc..) - the quotes worked but it seems like a really odd syntax, e.g.

value = ["\"v=spf1 include:_spf.google.com ~all\""]

I'm really unclear on the defaults here, this provider splits strings within a list into a further list (so a list of lists?)? Why would it do that by default? It makes no sense to me, I'd maybe suggest this default behaviour is changed as it's completely counterintuitive.

@ghost ghost removed the waiting-response label Apr 4, 2020
@danawillow
Copy link
Contributor

@andrew-s that requirement comes straight from the GCP documentation on record sets (https://cloud.google.com/dns/records/json-record). The provider is just passing along the strings exactly as they're sent.

I'm going to go ahead and close this issue for now since it's been open for a few months without a response, but feel free to comment or file a new issue if you encounter any other issues or questions.

@ghost
Copy link

ghost commented May 7, 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 👉 hashibot-feedback@hashicorp.com. Thanks!

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

No branches or pull requests

5 participants