@pulumi/pagerduty
Version:
A Pulumi package for creating and managing pagerduty cloud resources.
194 lines • 6.93 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "./types/input";
import * as outputs from "./types/output";
/**
* An [alert grouping setting](https://developer.pagerduty.com/api-reference/587edbc8ff416-create-an-alert-grouping-setting)
* stores and centralize the configuration used during grouping of the alerts.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pagerduty from "@pulumi/pagerduty";
*
* const _default = pagerduty.getEscalationPolicy({
* name: "Default",
* });
* const basic = new pagerduty.Service("basic", {
* name: "Example",
* escalationPolicy: _default.then(_default => _default.id),
* });
* const basicSettings = new pagerduty.AlertGroupingSetting("basic_settings", {
* name: "Configuration for type-1 devices",
* type: "content_based",
* services: [basic.id],
* config: {
* timeWindow: 300,
* aggregate: "all",
* fields: ["fields"],
* },
* });
* ```
*
* ## Migration from `alertGroupingParameters`
*
* To migrate from using the field `alertGroupingParameters` of a
* service
* to a `pagerduty.AlertGroupingSetting` resource, you can cut-and-paste the
* contents of an `alertGroupingParameters` field from a `pagerduty.Service`
* resource into the new resource, but you also need to add at least one value in
* the field `services` to create the alert grouping setting with a service
* associated to it.
*
* If you are using `timeout = 0` or `timeWindow = 0` in order to use the values
* recommended by PagerDuty you also need to set its value to null or delete it,
* since a value of `0` is no longer accepted.
*
* **Example**:
*
* Before:
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pagerduty from "@pulumi/pagerduty";
*
* const _default = pagerduty.getEscalationPolicy({
* name: "Default",
* });
* const foo = new pagerduty.Service("foo", {
* name: "Foo",
* escalationPolicy: _default.then(_default => _default.id),
* alertGroupingParameters: {
* type: "time",
* config: {
* timeout: 0,
* },
* },
* });
* ```
*
* After:
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pagerduty from "@pulumi/pagerduty";
*
* const _default = pagerduty.getEscalationPolicy({
* name: "Default",
* });
* const foo = new pagerduty.Service("foo", {
* name: "Foo",
* escalationPolicy: _default.then(_default => _default.id),
* });
* const fooAlert = new pagerduty.AlertGroupingSetting("foo_alert", {
* name: "Alert Grouping for Foo-like services",
* type: "time",
* config: {
* time: null,
* },
* services: [foo.id],
* });
* ```
*
* ## Import
*
* Alert grouping settings can be imported using its `id`, e.g.
*
* ```sh
* $ pulumi import pagerduty:index/alertGroupingSetting:AlertGroupingSetting example P3DH5M6
* ```
*/
export declare class AlertGroupingSetting extends pulumi.CustomResource {
/**
* Get an existing AlertGroupingSetting 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?: AlertGroupingSettingState, opts?: pulumi.CustomResourceOptions): AlertGroupingSetting;
/**
* Returns true if the given object is an instance of AlertGroupingSetting. 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 AlertGroupingSetting;
/**
* The set of values used for configuration.
*/
readonly config: pulumi.Output<outputs.AlertGroupingSettingConfig | undefined>;
/**
* A human-friendly text to describe and identify this alert grouping setting.
*/
readonly description: pulumi.Output<string>;
/**
* The name for the alert grouping settings.
*/
readonly name: pulumi.Output<string>;
/**
* [Updating can cause a resource replacement] The list IDs of services associated to this setting.
*/
readonly services: pulumi.Output<string[]>;
/**
* The type of alert grouping; one of `intelligent`, `time`, `contentBased` or `contentBasedIntelligent`.
*/
readonly type: pulumi.Output<string>;
/**
* Create a AlertGroupingSetting 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: AlertGroupingSettingArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering AlertGroupingSetting resources.
*/
export interface AlertGroupingSettingState {
/**
* The set of values used for configuration.
*/
config?: pulumi.Input<inputs.AlertGroupingSettingConfig | undefined>;
/**
* A human-friendly text to describe and identify this alert grouping setting.
*/
description?: pulumi.Input<string | undefined>;
/**
* The name for the alert grouping settings.
*/
name?: pulumi.Input<string | undefined>;
/**
* [Updating can cause a resource replacement] The list IDs of services associated to this setting.
*/
services?: pulumi.Input<pulumi.Input<string>[] | undefined>;
/**
* The type of alert grouping; one of `intelligent`, `time`, `contentBased` or `contentBasedIntelligent`.
*/
type?: pulumi.Input<string | undefined>;
}
/**
* The set of arguments for constructing a AlertGroupingSetting resource.
*/
export interface AlertGroupingSettingArgs {
/**
* The set of values used for configuration.
*/
config?: pulumi.Input<inputs.AlertGroupingSettingConfig | undefined>;
/**
* A human-friendly text to describe and identify this alert grouping setting.
*/
description?: pulumi.Input<string | undefined>;
/**
* The name for the alert grouping settings.
*/
name?: pulumi.Input<string | undefined>;
/**
* [Updating can cause a resource replacement] The list IDs of services associated to this setting.
*/
services: pulumi.Input<pulumi.Input<string>[]>;
/**
* The type of alert grouping; one of `intelligent`, `time`, `contentBased` or `contentBasedIntelligent`.
*/
type: pulumi.Input<string>;
}
//# sourceMappingURL=alertGroupingSetting.d.ts.map