@pulumi/opsgenie
Version:
A Pulumi package for creating and managing opsgenie cloud resources.
336 lines (335 loc) • 14 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "./types/input";
import * as outputs from "./types/output";
/**
* Manages a Alert Policy within Opsgenie.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as opsgenie from "@pulumi/opsgenie";
*
* const test = new opsgenie.Team("test", {
* name: "example team",
* description: "This team deals with all the things",
* });
* const testAlertPolicy = new opsgenie.AlertPolicy("test", {
* filters: [{}],
* name: "example policy",
* teamId: test.id,
* policyDescription: "This is sample policy",
* message: "{{message}}",
* timeRestrictions: [{
* type: "weekday-and-time-of-day",
* restrictionList: [
* {
* endDay: "monday",
* endHour: 7,
* endMin: 0,
* startDay: "sunday",
* startHour: 21,
* startMin: 0,
* },
* {
* endDay: "tuesday",
* endHour: 7,
* endMin: 0,
* startDay: "monday",
* startHour: 22,
* startMin: 0,
* },
* ],
* }],
* });
* ```
*
* ## Import
*
* Alert policies can be imported using the `team_id/policy_id`, e.g.
*
* ```sh
* $ pulumi import opsgenie:index/alertPolicy:AlertPolicy test team_id/policy_id`
* ```
*
* You can import global polices using only policy identifier
*
* ```sh
* $ pulumi import opsgenie:index/alertPolicy:AlertPolicy test policy_id`
* ```
*/
export declare class AlertPolicy extends pulumi.CustomResource {
/**
* Get an existing AlertPolicy 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?: AlertPolicyState, opts?: pulumi.CustomResourceOptions): AlertPolicy;
/**
* Returns true if the given object is an instance of AlertPolicy. 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 AlertPolicy;
/**
* Actions to add to the alerts original actions value as a list of strings. If `ignoreOriginalActions` field is set to `true`, this will replace the original actions.
*/
readonly actions: pulumi.Output<string[] | undefined>;
/**
* Description of the alert. You can use `{{description}}` to refer to the original alert description. Default: `{{description}}`
*/
readonly alertDescription: pulumi.Output<string | undefined>;
/**
* Alias of the alert. You can use `{{alias}}` to refer to the original alias. Default: `{{alias}}`
*/
readonly alias: pulumi.Output<string | undefined>;
/**
* It will trigger other modify policies if set to `true`. Default: `false`
*/
readonly continuePolicy: pulumi.Output<boolean | undefined>;
/**
* If policy should be enabled. Default: `true`
*/
readonly enabled: pulumi.Output<boolean | undefined>;
/**
* Entity field of the alert. You can use `{{entity}}` to refer to the original entity. Default: `{{entity}}`
*/
readonly entity: pulumi.Output<string | undefined>;
/**
* A alert filter which will be applied. This filter can be empty: `filter {}` - this means `match-all`. This is a block, structure is documented below.
*/
readonly filters: pulumi.Output<outputs.AlertPolicyFilter[] | undefined>;
/**
* If set to `true`, policy will ignore the original actions of the alert. Default: `false`
*/
readonly ignoreOriginalActions: pulumi.Output<boolean | undefined>;
/**
* If set to `true`, policy will ignore the original details of the alert. Default: `false`
*/
readonly ignoreOriginalDetails: pulumi.Output<boolean | undefined>;
/**
* If set to `true`, policy will ignore the original responders of the alert. Default: `false`
*/
readonly ignoreOriginalResponders: pulumi.Output<boolean | undefined>;
/**
* If set to `true`, policy will ignore the original tags of the alert. Default: `false`
*/
readonly ignoreOriginalTags: pulumi.Output<boolean | undefined>;
/**
* Message of the alerts
*/
readonly message: pulumi.Output<string>;
/**
* Name of the alert policy
*/
readonly name: pulumi.Output<string>;
/**
* Description of the policy. This can be max 512 characters.
*/
readonly policyDescription: pulumi.Output<string | undefined>;
/**
* Priority of the alert. Should be one of `P1`, `P2`, `P3`, `P4`, or `P5`
*/
readonly priority: pulumi.Output<string | undefined>;
/**
* Responders to add to the alerts original responders value as a list of teams, users or the reserved word none or all. If `ignoreOriginalResponders` field is set to `true`, this will replace the original responders. The possible values for responders are: `user`, `team`, `escalation`, `schedule`. This is a block, structure is documented below.
*/
readonly responders: pulumi.Output<outputs.AlertPolicyResponder[] | undefined>;
/**
* Source field of the alert. You can use `{{source}}` to refer to the original source. Default: `{{source}}`
*/
readonly source: pulumi.Output<string | undefined>;
/**
* Tags to add to the alerts original tags value as a list of strings. If `ignoreOriginalResponders` field is set to `true`, this will replace the original responders.
*/
readonly tags: pulumi.Output<string[] | undefined>;
/**
* Id of team that this policy belongs to.
*/
readonly teamId: pulumi.Output<string | undefined>;
/**
* Time restrictions specified in this field must be met for this policy to work. This is a block, structure is documented below.
*/
readonly timeRestrictions: pulumi.Output<outputs.AlertPolicyTimeRestriction[] | undefined>;
/**
* Create a AlertPolicy 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: AlertPolicyArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering AlertPolicy resources.
*/
export interface AlertPolicyState {
/**
* Actions to add to the alerts original actions value as a list of strings. If `ignoreOriginalActions` field is set to `true`, this will replace the original actions.
*/
actions?: pulumi.Input<pulumi.Input<string>[]>;
/**
* Description of the alert. You can use `{{description}}` to refer to the original alert description. Default: `{{description}}`
*/
alertDescription?: pulumi.Input<string>;
/**
* Alias of the alert. You can use `{{alias}}` to refer to the original alias. Default: `{{alias}}`
*/
alias?: pulumi.Input<string>;
/**
* It will trigger other modify policies if set to `true`. Default: `false`
*/
continuePolicy?: pulumi.Input<boolean>;
/**
* If policy should be enabled. Default: `true`
*/
enabled?: pulumi.Input<boolean>;
/**
* Entity field of the alert. You can use `{{entity}}` to refer to the original entity. Default: `{{entity}}`
*/
entity?: pulumi.Input<string>;
/**
* A alert filter which will be applied. This filter can be empty: `filter {}` - this means `match-all`. This is a block, structure is documented below.
*/
filters?: pulumi.Input<pulumi.Input<inputs.AlertPolicyFilter>[]>;
/**
* If set to `true`, policy will ignore the original actions of the alert. Default: `false`
*/
ignoreOriginalActions?: pulumi.Input<boolean>;
/**
* If set to `true`, policy will ignore the original details of the alert. Default: `false`
*/
ignoreOriginalDetails?: pulumi.Input<boolean>;
/**
* If set to `true`, policy will ignore the original responders of the alert. Default: `false`
*/
ignoreOriginalResponders?: pulumi.Input<boolean>;
/**
* If set to `true`, policy will ignore the original tags of the alert. Default: `false`
*/
ignoreOriginalTags?: pulumi.Input<boolean>;
/**
* Message of the alerts
*/
message?: pulumi.Input<string>;
/**
* Name of the alert policy
*/
name?: pulumi.Input<string>;
/**
* Description of the policy. This can be max 512 characters.
*/
policyDescription?: pulumi.Input<string>;
/**
* Priority of the alert. Should be one of `P1`, `P2`, `P3`, `P4`, or `P5`
*/
priority?: pulumi.Input<string>;
/**
* Responders to add to the alerts original responders value as a list of teams, users or the reserved word none or all. If `ignoreOriginalResponders` field is set to `true`, this will replace the original responders. The possible values for responders are: `user`, `team`, `escalation`, `schedule`. This is a block, structure is documented below.
*/
responders?: pulumi.Input<pulumi.Input<inputs.AlertPolicyResponder>[]>;
/**
* Source field of the alert. You can use `{{source}}` to refer to the original source. Default: `{{source}}`
*/
source?: pulumi.Input<string>;
/**
* Tags to add to the alerts original tags value as a list of strings. If `ignoreOriginalResponders` field is set to `true`, this will replace the original responders.
*/
tags?: pulumi.Input<pulumi.Input<string>[]>;
/**
* Id of team that this policy belongs to.
*/
teamId?: pulumi.Input<string>;
/**
* Time restrictions specified in this field must be met for this policy to work. This is a block, structure is documented below.
*/
timeRestrictions?: pulumi.Input<pulumi.Input<inputs.AlertPolicyTimeRestriction>[]>;
}
/**
* The set of arguments for constructing a AlertPolicy resource.
*/
export interface AlertPolicyArgs {
/**
* Actions to add to the alerts original actions value as a list of strings. If `ignoreOriginalActions` field is set to `true`, this will replace the original actions.
*/
actions?: pulumi.Input<pulumi.Input<string>[]>;
/**
* Description of the alert. You can use `{{description}}` to refer to the original alert description. Default: `{{description}}`
*/
alertDescription?: pulumi.Input<string>;
/**
* Alias of the alert. You can use `{{alias}}` to refer to the original alias. Default: `{{alias}}`
*/
alias?: pulumi.Input<string>;
/**
* It will trigger other modify policies if set to `true`. Default: `false`
*/
continuePolicy?: pulumi.Input<boolean>;
/**
* If policy should be enabled. Default: `true`
*/
enabled?: pulumi.Input<boolean>;
/**
* Entity field of the alert. You can use `{{entity}}` to refer to the original entity. Default: `{{entity}}`
*/
entity?: pulumi.Input<string>;
/**
* A alert filter which will be applied. This filter can be empty: `filter {}` - this means `match-all`. This is a block, structure is documented below.
*/
filters?: pulumi.Input<pulumi.Input<inputs.AlertPolicyFilter>[]>;
/**
* If set to `true`, policy will ignore the original actions of the alert. Default: `false`
*/
ignoreOriginalActions?: pulumi.Input<boolean>;
/**
* If set to `true`, policy will ignore the original details of the alert. Default: `false`
*/
ignoreOriginalDetails?: pulumi.Input<boolean>;
/**
* If set to `true`, policy will ignore the original responders of the alert. Default: `false`
*/
ignoreOriginalResponders?: pulumi.Input<boolean>;
/**
* If set to `true`, policy will ignore the original tags of the alert. Default: `false`
*/
ignoreOriginalTags?: pulumi.Input<boolean>;
/**
* Message of the alerts
*/
message: pulumi.Input<string>;
/**
* Name of the alert policy
*/
name?: pulumi.Input<string>;
/**
* Description of the policy. This can be max 512 characters.
*/
policyDescription?: pulumi.Input<string>;
/**
* Priority of the alert. Should be one of `P1`, `P2`, `P3`, `P4`, or `P5`
*/
priority?: pulumi.Input<string>;
/**
* Responders to add to the alerts original responders value as a list of teams, users or the reserved word none or all. If `ignoreOriginalResponders` field is set to `true`, this will replace the original responders. The possible values for responders are: `user`, `team`, `escalation`, `schedule`. This is a block, structure is documented below.
*/
responders?: pulumi.Input<pulumi.Input<inputs.AlertPolicyResponder>[]>;
/**
* Source field of the alert. You can use `{{source}}` to refer to the original source. Default: `{{source}}`
*/
source?: pulumi.Input<string>;
/**
* Tags to add to the alerts original tags value as a list of strings. If `ignoreOriginalResponders` field is set to `true`, this will replace the original responders.
*/
tags?: pulumi.Input<pulumi.Input<string>[]>;
/**
* Id of team that this policy belongs to.
*/
teamId?: pulumi.Input<string>;
/**
* Time restrictions specified in this field must be met for this policy to work. This is a block, structure is documented below.
*/
timeRestrictions?: pulumi.Input<pulumi.Input<inputs.AlertPolicyTimeRestriction>[]>;
}