opsgenie / terraform-provider-opsgenie

Terraform OpsGenie provider
https://registry.terraform.io/providers/opsgenie/opsgenie/latest/docs
Mozilla Public License 2.0
100 stars 135 forks source link

Removing a 'repeat' in opsgenie_escalation does not apply correctly #431

Open kstevensonnv opened 4 months ago

kstevensonnv commented 4 months ago

Terraform Version

Terraform v1.7.4
on darwin_arm64
+ provider registry.terraform.io/opsgenie/opsgenie v0.6.35

Affected Resource(s)

Terraform Configuration Files

resource "opsgenie_team" "this" {
  name                     = "Test Team Terraform"
  ignore_members           = true
  delete_default_resources = true
}

resource "opsgenie_schedule" "this" {
  name          = "Test Team Terraform Schedule"
  owner_team_id = opsgenie_team.this.id
}

resource "opsgenie_escalation" "this" {
  name          = "Test Team Terraform Escalation"
  owner_team_id = opsgenie_team.this.id

  rules {
    condition   = "if-not-acked"
    notify_type = "default"
    delay       = 1

    recipient {
      type = "schedule"
      id   = opsgenie_schedule.this.id
    }
  }

  repeat {
    wait_interval          = 1
    count                  = 3
    reset_recipient_states = false
    close_alert_after_all  = false
  }
}

Expected Behavior

After removing the repeat block and doing an apply, the repeat is removed from the escalation.

Actual Behavior

The apply succeeds but when checking the escalation policy in the Opsgenie webui it still has the repeat. Running another apply shows the same change again.

Steps to Reproduce

  1. Create an escalation policy with a repeat block
  2. Apply
  3. Remove the repeat block from the escalation policy
  4. Apply
  5. Review the escalation policy in the Opsgenie webui, it still has the repeat
  6. Apply
  7. The plan shows the same change