EscalationPolicy

An escalation policy determines what user or schedule will be notified first, second, and so on when an incident is triggered. Escalation policies are used by one or more services.

Example Usage

using Pulumi;
using Pagerduty = Pulumi.Pagerduty;

class MyStack : Stack
{
    public MyStack()
    {
        var exampleTeam = new Pagerduty.Team("exampleTeam", new Pagerduty.TeamArgs
        {
            Description = "All engineering",
        });
        var exampleUser = new Pagerduty.User("exampleUser", new Pagerduty.UserArgs
        {
            Email = "125.greenholt.earline@graham.name",
            Teams = 
            {
                exampleTeam.Id,
            },
        });
        var exampleEscalationPolicy = new Pagerduty.EscalationPolicy("exampleEscalationPolicy", new Pagerduty.EscalationPolicyArgs
        {
            NumLoops = 2,
            Teams = 
            {
                exampleTeam.Id,
            },
            Rules = 
            {
                new Pagerduty.Inputs.EscalationPolicyRuleArgs
                {
                    EscalationDelayInMinutes = 10,
                    Targets = 
                    {
                        new Pagerduty.Inputs.EscalationPolicyRuleTargetArgs
                        {
                            Type = "user",
                            Id = exampleUser.Id,
                        },
                        new Pagerduty.Inputs.EscalationPolicyRuleTargetArgs
                        {
                            Type = "user",
                            Id = pagerduty_user.Example2.Id,
                        },
                    },
                },
            },
        });
    }

}
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		exampleTeam, err := pagerduty.NewTeam(ctx, "exampleTeam", &pagerduty.TeamArgs{
			Description: pulumi.String("All engineering"),
		})
		if err != nil {
			return err
		}
		exampleUser, err := pagerduty.NewUser(ctx, "exampleUser", &pagerduty.UserArgs{
			Email: pulumi.String("125.greenholt.earline@graham.name"),
			Teams: pulumi.StringArray{
				exampleTeam.ID(),
			},
		})
		if err != nil {
			return err
		}
		_, err = pagerduty.NewEscalationPolicy(ctx, "exampleEscalationPolicy", &pagerduty.EscalationPolicyArgs{
			NumLoops: pulumi.Int(2),
			Teams: pulumi.StringArray{
				exampleTeam.ID(),
			},
			Rules: pagerduty.EscalationPolicyRuleArray{
				&pagerduty.EscalationPolicyRuleArgs{
					EscalationDelayInMinutes: pulumi.Int(10),
					Targets: pagerduty.EscalationPolicyRuleTargetArray{
						&pagerduty.EscalationPolicyRuleTargetArgs{
							Type: pulumi.String("user"),
							Id:   exampleUser.ID(),
						},
						&pagerduty.EscalationPolicyRuleTargetArgs{
							Type: pulumi.String("user"),
							Id:   pulumi.Any(pagerduty_user.Example2.Id),
						},
					},
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_pagerduty as pagerduty

example_team = pagerduty.Team("exampleTeam", description="All engineering")
example_user = pagerduty.User("exampleUser",
    email="125.greenholt.earline@graham.name",
    teams=[example_team.id])
example_escalation_policy = pagerduty.EscalationPolicy("exampleEscalationPolicy",
    num_loops=2,
    teams=[example_team.id],
    rules=[pagerduty.EscalationPolicyRuleArgs(
        escalation_delay_in_minutes=10,
        targets=[
            pagerduty.EscalationPolicyRuleTargetArgs(
                type="user",
                id=example_user.id,
            ),
            pagerduty.EscalationPolicyRuleTargetArgs(
                type="user",
                id=pagerduty_user["example2"]["id"],
            ),
        ],
    )])
import * as pulumi from "@pulumi/pulumi";
import * as pagerduty from "@pulumi/pagerduty";

const exampleTeam = new pagerduty.Team("exampleTeam", {description: "All engineering"});
const exampleUser = new pagerduty.User("exampleUser", {
    email: "125.greenholt.earline@graham.name",
    teams: [exampleTeam.id],
});
const exampleEscalationPolicy = new pagerduty.EscalationPolicy("exampleEscalationPolicy", {
    numLoops: 2,
    teams: [exampleTeam.id],
    rules: [{
        escalationDelayInMinutes: 10,
        targets: [
            {
                type: "user",
                id: exampleUser.id,
            },
            {
                type: "user",
                id: pagerduty_user.example2.id,
            },
        ],
    }],
});

Create a EscalationPolicy Resource

new EscalationPolicy(name: string, args: EscalationPolicyArgs, opts?: CustomResourceOptions);
@overload
def EscalationPolicy(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     description: Optional[str] = None,
                     name: Optional[str] = None,
                     num_loops: Optional[int] = None,
                     rules: Optional[Sequence[EscalationPolicyRuleArgs]] = None,
                     teams: Optional[Sequence[str]] = None)
@overload
def EscalationPolicy(resource_name: str,
                     args: EscalationPolicyArgs,
                     opts: Optional[ResourceOptions] = None)
func NewEscalationPolicy(ctx *Context, name string, args EscalationPolicyArgs, opts ...ResourceOption) (*EscalationPolicy, error)
public EscalationPolicy(string name, EscalationPolicyArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args EscalationPolicyArgs
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 EscalationPolicyArgs
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 EscalationPolicyArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args EscalationPolicyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

EscalationPolicy Resource Properties

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

Inputs

The EscalationPolicy resource accepts the following input properties:

Rules List<EscalationPolicyRuleArgs>
An Escalation rule block. Escalation rules documented below.
Description string
Name string
The name of the escalation policy.
NumLoops int
The number of times the escalation policy will repeat after reaching the end of its escalation.
Teams List<string>
Teams associated with the policy. Account must have the teams ability to use this parameter.
Rules []EscalationPolicyRule
An Escalation rule block. Escalation rules documented below.
Description string
Name string
The name of the escalation policy.
NumLoops int
The number of times the escalation policy will repeat after reaching the end of its escalation.
Teams []string
Teams associated with the policy. Account must have the teams ability to use this parameter.
rules EscalationPolicyRuleArgs[]
An Escalation rule block. Escalation rules documented below.
description string
name string
The name of the escalation policy.
numLoops number
The number of times the escalation policy will repeat after reaching the end of its escalation.
teams string[]
Teams associated with the policy. Account must have the teams ability to use this parameter.
rules Sequence[EscalationPolicyRuleArgs]
An Escalation rule block. Escalation rules documented below.
description str
name str
The name of the escalation policy.
num_loops int
The number of times the escalation policy will repeat after reaching the end of its escalation.
teams Sequence[str]
Teams associated with the policy. Account must have the teams ability to use this parameter.

Outputs

All input properties are implicitly available as output properties. Additionally, the EscalationPolicy 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 EscalationPolicy Resource

Get an existing EscalationPolicy 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?: EscalationPolicyState, opts?: CustomResourceOptions): EscalationPolicy
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        description: Optional[str] = None,
        name: Optional[str] = None,
        num_loops: Optional[int] = None,
        rules: Optional[Sequence[EscalationPolicyRuleArgs]] = None,
        teams: Optional[Sequence[str]] = None) -> EscalationPolicy
func GetEscalationPolicy(ctx *Context, name string, id IDInput, state *EscalationPolicyState, opts ...ResourceOption) (*EscalationPolicy, error)
public static EscalationPolicy Get(string name, Input<string> id, EscalationPolicyState? 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
Name string
The name of the escalation policy.
NumLoops int
The number of times the escalation policy will repeat after reaching the end of its escalation.
Rules List<EscalationPolicyRuleArgs>
An Escalation rule block. Escalation rules documented below.
Teams List<string>
Teams associated with the policy. Account must have the teams ability to use this parameter.
Description string
Name string
The name of the escalation policy.
NumLoops int
The number of times the escalation policy will repeat after reaching the end of its escalation.
Rules []EscalationPolicyRule
An Escalation rule block. Escalation rules documented below.
Teams []string
Teams associated with the policy. Account must have the teams ability to use this parameter.
description string
name string
The name of the escalation policy.
numLoops number
The number of times the escalation policy will repeat after reaching the end of its escalation.
rules EscalationPolicyRuleArgs[]
An Escalation rule block. Escalation rules documented below.
teams string[]
Teams associated with the policy. Account must have the teams ability to use this parameter.
description str
name str
The name of the escalation policy.
num_loops int
The number of times the escalation policy will repeat after reaching the end of its escalation.
rules Sequence[EscalationPolicyRuleArgs]
An Escalation rule block. Escalation rules documented below.
teams Sequence[str]
Teams associated with the policy. Account must have the teams ability to use this parameter.

Supporting Types

EscalationPolicyRule

EscalationDelayInMinutes int
The number of minutes before an unacknowledged incident escalates away from this rule.
Targets List<EscalationPolicyRuleTargetArgs>
Id string
A target ID
EscalationDelayInMinutes int
The number of minutes before an unacknowledged incident escalates away from this rule.
Targets []EscalationPolicyRuleTarget
Id string
A target ID
escalationDelayInMinutes number
The number of minutes before an unacknowledged incident escalates away from this rule.
targets EscalationPolicyRuleTargetArgs[]
id string
A target ID
escalation_delay_in_minutes int
The number of minutes before an unacknowledged incident escalates away from this rule.
targets Sequence[EscalationPolicyRuleTargetArgs]
id str
A target ID

EscalationPolicyRuleTarget

Id string
A target ID
Type string
Can be user, schedule, user_reference or schedule_reference. Defaults to user_reference. For multiple users as example, repeat the target.
Id string
A target ID
Type string
Can be user, schedule, user_reference or schedule_reference. Defaults to user_reference. For multiple users as example, repeat the target.
id string
A target ID
type string
Can be user, schedule, user_reference or schedule_reference. Defaults to user_reference. For multiple users as example, repeat the target.
id str
A target ID
type str
Can be user, schedule, user_reference or schedule_reference. Defaults to user_reference. For multiple users as example, repeat the target.

Import

Escalation policies can be imported using the id, e.g.

 $ pulumi import pagerduty:index/escalationPolicy:EscalationPolicy main PLBP09X

Package Details

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