terraform-provider-vultr
terraform-provider-vultr copied to clipboard
[BUG] - TXT vultr_dns_record entries are modified on every plan/apply
Describe the bug
When managing a vultr_dns_record of type TXT, running plan always indicates that the resource will be modified. My state is clean and the resource exists in vultr.
To Reproduce Terraform:
resource "vultr_dns_record" "spf" {
domain = data.vultr_dns_domain.root_domain.id
type = "TXT"
name = ""
ttl = 86400
data = "v=spf1 mx -all"
}
No-op planned update: The data is indicating a change will be made, even if I apply it and then re-run plan.
# vultr_dns_record.spf will be updated in-place
~ resource "vultr_dns_record" "spf" {
~ data = "\"v=spf1 mx -all\"" -> "v=spf1 mx -all"
id = "f20ae138-4023-4af4-9a56-36dd530d6a5a"
# (4 unchanged attributes hidden)
}
Expected behavior I would expect that once the above TF is applied, a subsequent update would result in an empty plan (no resources to change)
Desktop (please complete the following information where applicable:
- TF Cloud
- TF Version: 1.0.3
@mkeen to prevent the drift from happening for now is to do data = "\"v=spf1 mx -all\""
We'll take a look at the API + Terraform to see if we can resolve this
Hey @mkeen
This is current API behavior where the TXT record needs to be enclosed in quotes. So the API is doing this for you which is why you are seeing the drift.
We are exploring some options to clean this up and make it a better experience.
Thanks for the replies @ddymko. The suggested workaround is good 👍