terraform-provider-logicmonitor icon indicating copy to clipboard operation
terraform-provider-logicmonitor copied to clipboard

Provider can not handle change in order of custom properties

Open GoumJer opened this issue 2 years ago • 2 comments

since the last update of the Logicmonitor provider in Terraform we're struggling with a sorting isse.

In LogicMonitor the properties of a device are a name-value pair, and they are presented alfabetically by name. Also in API requests the result is alphabetical. So far nothing fancy.

But... We build our Cloud devices using a module. Calling the module we provide some LogicMonitor properties specially for this device, and a lot more are provided in the module itself.

In the module this looks like this: `

custom_properties = concat([
    {
      name  = "host_fqdn"
      value = "${var.name}.${var.dns_domain}"
    },
    {
      name  = "ocid"
      value = oci_core_instance.server.id
    },
    {
      name  = "private_ip"
      value = oci_core_instance.server.private_ip
    },
    {
      name  = "snmp.version"
      value = "v2c"
    }
  ],
  var.logicmonitor_properties)

where var.logicmonitor_properties contains more properties specific for this device/

The first 4 properties are from the module and combined with anyting what is in var.logicmonitor_properties. On the creation of the device in LogicMonitor all properties are set in the order the are and no problem.

The issue arises when there is any update on a terraform file in this environment. Due to the fact the properties are presented in alphabetical order, Terraform is showing a lot of changes if finds (but which are in fact just a mixed due to sorting).

GoumJer avatar Nov 11 '22 14:11 GoumJer