terraform-provider-opsgenie icon indicating copy to clipboard operation
terraform-provider-opsgenie copied to clipboard

opsgenie_escalation should support recipient of type team with name

Open 3h4x opened this issue 4 years ago • 0 comments

Hey, when I add:

    recipient {
      type = "team"
      name = "${each.value}-${var.opsgenie_escalation_name}"
    }

I get error:

Error: Unsupported argument

  on escalation.tf line 63, in resource "opsgenie_escalation" "this":
  63:       name = "${each.value}-${var.opsgenie_escalation_name}"

An argument named "name" is not expected here.

This is due to not supporting anything other than id in provider code https://github.com/terraform-providers/terraform-provider-opsgenie/blob/d4833d9233afe965e23cc743cc51c6b22c3ef458/opsgenie/data_source_opsgenie_escalation.go#L40-L56

Yet, opsgenie API supports it

If recipient type is schedule or team, you can use name or id fields for referring to notified. Otherwise (type is user), we use username or id for referencing

https://docs.opsgenie.com/docs/escalation-api#section-escalation-rules-fields

3h4x avatar Jul 24 '20 17:07 3h4x