Skip to content

Add responders{type = "escalation"} in opsgenie_alert_policy #293

@janhorstmann

Description

@janhorstmann

Hi,
this is a feature request to support

  responders {
    type = "escalation"
}

in resource opsgenie_alert_policy.
Although the API documentation states that only user and team are possible values to the responders field, the web interface definitely allows setting an escalation. When doing so the terraform-provider-opsgenie correctly identifies the type = "escalation" as configuration drift:

Note: Objects have changed outside of Terraform

Terraform detected the following changes made outside of Terraform since the last "terraform apply":

  # opsgenie_alert_policy.test has changed
  ~ resource "opsgenie_alert_policy" "test" {
        id                         = SOME_ID
        name                       = "test alert policy"
        tags                       = []
        # (14 unchanged attributes hidden)


      ~ responders {
            id   = SOME_ID
          ~ type = "team" -> "escalation"
        }
        # (1 unchanged block hidden)
    }

Please add responders{type = "escalation"} in opsgenie_alert_policy.

Affected Resource(s)

  • opsgenie_alert_policy

Terraform Configuration Files

resource "opsgenie_alert_policy" "test" {
  name               = "example policy"
  team_id            = opsgenie_team.test.id
  policy_description = "This is sample policy"
  message            = "{{message}}"

  filter {}
  responders {
    type = "escalation"
    id = opsgenie_escalation.some_resource.id
  }
}

Output

Error: expected responders.0.type to be one of [user team], got escalation
│ 
│   with opsgenie_alert_policy.test,
│   on main.tf line 336, in resource "opsgenie_alert_policy" "test":
│  336:     type = "escalation"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions