Welcome to Pulumi Registry, your window into the cloud. Read the announcement.

Opsgenie

v1.1.0 published on Thursday, Nov 11, 2021 by Pulumi

Escalation

Manages an Escalation within Opsgenie.

Example Usage

using Pulumi;
using Opsgenie = Pulumi.Opsgenie;

class MyStack : Stack
{
    public MyStack()
    {
        var test = new Opsgenie.Escalation("test", new Opsgenie.EscalationArgs
        {
            Description = "test",
            OwnerTeamId = opsgenie_team.Test.Id,
            Repeats = 
            {
                new Opsgenie.Inputs.EscalationRepeatArgs
                {
                    CloseAlertAfterAll = false,
                    Count = 1,
                    ResetRecipientStates = true,
                    WaitInterval = 10,
                },
            },
            Rules = 
            {
                new Opsgenie.Inputs.EscalationRuleArgs
                {
                    Condition = "if-not-acked",
                    Delay = 1,
                    NotifyType = "default",
                    Recipients = 
                    {
                        new Opsgenie.Inputs.EscalationRuleRecipientArgs
                        {
                            Id = opsgenie_user.Test.Id,
                            Type = "user",
                        },
                        new Opsgenie.Inputs.EscalationRuleRecipientArgs
                        {
                            Id = opsgenie_team.Test.Id,
                            Type = "team",
                        },
                        new Opsgenie.Inputs.EscalationRuleRecipientArgs
                        {
                            Id = opsgenie_schedule.Test.Id,
                            Type = "schedule",
                        },
                    },
                },
            },
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-opsgenie/sdk/go/opsgenie"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := opsgenie.NewEscalation(ctx, "test", &opsgenie.EscalationArgs{
			Description: pulumi.String("test"),
			OwnerTeamId: pulumi.Any(opsgenie_team.Test.Id),
			Repeats: EscalationRepeatArray{
				&EscalationRepeatArgs{
					CloseAlertAfterAll:   pulumi.Bool(false),
					Count:                pulumi.Int(1),
					ResetRecipientStates: pulumi.Bool(true),
					WaitInterval:         pulumi.Int(10),
				},
			},
			Rules: EscalationRuleArray{
				&EscalationRuleArgs{
					Condition:  pulumi.String("if-not-acked"),
					Delay:      pulumi.Int(1),
					NotifyType: pulumi.String("default"),
					Recipients: EscalationRuleRecipientArray{
						&EscalationRuleRecipientArgs{
							Id:   pulumi.Any(opsgenie_user.Test.Id),
							Type: pulumi.String("user"),
						},
						&EscalationRuleRecipientArgs{
							Id:   pulumi.Any(opsgenie_team.Test.Id),
							Type: pulumi.String("team"),
						},
						&EscalationRuleRecipientArgs{
							Id:   pulumi.Any(opsgenie_schedule.Test.Id),
							Type: pulumi.String("schedule"),
						},
					},
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_opsgenie as opsgenie

test = opsgenie.Escalation("test",
    description="test",
    owner_team_id=opsgenie_team["test"]["id"],
    repeats=[opsgenie.EscalationRepeatArgs(
        close_alert_after_all=False,
        count=1,
        reset_recipient_states=True,
        wait_interval=10,
    )],
    rules=[opsgenie.EscalationRuleArgs(
        condition="if-not-acked",
        delay=1,
        notify_type="default",
        recipients=[
            opsgenie.EscalationRuleRecipientArgs(
                id=opsgenie_user["test"]["id"],
                type="user",
            ),
            opsgenie.EscalationRuleRecipientArgs(
                id=opsgenie_team["test"]["id"],
                type="team",
            ),
            opsgenie.EscalationRuleRecipientArgs(
                id=opsgenie_schedule["test"]["id"],
                type="schedule",
            ),
        ],
    )])
import * as pulumi from "@pulumi/pulumi";
import * as opsgenie from "@pulumi/opsgenie";

const test = new opsgenie.Escalation("test", {
    description: "test",
    ownerTeamId: opsgenie_team_test.id,
    repeats: [{
        closeAlertAfterAll: false,
        count: 1,
        resetRecipientStates: true,
        waitInterval: 10,
    }],
    rules: [{
        condition: "if-not-acked",
        delay: 1,
        notifyType: "default",
        recipients: [
            {
                id: opsgenie_user_test.id,
                type: "user",
            },
            {
                id: opsgenie_team_test.id,
                type: "team",
            },
            {
                id: opsgenie_schedule_test.id,
                type: "schedule",
            },
        ],
    }],
});

Create a Escalation Resource

new Escalation(name: string, args: EscalationArgs, opts?: CustomResourceOptions);
@overload
def Escalation(resource_name: str,
               opts: Optional[ResourceOptions] = None,
               description: Optional[str] = None,
               name: Optional[str] = None,
               owner_team_id: Optional[str] = None,
               repeats: Optional[Sequence[EscalationRepeatArgs]] = None,
               rules: Optional[Sequence[EscalationRuleArgs]] = None)
@overload
def Escalation(resource_name: str,
               args: EscalationArgs,
               opts: Optional[ResourceOptions] = None)
func NewEscalation(ctx *Context, name string, args EscalationArgs, opts ...ResourceOption) (*Escalation, error)
public Escalation(string name, EscalationArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args EscalationArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args EscalationArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args EscalationArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args EscalationArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

Escalation Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The Escalation resource accepts the following input properties:

Rules List<EscalationRuleArgs>
List of the escalation rules.
Description string
Description of the escalation.
Name string
Name of the escalation.
OwnerTeamId string
Owner team id of the escalation.
Repeats List<EscalationRepeatArgs>
Repeat preferences of the escalation including repeat interval, count, reverting acknowledge and seen states back and closing an alert automatically as soon as repeats are completed
Rules []EscalationRuleArgs
List of the escalation rules.
Description string
Description of the escalation.
Name string
Name of the escalation.
OwnerTeamId string
Owner team id of the escalation.
Repeats []EscalationRepeatArgs
Repeat preferences of the escalation including repeat interval, count, reverting acknowledge and seen states back and closing an alert automatically as soon as repeats are completed
rules EscalationRuleArgs[]
List of the escalation rules.
description string
Description of the escalation.
name string
Name of the escalation.
ownerTeamId string
Owner team id of the escalation.
repeats EscalationRepeatArgs[]
Repeat preferences of the escalation including repeat interval, count, reverting acknowledge and seen states back and closing an alert automatically as soon as repeats are completed
rules Sequence[EscalationRuleArgs]
List of the escalation rules.
description str
Description of the escalation.
name str
Name of the escalation.
owner_team_id str
Owner team id of the escalation.
repeats Sequence[EscalationRepeatArgs]
Repeat preferences of the escalation including repeat interval, count, reverting acknowledge and seen states back and closing an alert automatically as soon as repeats are completed

Outputs

All input properties are implicitly available as output properties. Additionally, the Escalation resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.

Look up an Existing Escalation Resource

Get an existing Escalation resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: EscalationState, opts?: CustomResourceOptions): Escalation
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        description: Optional[str] = None,
        name: Optional[str] = None,
        owner_team_id: Optional[str] = None,
        repeats: Optional[Sequence[EscalationRepeatArgs]] = None,
        rules: Optional[Sequence[EscalationRuleArgs]] = None) -> Escalation
func GetEscalation(ctx *Context, name string, id IDInput, state *EscalationState, opts ...ResourceOption) (*Escalation, error)
public static Escalation Get(string name, Input<string> id, EscalationState? state, CustomResourceOptions? opts = null)
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.

The following state arguments are supported:

Description string
Description of the escalation.
Name string
Name of the escalation.
OwnerTeamId string
Owner team id of the escalation.
Repeats List<EscalationRepeatArgs>
Repeat preferences of the escalation including repeat interval, count, reverting acknowledge and seen states back and closing an alert automatically as soon as repeats are completed
Rules List<EscalationRuleArgs>
List of the escalation rules.
Description string
Description of the escalation.
Name string
Name of the escalation.
OwnerTeamId string
Owner team id of the escalation.
Repeats []EscalationRepeatArgs
Repeat preferences of the escalation including repeat interval, count, reverting acknowledge and seen states back and closing an alert automatically as soon as repeats are completed
Rules []EscalationRuleArgs
List of the escalation rules.
description string
Description of the escalation.
name string
Name of the escalation.
ownerTeamId string
Owner team id of the escalation.
repeats EscalationRepeatArgs[]
Repeat preferences of the escalation including repeat interval, count, reverting acknowledge and seen states back and closing an alert automatically as soon as repeats are completed
rules EscalationRuleArgs[]
List of the escalation rules.
description str
Description of the escalation.
name str
Name of the escalation.
owner_team_id str
Owner team id of the escalation.
repeats Sequence[EscalationRepeatArgs]
Repeat preferences of the escalation including repeat interval, count, reverting acknowledge and seen states back and closing an alert automatically as soon as repeats are completed
rules Sequence[EscalationRuleArgs]
List of the escalation rules.

Supporting Types

EscalationRepeat

EscalationRule

Condition string
The condition for notifying the recipient of escalation rule that is based on the alert state. Possible values are: if-not-acked and if-not-closed. Default: if-not-acked
Delay int
Time delay of the escalation rule, in minutes.
NotifyType string
Recipient calculation logic for schedules. Possible values are:
Recipients List<EscalationRuleRecipient>
Object of schedule, team, or users which will be notified in escalation. The possible values for participants are: user, schedule, team.
Condition string
The condition for notifying the recipient of escalation rule that is based on the alert state. Possible values are: if-not-acked and if-not-closed. Default: if-not-acked
Delay int
Time delay of the escalation rule, in minutes.
NotifyType string
Recipient calculation logic for schedules. Possible values are:
Recipients []EscalationRuleRecipient
Object of schedule, team, or users which will be notified in escalation. The possible values for participants are: user, schedule, team.
condition string
The condition for notifying the recipient of escalation rule that is based on the alert state. Possible values are: if-not-acked and if-not-closed. Default: if-not-acked
delay number
Time delay of the escalation rule, in minutes.
notifyType string
Recipient calculation logic for schedules. Possible values are:
recipients EscalationRuleRecipient[]
Object of schedule, team, or users which will be notified in escalation. The possible values for participants are: user, schedule, team.
condition str
The condition for notifying the recipient of escalation rule that is based on the alert state. Possible values are: if-not-acked and if-not-closed. Default: if-not-acked
delay int
Time delay of the escalation rule, in minutes.
notify_type str
Recipient calculation logic for schedules. Possible values are:
recipients Sequence[EscalationRuleRecipient]
Object of schedule, team, or users which will be notified in escalation. The possible values for participants are: user, schedule, team.

EscalationRuleRecipient

Id string
The ID of the Opsgenie Escalation.
Type string
Id string
The ID of the Opsgenie Escalation.
Type string
id string
The ID of the Opsgenie Escalation.
type string
id str
The ID of the Opsgenie Escalation.
type str

Import

Escalations can be imported using the escalation_id, e.g.

 $ pulumi import opsgenie:index/escalation:Escalation test escalation_id`

Package Details

Repository
https://github.com/pulumi/pulumi-opsgenie
License
Apache-2.0
Notes
This Pulumi package is based on the opsgenie Terraform Provider.