import * as pulumi from "@pulumi/pulumi"; import * as inputs from "./types/input"; import * as outputs from "./types/output"; /** * 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 `catchAll` 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 three rules. The first rule configures a dynamic route: any event containing a value in its `pdServiceId` 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. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as pagerduty from "@pulumi/pagerduty"; * * const database = pagerduty.getService({ * name: "Primary Data Store", * }); * const www = pagerduty.getService({ * name: "Web Server App", * }); * const router = new pagerduty.EventOrchestrationRouter("router", { * eventOrchestration: myMonitor.id, * set: { * id: "start", * rules: [ * { * label: "Dynamically route events related to specific PagerDuty services", * actions: { * dynamicRouteTos: [{ * lookupBy: "service_id", * source: "event.custom_details.pd_service_id", * regex: "(.*)", * }], * }, * }, * { * 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: database.then(database => database.id), * }, * }, * { * conditions: [{ * expression: "event.summary matches part 'www'", * }], * actions: { * routeTo: www.then(www => www.id), * }, * }, * ], * }, * catchAll: { * actions: { * routeTo: "unrouted", * }, * }, * }); * ``` * * ## Import * * Router can be imported using the `id` of the Event Orchestration, e.g. * * ```sh * $ pulumi import pagerduty:index/eventOrchestrationRouter:EventOrchestrationRouter router 1b49abe7-26db-4439-a715-c6d883acfb3e * ``` */ export declare class EventOrchestrationRouter extends pulumi.CustomResource { /** * Get an existing EventOrchestrationRouter resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input, state?: EventOrchestrationRouterState, opts?: pulumi.CustomResourceOptions): EventOrchestrationRouter; /** * Returns true if the given object is an instance of EventOrchestrationRouter. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is EventOrchestrationRouter; /** * When none of the rules match an event, the event will be routed according to the catchAll settings. */ readonly catchAll: pulumi.Output; /** * ID of the Event Orchestration to which the Router belongs. */ readonly eventOrchestration: pulumi.Output; /** * The Router contains a single set of rules (the "start" set). */ readonly set: pulumi.Output; /** * Create a EventOrchestrationRouter resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: EventOrchestrationRouterArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering EventOrchestrationRouter resources. */ export interface EventOrchestrationRouterState { /** * When none of the rules match an event, the event will be routed according to the catchAll settings. */ catchAll?: pulumi.Input; /** * ID of the Event Orchestration to which the Router belongs. */ eventOrchestration?: pulumi.Input; /** * The Router contains a single set of rules (the "start" set). */ set?: pulumi.Input; } /** * The set of arguments for constructing a EventOrchestrationRouter resource. */ export interface EventOrchestrationRouterArgs { /** * When none of the rules match an event, the event will be routed according to the catchAll settings. */ catchAll: pulumi.Input; /** * ID of the Event Orchestration to which the Router belongs. */ eventOrchestration: pulumi.Input; /** * The Router contains a single set of rules (the "start" set). */ set: pulumi.Input; }