tpretz / terraform-provider-zabbix

Terraform Zabbix Provider
MIT License
30 stars 27 forks source link

Zabbix 7.0 : should use new API host propery proxyid #42

Open yeswexav opened 3 weeks ago

yeswexav commented 3 weeks ago

The new zabbix LTS version is 7.0. The tpretz/zabbix provider seems to work fine with this new version.

The only annoying thing is that the provider always tries to set the proxyid to "0" (even if no proxy is used).

 # module.testvm.zabbix_host.vm will be updated in-place
  ~ resource "zabbix_host" "vm" {
        id             = "10639"
        name           = "testvm"
      + proxyid        = "0"

In fact, there has been a breaking change in the host API : _Renamed property proxy_hostid to proxyid._.

To reflect that change, the provider should use the new property here if zabbix version is >=7.0.

yeswexav commented 2 weeks ago

Fixed this by allowing the provider to use the correct property depending on the api version. See merge request in https://github.com/tpretz/go-zabbix-api/pull/9 Tested OK in both Zabbix 6.4 and 7.0. If anyone can confirm the fix.