PagerDuty v3.10.2, May 30 23
PagerDuty v3.10.2, May 30 23
pagerduty.EventOrchestrationRouter
Explore with Pulumi AI
An Orchestration Router allows users to create a set of Event Rules. The Router evaluates events sent to this Orchestration against each of its rules, one at a time, and routes the event to a specific Service based on the first rule that matches. If an event doesn’t match any rules, it’ll be sent to service specified in the catch_all
or to the “Unrouted” Orchestration if no service is specified.
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.
This example assumes services used in the route_to
configuration already exists. So it does not show creation of service resource.
import * as pulumi from "@pulumi/pulumi";
import * as pagerduty from "@pulumi/pagerduty";
const router = new pagerduty.EventOrchestrationRouter("router", {
eventOrchestration: pagerduty_event_orchestration.my_monitor.id,
set: {
id: "start",
rules: [
{
label: "Events relating to our relational database",
conditions: [
{
expression: "event.summary matches part 'database'",
},
{
expression: "event.source matches regex 'db[0-9]+-server'",
},
],
actions: {
routeTo: pagerduty_service.database.id,
},
},
{
conditions: [{
expression: "event.summary matches part 'www'",
}],
actions: {
routeTo: pagerduty_service.www.id,
},
},
],
},
catchAll: {
actions: {
routeTo: "unrouted",
},
},
});
import pulumi
import pulumi_pagerduty as pagerduty
router = pagerduty.EventOrchestrationRouter("router",
event_orchestration=pagerduty_event_orchestration["my_monitor"]["id"],
set=pagerduty.EventOrchestrationRouterSetArgs(
id="start",
rules=[
pagerduty.EventOrchestrationRouterSetRuleArgs(
label="Events relating to our relational database",
conditions=[
pagerduty.EventOrchestrationRouterSetRuleConditionArgs(
expression="event.summary matches part 'database'",
),
pagerduty.EventOrchestrationRouterSetRuleConditionArgs(
expression="event.source matches regex 'db[0-9]+-server'",
),
],
actions=pagerduty.EventOrchestrationRouterSetRuleActionsArgs(
route_to=%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference),
),
),
pagerduty.EventOrchestrationRouterSetRuleArgs(
conditions=[pagerduty.EventOrchestrationRouterSetRuleConditionArgs(
expression="event.summary matches part 'www'",
)],
actions=pagerduty.EventOrchestrationRouterSetRuleActionsArgs(
route_to=%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference),
),
),
],
),
catch_all=pagerduty.EventOrchestrationRouterCatchAllArgs(
actions=pagerduty.EventOrchestrationRouterCatchAllActionsArgs(
route_to="unrouted",
),
))
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Pagerduty = Pulumi.Pagerduty;
return await Deployment.RunAsync(() =>
{
var router = new Pagerduty.EventOrchestrationRouter("router", new()
{
EventOrchestration = pagerduty_event_orchestration.My_monitor.Id,
Set = new Pagerduty.Inputs.EventOrchestrationRouterSetArgs
{
Id = "start",
Rules = new[]
{
new Pagerduty.Inputs.EventOrchestrationRouterSetRuleArgs
{
Label = "Events relating to our relational database",
Conditions = new[]
{
new Pagerduty.Inputs.EventOrchestrationRouterSetRuleConditionArgs
{
Expression = "event.summary matches part 'database'",
},
new Pagerduty.Inputs.EventOrchestrationRouterSetRuleConditionArgs
{
Expression = "event.source matches regex 'db[0-9]+-server'",
},
},
Actions = new Pagerduty.Inputs.EventOrchestrationRouterSetRuleActionsArgs
{
RouteTo = pagerduty_service.Database.Id,
},
},
new Pagerduty.Inputs.EventOrchestrationRouterSetRuleArgs
{
Conditions = new[]
{
new Pagerduty.Inputs.EventOrchestrationRouterSetRuleConditionArgs
{
Expression = "event.summary matches part 'www'",
},
},
Actions = new Pagerduty.Inputs.EventOrchestrationRouterSetRuleActionsArgs
{
RouteTo = pagerduty_service.Www.Id,
},
},
},
},
CatchAll = new Pagerduty.Inputs.EventOrchestrationRouterCatchAllArgs
{
Actions = new Pagerduty.Inputs.EventOrchestrationRouterCatchAllActionsArgs
{
RouteTo = "unrouted",
},
},
});
});
package main
import (
"github.com/pulumi/pulumi-pagerduty/sdk/v3/go/pagerduty"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := pagerduty.NewEventOrchestrationRouter(ctx, "router", &pagerduty.EventOrchestrationRouterArgs{
EventOrchestration: pulumi.Any(pagerduty_event_orchestration.My_monitor.Id),
Set: &pagerduty.EventOrchestrationRouterSetArgs{
Id: pulumi.String("start"),
Rules: pagerduty.EventOrchestrationRouterSetRuleArray{
&pagerduty.EventOrchestrationRouterSetRuleArgs{
Label: pulumi.String("Events relating to our relational database"),
Conditions: pagerduty.EventOrchestrationRouterSetRuleConditionArray{
&pagerduty.EventOrchestrationRouterSetRuleConditionArgs{
Expression: pulumi.String("event.summary matches part 'database'"),
},
&pagerduty.EventOrchestrationRouterSetRuleConditionArgs{
Expression: pulumi.String("event.source matches regex 'db[0-9]+-server'"),
},
},
Actions: &pagerduty.EventOrchestrationRouterSetRuleActionsArgs{
RouteTo: pulumi.Any(pagerduty_service.Database.Id),
},
},
&pagerduty.EventOrchestrationRouterSetRuleArgs{
Conditions: pagerduty.EventOrchestrationRouterSetRuleConditionArray{
&pagerduty.EventOrchestrationRouterSetRuleConditionArgs{
Expression: pulumi.String("event.summary matches part 'www'"),
},
},
Actions: &pagerduty.EventOrchestrationRouterSetRuleActionsArgs{
RouteTo: pulumi.Any(pagerduty_service.Www.Id),
},
},
},
},
CatchAll: &pagerduty.EventOrchestrationRouterCatchAllArgs{
Actions: &pagerduty.EventOrchestrationRouterCatchAllActionsArgs{
RouteTo: pulumi.String("unrouted"),
},
},
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.pagerduty.EventOrchestrationRouter;
import com.pulumi.pagerduty.EventOrchestrationRouterArgs;
import com.pulumi.pagerduty.inputs.EventOrchestrationRouterSetArgs;
import com.pulumi.pagerduty.inputs.EventOrchestrationRouterCatchAllArgs;
import com.pulumi.pagerduty.inputs.EventOrchestrationRouterCatchAllActionsArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var router = new EventOrchestrationRouter("router", EventOrchestrationRouterArgs.builder()
.eventOrchestration(pagerduty_event_orchestration.my_monitor().id())
.set(EventOrchestrationRouterSetArgs.builder()
.id("start")
.rules(
EventOrchestrationRouterSetRuleArgs.builder()
.label("Events relating to our relational database")
.conditions(
EventOrchestrationRouterSetRuleConditionArgs.builder()
.expression("event.summary matches part 'database'")
.build(),
EventOrchestrationRouterSetRuleConditionArgs.builder()
.expression("event.source matches regex 'db[0-9]+-server'")
.build())
.actions(EventOrchestrationRouterSetRuleActionsArgs.builder()
.routeTo(pagerduty_service.database().id())
.build())
.build(),
EventOrchestrationRouterSetRuleArgs.builder()
.conditions(EventOrchestrationRouterSetRuleConditionArgs.builder()
.expression("event.summary matches part 'www'")
.build())
.actions(EventOrchestrationRouterSetRuleActionsArgs.builder()
.routeTo(pagerduty_service.www().id())
.build())
.build())
.build())
.catchAll(EventOrchestrationRouterCatchAllArgs.builder()
.actions(EventOrchestrationRouterCatchAllActionsArgs.builder()
.routeTo("unrouted")
.build())
.build())
.build());
}
}
resources:
router:
type: pagerduty:EventOrchestrationRouter
properties:
eventOrchestration: ${pagerduty_event_orchestration.my_monitor.id}
set:
id: start
rules:
- label: Events relating to our relational database
conditions:
- expression: event.summary matches part 'database'
- expression: event.source matches regex 'db[0-9]+-server'
actions:
routeTo: ${pagerduty_service.database.id}
- conditions:
- expression: event.summary matches part 'www'
actions:
routeTo: ${pagerduty_service.www.id}
catchAll:
actions:
routeTo: unrouted
Create EventOrchestrationRouter Resource
new EventOrchestrationRouter(name: string, args: EventOrchestrationRouterArgs, opts?: CustomResourceOptions);
@overload
def EventOrchestrationRouter(resource_name: str,
opts: Optional[ResourceOptions] = None,
catch_all: Optional[EventOrchestrationRouterCatchAllArgs] = None,
event_orchestration: Optional[str] = None,
set: Optional[EventOrchestrationRouterSetArgs] = None)
@overload
def EventOrchestrationRouter(resource_name: str,
args: EventOrchestrationRouterArgs,
opts: Optional[ResourceOptions] = None)
func NewEventOrchestrationRouter(ctx *Context, name string, args EventOrchestrationRouterArgs, opts ...ResourceOption) (*EventOrchestrationRouter, error)
public EventOrchestrationRouter(string name, EventOrchestrationRouterArgs args, CustomResourceOptions? opts = null)
public EventOrchestrationRouter(String name, EventOrchestrationRouterArgs args)
public EventOrchestrationRouter(String name, EventOrchestrationRouterArgs args, CustomResourceOptions options)
type: pagerduty:EventOrchestrationRouter
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args EventOrchestrationRouterArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args EventOrchestrationRouterArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args EventOrchestrationRouterArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args EventOrchestrationRouterArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args EventOrchestrationRouterArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
EventOrchestrationRouter Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The EventOrchestrationRouter resource accepts the following input properties:
- Catch
All EventOrchestration Router Catch All Args When none of the rules match an event, the event will be routed according to the catch_all settings.
- Event
Orchestration string ID of the Event Orchestration to which the Router belongs.
- Set
Event
Orchestration Router Set Args The Router contains a single set of rules (the "start" set).
- Catch
All EventOrchestration Router Catch All Args When none of the rules match an event, the event will be routed according to the catch_all settings.
- Event
Orchestration string ID of the Event Orchestration to which the Router belongs.
- Set
Event
Orchestration Router Set Args The Router contains a single set of rules (the "start" set).
- catch
All EventOrchestration Router Catch All Args When none of the rules match an event, the event will be routed according to the catch_all settings.
- event
Orchestration String ID of the Event Orchestration to which the Router belongs.
- set
Event
Orchestration Router Set Args The Router contains a single set of rules (the "start" set).
- catch
All EventOrchestration Router Catch All Args When none of the rules match an event, the event will be routed according to the catch_all settings.
- event
Orchestration string ID of the Event Orchestration to which the Router belongs.
- set
Event
Orchestration Router Set Args The Router contains a single set of rules (the "start" set).
- catch_
all EventOrchestration Router Catch All Args When none of the rules match an event, the event will be routed according to the catch_all settings.
- event_
orchestration str ID of the Event Orchestration to which the Router belongs.
- set
Event
Orchestration Router Set Args The Router contains a single set of rules (the "start" set).
- catch
All Property Map When none of the rules match an event, the event will be routed according to the catch_all settings.
- event
Orchestration String ID of the Event Orchestration to which the Router belongs.
- set Property Map
The Router contains a single set of rules (the "start" set).
Outputs
All input properties are implicitly available as output properties. Additionally, the EventOrchestrationRouter resource produces the following output properties:
- Id string
The provider-assigned unique ID for this managed resource.
- Id string
The provider-assigned unique ID for this managed resource.
- id String
The provider-assigned unique ID for this managed resource.
- id string
The provider-assigned unique ID for this managed resource.
- id str
The provider-assigned unique ID for this managed resource.
- id String
The provider-assigned unique ID for this managed resource.
Look up Existing EventOrchestrationRouter Resource
Get an existing EventOrchestrationRouter resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: EventOrchestrationRouterState, opts?: CustomResourceOptions): EventOrchestrationRouter
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
catch_all: Optional[EventOrchestrationRouterCatchAllArgs] = None,
event_orchestration: Optional[str] = None,
set: Optional[EventOrchestrationRouterSetArgs] = None) -> EventOrchestrationRouter
func GetEventOrchestrationRouter(ctx *Context, name string, id IDInput, state *EventOrchestrationRouterState, opts ...ResourceOption) (*EventOrchestrationRouter, error)
public static EventOrchestrationRouter Get(string name, Input<string> id, EventOrchestrationRouterState? state, CustomResourceOptions? opts = null)
public static EventOrchestrationRouter get(String name, Output<String> id, EventOrchestrationRouterState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Catch
All EventOrchestration Router Catch All Args When none of the rules match an event, the event will be routed according to the catch_all settings.
- Event
Orchestration string ID of the Event Orchestration to which the Router belongs.
- Set
Event
Orchestration Router Set Args The Router contains a single set of rules (the "start" set).
- Catch
All EventOrchestration Router Catch All Args When none of the rules match an event, the event will be routed according to the catch_all settings.
- Event
Orchestration string ID of the Event Orchestration to which the Router belongs.
- Set
Event
Orchestration Router Set Args The Router contains a single set of rules (the "start" set).
- catch
All EventOrchestration Router Catch All Args When none of the rules match an event, the event will be routed according to the catch_all settings.
- event
Orchestration String ID of the Event Orchestration to which the Router belongs.
- set
Event
Orchestration Router Set Args The Router contains a single set of rules (the "start" set).
- catch
All EventOrchestration Router Catch All Args When none of the rules match an event, the event will be routed according to the catch_all settings.
- event
Orchestration string ID of the Event Orchestration to which the Router belongs.
- set
Event
Orchestration Router Set Args The Router contains a single set of rules (the "start" set).
- catch_
all EventOrchestration Router Catch All Args When none of the rules match an event, the event will be routed according to the catch_all settings.
- event_
orchestration str ID of the Event Orchestration to which the Router belongs.
- set
Event
Orchestration Router Set Args The Router contains a single set of rules (the "start" set).
- catch
All Property Map When none of the rules match an event, the event will be routed according to the catch_all settings.
- event
Orchestration String ID of the Event Orchestration to which the Router belongs.
- set Property Map
The Router contains a single set of rules (the "start" set).
Supporting Types
EventOrchestrationRouterCatchAll
- Actions
Event
Orchestration Router Catch All Actions These are the actions that will be taken to change the resulting alert and incident.
- Actions
Event
Orchestration Router Catch All Actions These are the actions that will be taken to change the resulting alert and incident.
- actions
Event
Orchestration Router Catch All Actions These are the actions that will be taken to change the resulting alert and incident.
- actions
Event
Orchestration Router Catch All Actions These are the actions that will be taken to change the resulting alert and incident.
- actions
Event
Orchestration Router Catch All Actions These are the actions that will be taken to change the resulting alert and incident.
- actions Property Map
These are the actions that will be taken to change the resulting alert and incident.
EventOrchestrationRouterCatchAllActions
- Route
To string The ID of the target Service for the resulting alert.
- Route
To string The ID of the target Service for the resulting alert.
- route
To String The ID of the target Service for the resulting alert.
- route
To string The ID of the target Service for the resulting alert.
- route_
to str The ID of the target Service for the resulting alert.
- route
To String The ID of the target Service for the resulting alert.
EventOrchestrationRouterSet
- Id string
ID of the
start
set. Router supports only one set and it's id has to bestart
- Rules
List<Event
Orchestration Router Set Rule>
- Id string
ID of the
start
set. Router supports only one set and it's id has to bestart
- Rules
[]Event
Orchestration Router Set Rule
- id String
ID of the
start
set. Router supports only one set and it's id has to bestart
- rules
List<Event
Orchestration Router Set Rule>
- id string
ID of the
start
set. Router supports only one set and it's id has to bestart
- rules
Event
Orchestration Router Set Rule[]
- id str
ID of the
start
set. Router supports only one set and it's id has to bestart
- rules
Sequence[Event
Orchestration Router Set Rule]
- id String
ID of the
start
set. Router supports only one set and it's id has to bestart
- rules List<Property Map>
EventOrchestrationRouterSetRule
- Actions
Event
Orchestration Router Set Rule Actions Actions that will be taken to change the resulting alert and incident, when an event matches this rule.
- Conditions
List<Event
Orchestration Router Set Rule Condition> Each of these conditions is evaluated to check if an event matches this rule. The rule is considered a match if any of these conditions match. If none are provided, the event will always match against the rule.
- Disabled bool
Indicates whether the rule is disabled and would therefore not be evaluated.
- Id string
ID of the
start
set. Router supports only one set and it's id has to bestart
- Label string
A description of this rule's purpose.
- Actions
Event
Orchestration Router Set Rule Actions Actions that will be taken to change the resulting alert and incident, when an event matches this rule.
- Conditions
[]Event
Orchestration Router Set Rule Condition Each of these conditions is evaluated to check if an event matches this rule. The rule is considered a match if any of these conditions match. If none are provided, the event will always match against the rule.
- Disabled bool
Indicates whether the rule is disabled and would therefore not be evaluated.
- Id string
ID of the
start
set. Router supports only one set and it's id has to bestart
- Label string
A description of this rule's purpose.
- actions
Event
Orchestration Router Set Rule Actions Actions that will be taken to change the resulting alert and incident, when an event matches this rule.
- conditions
List<Event
Orchestration Router Set Rule Condition> Each of these conditions is evaluated to check if an event matches this rule. The rule is considered a match if any of these conditions match. If none are provided, the event will always match against the rule.
- disabled Boolean
Indicates whether the rule is disabled and would therefore not be evaluated.
- id String
ID of the
start
set. Router supports only one set and it's id has to bestart
- label String
A description of this rule's purpose.
- actions
Event
Orchestration Router Set Rule Actions Actions that will be taken to change the resulting alert and incident, when an event matches this rule.
- conditions
Event
Orchestration Router Set Rule Condition[] Each of these conditions is evaluated to check if an event matches this rule. The rule is considered a match if any of these conditions match. If none are provided, the event will always match against the rule.
- disabled boolean
Indicates whether the rule is disabled and would therefore not be evaluated.
- id string
ID of the
start
set. Router supports only one set and it's id has to bestart
- label string
A description of this rule's purpose.
- actions
Event
Orchestration Router Set Rule Actions Actions that will be taken to change the resulting alert and incident, when an event matches this rule.
- conditions
Sequence[Event
Orchestration Router Set Rule Condition] Each of these conditions is evaluated to check if an event matches this rule. The rule is considered a match if any of these conditions match. If none are provided, the event will always match against the rule.
- disabled bool
Indicates whether the rule is disabled and would therefore not be evaluated.
- id str
ID of the
start
set. Router supports only one set and it's id has to bestart
- label str
A description of this rule's purpose.
- actions Property Map
Actions that will be taken to change the resulting alert and incident, when an event matches this rule.
- conditions List<Property Map>
Each of these conditions is evaluated to check if an event matches this rule. The rule is considered a match if any of these conditions match. If none are provided, the event will always match against the rule.
- disabled Boolean
Indicates whether the rule is disabled and would therefore not be evaluated.
- id String
ID of the
start
set. Router supports only one set and it's id has to bestart
- label String
A description of this rule's purpose.
EventOrchestrationRouterSetRuleActions
- Route
To string The ID of the target Service for the resulting alert.
- Route
To string The ID of the target Service for the resulting alert.
- route
To String The ID of the target Service for the resulting alert.
- route
To string The ID of the target Service for the resulting alert.
- route_
to str The ID of the target Service for the resulting alert.
- route
To String The ID of the target Service for the resulting alert.
EventOrchestrationRouterSetRuleCondition
- Expression string
A PCL condition string.
- Expression string
A PCL condition string.
- expression String
A PCL condition string.
- expression string
A PCL condition string.
- expression str
A PCL condition string.
- expression String
A PCL condition string.
Import
Router can be imported using the id
of the Event Orchestration, e.g.
$ pulumi import pagerduty:index/eventOrchestrationRouter:EventOrchestrationRouter router 1b49abe7-26db-4439-a715-c6d883acfb3e
Package Details
- Repository
- PagerDuty pulumi/pulumi-pagerduty
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
pagerduty
Terraform Provider.