incident-io / terraform-provider-incident

This project is the official terraform provider for incident.io.
https://registry.terraform.io/providers/incident-io/incident/latest
MIT License
9 stars 5 forks source link

Unable to use escalation_path of type notify_channel #113

Open whites11 opened 5 days ago

whites11 commented 5 days ago

I'm trying to do this

resource "incident_escalation_path" "db_integrations" {
  count = var.db_integrations.enabled ? 1 : 0
  name  = "DB integrations"

  path = [
    {
      id   = "urgencycheck"
      type = "if_else"
      if_else = {
        conditions = [
          ...
        ]
        then_path = [
         ...
        ],
        else_path = [
          {
            type = "notify_channel"
            notify_channel = {
              targets = [
                {
                  type    = "slack_channel"
                  id      = "C07F0CE6UUC" # db-integrations
                  urgency = "low"
                }
              ]
              time_to_ack_seconds = 300
            }
          }
        ]
      }
    }
  ]
  ...

but I get an error:

Error: Client Error

  with module.escalations.incident_escalation_path.db_integrations[0],
  on escalation_paths/db_integrations.tf line 1, in resource "incident_escalation_path" "db_integrations":
   1: resource "incident_escalation_path" "db_integrations" {

Unable to create escalation path, got error:
{"type":"validation_error","status":422,"request_id":"BxndnDok","errors":[{"code":"invalid_value","message":"Notify_channel
type requires a notify_channel
payload","source":{"field":"","pointer":"path.0.if_else.else_path.0.notify_channel"}}]}

this is because notify_channel is not a supported payload here: https://github.com/incident-io/terraform-provider-incident/blob/master/internal/provider/incident_escalation_path_resource.go#L444

abayta commented 17 hours ago

It seems this is not supported in Terraform, I also need this feature