@pulumi/pagerduty
Version:
A Pulumi package for creating and managing pagerduty cloud resources.
110 lines • 4.88 kB
JavaScript
;
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.EventOrchestrationUnrouted = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* An Unrouted Orchestration allows users to create a set of Event Rules that will be evaluated against all events that don't match any rules in the Orchestration's Router.
*
* The Unrouted 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 Unrouted Orchestration for further processing.
*
* ## Example of configuring Unrouted Rules for an Orchestration
*
* In this example of an Unrouted Orchestration, the rule matches only if the condition is matched.
* Alerts created for events that do not match the rule will have severity level set to `info` as defined in `catchAll` block.
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pagerduty from "@pulumi/pagerduty";
*
* const unrouted = new pagerduty.EventOrchestrationUnrouted("unrouted", {
* eventOrchestration: myMonitor.id,
* sets: [{
* id: "start",
* rules: [{
* label: "Update the summary of un-matched Critical alerts so they're easier to spot",
* conditions: [{
* expression: "event.severity matches 'critical'",
* }],
* actions: {
* severity: "critical",
* extractions: [{
* target: "event.summary",
* template: "[Critical Unrouted] {{event.summary}}",
* }],
* },
* }],
* }],
* catchAll: {
* actions: {
* severity: "info",
* },
* },
* });
* ```
*
* ## Import
*
* Unrouted Orchestration can be imported using the `id` of the Event Orchestration, e.g.
*
* ```sh
* $ pulumi import pagerduty:index/eventOrchestrationUnrouted:EventOrchestrationUnrouted unrouted 1b49abe7-26db-4439-a715-c6d883acfb3e
* ```
*/
class EventOrchestrationUnrouted extends pulumi.CustomResource {
/**
* Get an existing EventOrchestrationUnrouted 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, id, state, opts) {
return new EventOrchestrationUnrouted(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of EventOrchestrationUnrouted. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === EventOrchestrationUnrouted.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["catchAll"] = state?.catchAll;
resourceInputs["eventOrchestration"] = state?.eventOrchestration;
resourceInputs["sets"] = state?.sets;
}
else {
const args = argsOrState;
if (args?.catchAll === undefined && !opts.urn) {
throw new Error("Missing required property 'catchAll'");
}
if (args?.eventOrchestration === undefined && !opts.urn) {
throw new Error("Missing required property 'eventOrchestration'");
}
if (args?.sets === undefined && !opts.urn) {
throw new Error("Missing required property 'sets'");
}
resourceInputs["catchAll"] = args?.catchAll;
resourceInputs["eventOrchestration"] = args?.eventOrchestration;
resourceInputs["sets"] = args?.sets;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(EventOrchestrationUnrouted.__pulumiType, name, resourceInputs, opts);
}
}
exports.EventOrchestrationUnrouted = EventOrchestrationUnrouted;
/** @internal */
EventOrchestrationUnrouted.__pulumiType = 'pagerduty:index/eventOrchestrationUnrouted:EventOrchestrationUnrouted';
//# sourceMappingURL=eventOrchestrationUnrouted.js.map