logicmonitor / terraform-provider-logicmonitor

Terraform LogicMonitor provider.
https://registry.terraform.io
Mozilla Public License 2.0
24 stars 16 forks source link

Drift when working with alert rules #92

Open alejandro-gallardo-ntt opened 4 months ago

alejandro-gallardo-ntt commented 4 months ago

When using the logicmonitor_alert_rule resource, Terraform plan randomly detects changes in the escalating_chain field for some alert rules. This field is managed by the provider itself and not customizable: https://registry.terraform.io/providers/logicmonitor/logicmonitor/latest/docs/resources/alert_rule

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:

  # module.lminstance_rules["AR - Azure - Error"].logicmonitor_alert_rule.main will be updated in-place
  ~ resource "logicmonitor_alert_rule" "main" {
      + escalating_chain       = (known after apply)
        id                     = "19"
        name                   = "AR - Azure - Error"
        # (11 unchanged attributes hidden)
    }

  # module.lminstance_rules["AR - Website"].logicmonitor_alert_rule.main will be updated in-place
  ~ resource "logicmonitor_alert_rule" "main" {
      + escalating_chain       = (known after apply)
        id                     = "25"
        name                   = "AR - Website"
        # (11 unchanged attributes hidden)
    }

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

The changes detection could happen for different rules in every execution. I have noticed in the tfstate files that the affected alert rules have the field "escalating_chain": null.

If I apply the changes, Logic Monitor audit logs show an update action for that rule.

Also mention all alert rules are imported resources.

Thanks,