PagerDuty / terraform-provider-pagerduty

Terraform PagerDuty provider
https://www.terraform.io/docs/providers/pagerduty/
Mozilla Public License 2.0
206 stars 210 forks source link

After downgrading account, cannot remove teams from pagerduty_escalation_policy #927

Open one000mph opened 1 month ago

one000mph commented 1 month ago

Terraform Version

Terraform v1.5.7 on darwin_arm64

Affected Resource(s)

Terraform Configuration Files

resource "pagerduty_escalation_policy" "escalationpolicy" {
  name      = "${var.escalation_policy_name} escalation policy"
  num_loops = 2

  dynamic "rule" {
    for_each = data.pagerduty_user.user
    content {
      escalation_delay_in_minutes = 10
      target {
        type = "user_reference"
        id   = rule.value.id
      }
    }
  }
}

Debug Output

https://gist.github.com/one000mph/a06e271776274c53080146464f4ce7fa

Panic Output

N/A

Expected Behavior

What should have happened? Teams should be removed from escalation policies

Actual Behavior

What actually happened? Teams are still associated with my escalation policy behind-the-scenes. I am also unable to remove teams from my escalation policies via the API. A GET request tohttps://api.pagerduty.com/escalation_policies still shows teams associated although they are not visible or editable in any way I can find.

Steps to Reproduce

  1. terraform apply with teams = []
  2. The apply is successful, however when terraform plan runs again it retrieves the same Escalation Policy object from pagerduty via API and removing the teams again shows up as a change to apply.
  3. Infinite loop of doom

Important Factoids

N/A I assume this affects any team that used to have a >Business plan and then chose to downgrade.

References

Are there any other GitHub issues (open or closed) or Pull Requests that should be linked here? For example: