terraform-routeros / terraform-provider-routeros

Terraform Provider for Mikrotik RouterOS
Mozilla Public License 2.0
191 stars 55 forks source link

resource "routeros_ip_dns_record" keeps updating #445

Closed tofkamp closed 4 months ago

tofkamp commented 4 months ago

Describe the bug I have 26 static DNS entries in my TF-file. But tofu/terraform keeps thinking it has to update this, but the file did not change, nor anything else.

To Reproduce Add the following to a TF file, and run twice "tofu apply"

resource "routeros_ip_dns_record" "srv9" {
  name    = "_kpasswd._udp.home.arpa"
  srv_port = "464"
  srv_priority = "0"
  srv_weight  = "100"
  srv_target  = "w2022.home.arpa"
  type    = "SRV"
  ttl    = "600"
}

Expected behavior Just create the static DNS entry, and do nothing more.

Stack Trace Executing a "tofu apply" I get this:

  # routeros_ip_dns_record.srv9 will be updated in-place
  ~ resource "routeros_ip_dns_record" "srv9" {
        id           = "*18"
        name         = "_kpasswd._udp.home.arpa"
      ~ ttl          = "10m" -> "600"
        # (7 unchanged attributes hidden)
    }

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

The ttl keeps saying it is changed, but if I look in winbox, the ttl is not changed. image If I do a "/ip/dns/static/print" all seems ok. No other ttl than what I specify.

tofkamp commented 4 months ago

Now I see the problem. Miktorik returns human readable output, and I specify the computer representation in seconds. To a human, it is equal but not to a computer.

vaerh commented 4 months ago

:tada: This issue has been resolved in version 1.48.1 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: