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

TXT records always require re-creation v 2.0.0-rc1 #40

Open
wiggly opened this issue Aug 1, 2020 · 7 comments
Open

TXT records always require re-creation v 2.0.0-rc1 #40

wiggly opened this issue Aug 1, 2020 · 7 comments

Comments

@wiggly
Copy link

wiggly commented Aug 1, 2020

Creating a TXT record works but attempting to plan immediately afterwards indicates that changes are required.

This appears to be due to quote-handling.

Example output after having already created the record successfully;

  # gandi_livedns_record.test_txt_menutia_io will be updated in-place
  ~ resource "gandi_livedns_record" "test_txt_menutia_io" {
        id     = "menutia.io/test001/TXT"
        name   = "test001"
        ttl    = 3600
        type   = "TXT"
      ~ values = [
          - "\"this is a test\"",
          + "this is a test",
        ]
        zone   = "menutia.io"
    }
@wiggly
Copy link
Author

wiggly commented Aug 1, 2020

I have since realised that you can add embedded quotes for this but I find it a bit unintuitive that this is required seeing as the record is obviously meant to accept text content.

@scottmuc
Copy link

scottmuc commented Aug 2, 2020

I can confirm I have the same issue with TXT records.

@fgm
Copy link

fgm commented Jul 10, 2021

Similar case. Also similar to #2.

  ~ resource "gandi_livedns_record" "txt" {
        id     = "example.com/@/TXT"
        name   = "@"
      ~ values = [
          + "\"facebook-domain-verification=whateverfb\"",
          + "\"google-site-verification=whatevergoogle\"",
          - "facebook-domain-verification=whateverfb",
          - "google-site-verification=whatevergoogle,
        ]
        # (3 unchanged attributes hidden)
    }

In addition, with terraform 1.0.2, it adds a warning on the plan operation like this:

Unless you have made equivalent changes to your configuration, or ignored the relevant attributes using ignore_changes, the following plan may include actions to undo or respond to these changes.

The warning is worrying. When checking the zone on Gandi, however after the apply step succeeds, the zone entries appear normal:


@ 1800 IN TXT "facebook-domain-verification=whateverfb"
@ 1800 IN TXT "google-site-verification=whatevergoogle"

If there is no envisioned solution, as the existence of the problem since #2 suggests, maybe the docs could add a note not to worry about these ?

@fgm
Copy link

fgm commented Aug 11, 2021

Actually, I noticed that using the following format, there is no longer an issue with TF 1.0.4 and the latest Gandi provider:

resource "gandi_livedns_record" "txt" {
  zone   = data.gandi_domain.domain.id
  name   = "@"
  type   = "TXT"
  ttl    = module.defaults.ttl_txt
  values = [
    "\"facebook-domain-verification=fbvalue\"",
    "\"google-site-verification=googlevalue\"",
    "\"keybase-site-verification=keybasevalue"",
  ]
}

@robbyoconnor
Copy link
Contributor

I assume this is no longer an issue?

@scottmuc
Copy link

scottmuc commented Jan 3, 2022

@robbyoconnor I'm due for a TF and Gandi provider upgrade. If/when I do that, I'll post my results.

@vincentbernat
Copy link
Member

I have ran into this issue too. As long as you quote the values, this is not an issue. I suppose this could be fixed more gracefully by normalizing a bit. This would fix #41 too. For me, it works good enough and I won't propose a fix myself.

scottmuc added a commit to scottmuc/infrastructure that referenced this issue Feb 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants