pagerduty_event_orchestration_global

A Global Orchestration allows you to create a set of Event Rules. The Global Orchestration evaluates Events sent to it against each of its rules, beginning with the rules in the "start" set. When a matching rule is found, it can modify and enhance the event and can route the event to another set of rules within this Global Orchestration for further processing.

Example of configuring a Global Orchestration

This example shows creating Team, and Event Orchestration resources followed by creating a Global Orchestration to handle Events sent to that Event Orchestration.

This example also shows using priority data source to configure priority action for a rule. If the Event matches the third rule in set "step-two" the resulting incident will have the Priority P1.

This example shows a Global Orchestration that has nested sets: a rule in the "start" set has a route_to action pointing at the "step-two" set.

The catch_all actions will be applied if an Event reaches the end of any set without matching any rules in that set. In this example the catch_all doesn't have any actions so it'll leave events as-is.

resource "pagerduty_team" "database_team" {
  name = "Database Team"
}

resource "pagerduty_event_orchestration" "event_orchestration" {
  name = "Example Orchestration"
  team = pagerduty_team.database_team.id
}

data "pagerduty_priority" "p1" {
  name = "P1"
}

resource "pagerduty_event_orchestration_global" "global" {
  event_orchestration = pagerduty_event_orchestration.event_orchestration.id
  set {
    id = "start"
    rule {
      label = "Always annotate a note to all events"
      actions {
        annotate = "This incident was created by the Database Team via a Global Orchestration"
        # Id of the next set
        route_to = "step-two"
      }
    }
  }
  set {
    id = "step-two"
    rule {
      label = "Drop events that are marked as no-op"
      condition {
        expression = "event.summary matches 'no-op'"
      }
      actions {
        drop_event = true
      }
    }
    rule {
      label = "If there's something wrong on the replica, then mark the alert as a warning"
      condition {
        expression = "event.custom_details.hostname matches part 'replica'"
      }
      actions {
        severity = "warning"
      }
    }
    rule {
      label = "Otherwise, set the incident to P1 and run a diagnostic"
      actions {
        priority = data.pagerduty_priority.p1.id
        automation_action {
          name = "db-diagnostic"
          url = "https://example.com/run-diagnostic"
          auto_send = true
        }
      }
    }
  }
  catch_all {
    actions { }
  }
}

Argument Reference

The following arguments are supported:

Set (set) supports the following:

Rule (rule) supports the following:

Condition (condition) supports the following:

Actions (actions) supports the following:

Catch All (catch_all) supports the following:

Attributes Reference

The following attributes are exported:

Import

Global Orchestration can be imported using the id of the Event Orchestration, e.g.

$ terraform import pagerduty_event_orchestration_global.global 1b49abe7-26db-4439-a715-c6d883acfb3e