thousandeyes / terraform-provider-thousandeyes

ThousandEyes Terraform Provider
Apache License 2.0
21 stars 26 forks source link

[Bug]: Removing an integration from an alert does not work #166

Open stevedes77 opened 4 months ago

stevedes77 commented 4 months ago

What versions are you using?

Terraform 1.5.1, provider registry.terraform.io/thousandeyes/thousandeyes v2.0.8

What did you expect to happen?

Plan should have shown the removal of the pagerduty integration from the alert rule

What actually happened?

Plan shows "no changes"

Terraform code to reproduce the bug

data "thousandeyes_integration" "test_pd_service_integration" {
  integration_name = "test-pd-service"
}

resource "thousandeyes_alert_rule" "test_rule" {
  rule_name  = "TEST ALERT RULE"
  alert_type = "HTTP Server"

  expression = "((errorType != \"None\"))" # Error Type is ANY

  minimum_sources = 1

  rounds_violating_required = 1
  rounds_violating_out_of   = 1

  notifications {
    dynamic "third_party" {
      for_each = [data.thousandeyes_integration.test_pd_service_integration]
      content {
        integration_id = third_party.value.integration_id
        integration_type = third_party.value.integration_type
      }
    }
  }
}

Any additional comments or code?

No response

Steps to reproduce the bug

After running apply on the above code, change the foreach block to

for_each = []

to simulate the removal of the integration (e.g. if it is inside a module and the integration list is a var on the module)

the terraform plan will show No changes. Your infrastructure matches the configuration. instead of showing the desired removal.