Skip to content

Commit

Permalink
Add a dynamic router rule example
Browse files Browse the repository at this point in the history
  • Loading branch information
metavida committed Jun 24, 2024
1 parent 0b765f7 commit 5d47a13
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion website/docs/r/event_orchestration_router.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ An Orchestration Router allows users to create a set of Event Rules. The Router

## Example of configuring Router rules for an Orchestration

In this example the user has defined the Router with two rules, each routing to a different service.
In this example the user has defined the Router with three rules. The first rule configures a dynamic route: any event containing a value in its `pd_service_id` custom detail will be routed to the Service with the ID specified by that value. The other rules route events matching a condition to specific services.

```hcl
data "pagerduty_service" "database" {
Expand All @@ -27,6 +27,16 @@ resource "pagerduty_event_orchestration_router" "router" {
event_orchestration = pagerduty_event_orchestration.my_monitor.id
set {
id = "start"
rule {
label = "Dynamically route events related to specific PagerDuty services"
actions {
dynamic_route_to = {
lookup_by = "service_id"
source = "event.custom_details.pd_service_id"
regexp = "(.*)"
}
}
}
rule {
label = "Events relating to our relational database"
condition {
Expand Down

0 comments on commit 5d47a13

Please sign in to comment.