UNPKG

@pulumi/pagerduty

Version:

A Pulumi package for creating and managing pagerduty cloud resources.

203 lines (202 loc) 7.5 kB
import * as pulumi from "@pulumi/pulumi"; /** * *NOTE: The `pagerduty.EventRule` resource has been deprecated in favor of the pagerduty.Ruleset and pagerduty.RulesetRule resources. Please use the `ruleset` based resources for working with Event Rules.* * * An [event rule](https://developer.pagerduty.com/docs/rest-api-v2/global-event-rules-api/) determines what happens to an event that is sent to PagerDuty by monitoring tools and other integrations. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as pagerduty from "@pulumi/pagerduty"; * * const second = new pagerduty.EventRule("second", { * actionJson: JSON.stringify([ * [ * "route", * "P5DTL0K", * ], * [ * "severity", * "warning", * ], * [ * "annotate", * "2 Managed by terraform", * ], * [ * "priority", * "PL451DT", * ], * ]), * conditionJson: JSON.stringify([ * "and", * [ * "contains", * [ * "path", * "payload", * "source", * ], * "website", * ], * [ * "contains", * [ * "path", * "headers", * "from", * "0", * "address", * ], * "homer", * ], * ]), * advancedConditionJson: JSON.stringify([[ * "scheduled-weekly", * 1565392127032, * 3600000, * "America/Los_Angeles", * [ * 1, * 2, * 3, * 5, * 7, * ], * ]]), * }); * const third = new pagerduty.EventRule("third", { * actionJson: JSON.stringify([ * [ * "route", * "P5DTL0K", * ], * [ * "severity", * "warning", * ], * [ * "annotate", * "3 Managed by terraform", * ], * [ * "priority", * "PL451DT", * ], * ]), * conditionJson: JSON.stringify([ * "and", * [ * "contains", * [ * "path", * "payload", * "source", * ], * "website", * ], * [ * "contains", * [ * "path", * "headers", * "from", * "0", * "address", * ], * "homer", * ], * ]), * }, { * dependsOn: [two], * }); * ``` * * ## Import * * Event rules can be imported using the `id`, e.g. * * ```sh * $ pulumi import pagerduty:index/eventRule:EventRule main 19acac92-027a-4ea0-b06c-bbf516519601 * ``` */ export declare class EventRule extends pulumi.CustomResource { /** * Get an existing EventRule 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<pulumi.ID>, state?: EventRuleState, opts?: pulumi.CustomResourceOptions): EventRule; /** * Returns true if the given object is an instance of EventRule. 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 EventRule; /** * A list of one or more actions for each rule. Each action within the list is itself a list. */ readonly actionJson: pulumi.Output<string>; /** * Contains a list of specific conditions including `active-between`,`scheduled-weekly`, and `frequency-over`. The first element in the list is the label for the condition, followed by a list of values for the specific condition. For more details on these conditions see [Advanced Condition](https://developer.pagerduty.com/docs/rest-api-v2/global-event-rules-api/#advanced-condition-parameter) in the PagerDuty API documentation. */ readonly advancedConditionJson: pulumi.Output<string | undefined>; /** * A boolean that indicates whether the rule is a catch-all for the account. This field is read-only through the PagerDuty API. */ readonly catchAll: pulumi.Output<boolean>; /** * Contains a list of conditions. The first field in the list is `and` or `or`, followed by a list of operators and values. */ readonly conditionJson: pulumi.Output<string>; /** * Create a EventRule 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: EventRuleArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering EventRule resources. */ export interface EventRuleState { /** * A list of one or more actions for each rule. Each action within the list is itself a list. */ actionJson?: pulumi.Input<string>; /** * Contains a list of specific conditions including `active-between`,`scheduled-weekly`, and `frequency-over`. The first element in the list is the label for the condition, followed by a list of values for the specific condition. For more details on these conditions see [Advanced Condition](https://developer.pagerduty.com/docs/rest-api-v2/global-event-rules-api/#advanced-condition-parameter) in the PagerDuty API documentation. */ advancedConditionJson?: pulumi.Input<string>; /** * A boolean that indicates whether the rule is a catch-all for the account. This field is read-only through the PagerDuty API. */ catchAll?: pulumi.Input<boolean>; /** * Contains a list of conditions. The first field in the list is `and` or `or`, followed by a list of operators and values. */ conditionJson?: pulumi.Input<string>; } /** * The set of arguments for constructing a EventRule resource. */ export interface EventRuleArgs { /** * A list of one or more actions for each rule. Each action within the list is itself a list. */ actionJson: pulumi.Input<string>; /** * Contains a list of specific conditions including `active-between`,`scheduled-weekly`, and `frequency-over`. The first element in the list is the label for the condition, followed by a list of values for the specific condition. For more details on these conditions see [Advanced Condition](https://developer.pagerduty.com/docs/rest-api-v2/global-event-rules-api/#advanced-condition-parameter) in the PagerDuty API documentation. */ advancedConditionJson?: pulumi.Input<string>; /** * Contains a list of conditions. The first field in the list is `and` or `or`, followed by a list of operators and values. */ conditionJson: pulumi.Input<string>; }