PagerDuty / terraform-provider-pagerduty

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

Can't change `severity` via `extraction` for an orchestration service #703

Open AkiraJ48 opened 1 year ago

AkiraJ48 commented 1 year ago

Description

I'm attempting to change the severity field via an extraction action for an event_orchestration_service.

Affected Resource(s)

Please list the resources as a list, for example:

Expected Behavior

I should be able to change the severity as documented in https://registry.terraform.io/providers/PagerDuty/pagerduty/latest/docs/resources/event_orchestration_service. It says that I can "Replace any CEF field" when using extraction.

Actual Behavior

I can change the severity in an event via extraction.

Steps to Reproduce

  1. Attempt to change the severity via extraction for an event_orchestration_service
metavida commented 1 year ago

Acknowledged that the current wording in the documentation is misleading since severity is indeed a PD-CEF field.

The solution you can use today is to use the severity action to update an Alert's severity instead of the extraction action.

resource "pagerduty_event_orchestration_service" "www" {
  service = pagerduty_service.example.id
  enable_event_orchestration_for_service = true
  set {
    id = "start"
    rule {
      label = "Decrease severity of staging events"
      condition {
        expression = "event.summary matches part 'staging'"
      }
      actions {
+        severity = "info"
-        extraction {
-          template = "info"
-          target = "event.severity"
-        }
      }
    }
  }
  catch_all {
    actions { }
  }
}

In the long run we've got a bug logged to improve behavior for cases where customers use an extraction to set the the severity field.