Skip to content

cloudflare_zone_dns_settings SOA block never becomes stable #5859

@fholzer

Description

@fholzer

Confirmation

  • This is a bug with an existing resource and is not a feature request or enhancement. Feature requests should be submitted with Cloudflare Support or your account team.
  • I have searched the issue tracker and my issue isn't already found.
  • I have replicated my issue using the latest version of the provider and it is still present.

Terraform and Cloudflare provider version

We have a use-case for overriding min_ttl in the soa block of a cloudflare_zone_dns_settings resource. Before making this change we checked the REST API for current settings. There we saw that the mname property is null. In terraform the mname is required and of type string, so the next best thing we can do is setting it to an empty string. Having applied that, further plan/apply invocations always result in a diff:

~ resource "cloudflare_zone_dns_settings" "cf_dns_settings" {
    - internal_dns        = {} -> null
    ~ soa                 = {
        + mname   = ""
          # (6 unchanged attributes hidden)
      }
      # (8 unchanged attributes hidden)
  }

Versions used:

Terraform v1.12.2
+ provider registry.terraform.io/cloudflare/cloudflare v5.8.2

Affected resource(s)

  • cloudflare_zone_dns_settings

Terraform configuration files

resource "cloudflare_zone_dns_settings" "cf_dns_settings" {
  zone_id = cloudflare_zone.cf_zone.id

  nameservers = {
    type = "cloudflare.standard"
  }
  foundation_dns      = false
  multi_provider      = false
  secondary_overrides = false

  soa = {
    mname   = ""
    rname   = "dns.cloudflare.com"
    refresh = 10000
    retry   = 2400
    expire  = 604800
    ttl     = 3600
    min_ttl = 60
  }

  internal_dns = {
  }

  ns_ttl             = 86400
  zone_mode          = "standard"
  flatten_all_cnames = false
}

Link to debug output

https://gist.github.com/fholzer/f49296bce9f1afbb1234a9e24ad18fed

Panic output

No response

Expected output

Expected cloudflare_zone_dns_settings.cf_dns_settings to be unchanged from previous terraform apply execution.

Actual output

~ resource "cloudflare_zone_dns_settings" "cf_dns_settings" {
    - internal_dns        = {} -> null
    ~ soa                 = {
        + mname   = ""
          # (6 unchanged attributes hidden)
      }
      # (8 unchanged attributes hidden)
  }

Steps to reproduce

  1. apply changes mentioned earlier once, observe state is updated accordingly
  2. run plan again, without any changes to terraform files
  3. observe terraform plan mentioned change to mname

Additional factoids

No response

References

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.version/5Categorizes issue or PR as related to version 5 of the provider.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions