import * as pulumi from "@pulumi/pulumi"; import * as inputs from "./types/input"; import * as outputs from "./types/output"; /** * A [Cache Variable](https://support.pagerduty.com/docs/event-orchestration-variables) can be created on a Global Event Orchestration, in order to temporarily store event data to be referenced later within the Global Event Orchestration * * ## Example of configuring a Cache Variable for a Global Event Orchestration * * This example shows creating a global `Event Orchestration` and a `Cache Variable`. All events that have the `event.source` field will have its `source` value stored in this Cache Variable, and appended as a note for the subsequent incident created by this Event Orchestration. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as pagerduty from "@pulumi/pagerduty"; * * const databaseTeam = new pagerduty.Team("database_team", {name: "Database Team"}); * const eventOrchestration = new pagerduty.EventOrchestration("event_orchestration", { * name: "Example Orchestration", * team: databaseTeam.id, * }); * const recentHost = new pagerduty.EventOrchestrationGlobalCacheVariable("recent_host", { * eventOrchestration: eventOrchestration.id, * name: "recent_host", * conditions: [{ * expression: "event.source exists", * }], * configuration: { * type: "recent_value", * source: "event.source", * regex: ".*", * }, * }); * const hostIgnoreList = new pagerduty.EventOrchestrationServiceCacheVariable("host_ignore_list", { * eventOrchestration: eventOrchestration.id, * name: "host_ignore_list", * configuration: { * type: "external_data", * dataType: "string", * ttlSeconds: 3000, * }, * }); * const global = new pagerduty.EventOrchestrationGlobal("global", { * eventOrchestration: eventOrchestration.id, * sets: [{ * id: "start", * rules: [ * { * label: "Drop events originating from hosts on the ignore list", * conditions: [{ * expression: "cache_var.host_ignore_list matches part event.custom_details.host", * }], * actions: { * drop: true, * }, * }, * { * label: "Always annotate the incident with the event source for all events", * actions: { * annotate: "Last time, we saw this incident occur on host: {{cache_var.recent_host}}", * }, * }, * ], * }], * catchAll: { * actions: {}, * }, * }); * ``` * * ## Import * * Cache Variables can be imported using colon-separated IDs, which is the combination of the Global Event Orchestration ID followed by the Cache Variable ID, e.g. * * ```sh * $ pulumi import pagerduty:index/eventOrchestrationGlobalCacheVariable:EventOrchestrationGlobalCacheVariable cache_variable 5e7110bf-0ee7-429e-9724-34ed1fe15ac3:138ed254-3444-44ad-8cc7-701d69def439 * ``` * * [1]: https://support.pagerduty.com/docs/event-orchestration-variables * [2]: https://developer.pagerduty.com/docs/ZG9jOjM1NTE0MDc0-pcl-overview * [3]: https://developer.pagerduty.com/docs/ZG9jOjM1NTE0MDc0-pcl-overview#paths * [4]: https://github.com/google/re2/wiki/Syntax */ export declare class EventOrchestrationGlobalCacheVariable extends pulumi.CustomResource { /** * Get an existing EventOrchestrationGlobalCacheVariable 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?: EventOrchestrationGlobalCacheVariableState, opts?: pulumi.CustomResourceOptions): EventOrchestrationGlobalCacheVariable; /** * Returns true if the given object is an instance of EventOrchestrationGlobalCacheVariable. 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 EventOrchestrationGlobalCacheVariable; /** * Conditions to be evaluated in order to determine whether or not to update the Cache Variable's stored value. This attribute can only be used when `configuration.0.type` is `recentValue` or `triggerEventCount`. */ readonly conditions: pulumi.Output; /** * A configuration object to define what and how values will be stored in the Cache Variable. */ readonly configuration: pulumi.Output; /** * Indicates whether the Cache Variable is disabled and would therefore not be evaluated. */ readonly disabled: pulumi.Output; /** * ID of the Global Event Orchestration to which this Cache Variable belongs. */ readonly eventOrchestration: pulumi.Output; /** * Name of the Cache Variable associated with the Global Event Orchestration. */ readonly name: pulumi.Output; /** * Create a EventOrchestrationGlobalCacheVariable 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: EventOrchestrationGlobalCacheVariableArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering EventOrchestrationGlobalCacheVariable resources. */ export interface EventOrchestrationGlobalCacheVariableState { /** * Conditions to be evaluated in order to determine whether or not to update the Cache Variable's stored value. This attribute can only be used when `configuration.0.type` is `recentValue` or `triggerEventCount`. */ conditions?: pulumi.Input[]>; /** * A configuration object to define what and how values will be stored in the Cache Variable. */ configuration?: pulumi.Input; /** * Indicates whether the Cache Variable is disabled and would therefore not be evaluated. */ disabled?: pulumi.Input; /** * ID of the Global Event Orchestration to which this Cache Variable belongs. */ eventOrchestration?: pulumi.Input; /** * Name of the Cache Variable associated with the Global Event Orchestration. */ name?: pulumi.Input; } /** * The set of arguments for constructing a EventOrchestrationGlobalCacheVariable resource. */ export interface EventOrchestrationGlobalCacheVariableArgs { /** * Conditions to be evaluated in order to determine whether or not to update the Cache Variable's stored value. This attribute can only be used when `configuration.0.type` is `recentValue` or `triggerEventCount`. */ conditions?: pulumi.Input[]>; /** * A configuration object to define what and how values will be stored in the Cache Variable. */ configuration: pulumi.Input; /** * Indicates whether the Cache Variable is disabled and would therefore not be evaluated. */ disabled?: pulumi.Input; /** * ID of the Global Event Orchestration to which this Cache Variable belongs. */ eventOrchestration: pulumi.Input; /** * Name of the Cache Variable associated with the Global Event Orchestration. */ name?: pulumi.Input; }