vultr / terraform-provider-vultr

Terraform Vultr provider
https://www.terraform.io/docs/providers/vultr/
Mozilla Public License 2.0
191 stars 65 forks source link

[BUG] - DNS create record priority error #295

Open dR3b opened 1 year ago

dR3b commented 1 year ago

Describe the bug After creating a DNS (cname) record, Terraform displays a priority error:

resource "vultr_dns_domain" "blabla" {
  domain = "<DOMAIN>"
  ip     = "<IP>"
}

resource "vultr_dns_record" "blabla-alfa" {
  domain   = vultr_dns_domain.blabla.id
  data     = vultr_dns_domain.blabla.id
  name     = "alfa"
  type     = "CNAME"
  ttl      = 1800
}

Error:

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the
following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # vultr_dns_record.blabla-alfa will be updated in-place
  ~ resource "vultr_dns_record" "blabla-alfa" {
        id       = "752c46ac-b153-4c25-8276-45556eca9ea4"
        name     = "alfa"
      - priority = -1 -> null
        # (4 unchanged attributes hidden)
    }

Terraform:

Terraform v1.3.4
on linux_amd64

Plugin: Vultr:

vultr = {
  source  = "vultr/vultr"
  version = "2.11.4"
}
optik-aper commented 1 year ago

Thanks for the report. There's a default value set on the API controller which we'll need to account for in the provider I think. It seems like all DNS records have this value defaulting to -1 unless it's required (for MX and SRV records).