getEscalationPolicy

Use this data source to get information about a specific escalation policy that you can use for other PagerDuty resources.

Example Usage

using Pulumi;
using Pagerduty = Pulumi.Pagerduty;

class MyStack : Stack
{
    public MyStack()
    {
        var testEscalationPolicy = Output.Create(Pagerduty.GetEscalationPolicy.InvokeAsync(new Pagerduty.GetEscalationPolicyArgs
        {
            Name = "Engineering Escalation Policy",
        }));
        var testService = new Pagerduty.Service("testService", new Pagerduty.ServiceArgs
        {
            AutoResolveTimeout = "14400",
            AcknowledgementTimeout = "600",
            EscalationPolicy = testEscalationPolicy.Apply(testEscalationPolicy => testEscalationPolicy.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 {
		testEscalationPolicy, err := pagerduty.LookupEscalationPolicy(ctx, &pagerduty.LookupEscalationPolicyArgs{
			Name: "Engineering Escalation Policy",
		}, nil)
		if err != nil {
			return err
		}
		_, err = pagerduty.NewService(ctx, "testService", &pagerduty.ServiceArgs{
			AutoResolveTimeout:     pulumi.String("14400"),
			AcknowledgementTimeout: pulumi.String("600"),
			EscalationPolicy:       pulumi.String(testEscalationPolicy.Id),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_pagerduty as pagerduty

test_escalation_policy = pagerduty.get_escalation_policy(name="Engineering Escalation Policy")
test_service = pagerduty.Service("testService",
    auto_resolve_timeout="14400",
    acknowledgement_timeout="600",
    escalation_policy=test_escalation_policy.id)
import * as pulumi from "@pulumi/pulumi";
import * as pagerduty from "@pulumi/pagerduty";

const testEscalationPolicy = pagerduty.getEscalationPolicy({
    name: "Engineering Escalation Policy",
});
const testService = new pagerduty.Service("testService", {
    autoResolveTimeout: 14400,
    acknowledgementTimeout: 600,
    escalationPolicy: testEscalationPolicy.then(testEscalationPolicy => testEscalationPolicy.id),
});

Using getEscalationPolicy

function getEscalationPolicy(args: GetEscalationPolicyArgs, opts?: InvokeOptions): Promise<GetEscalationPolicyResult>
def get_escalation_policy(name: Optional[str] = None,
                          opts: Optional[InvokeOptions] = None) -> GetEscalationPolicyResult
func LookupEscalationPolicy(ctx *Context, args *LookupEscalationPolicyArgs, opts ...InvokeOption) (*LookupEscalationPolicyResult, error)

Note: This function is named LookupEscalationPolicy in the Go SDK.

public static class GetEscalationPolicy {
    public static Task<GetEscalationPolicyResult> InvokeAsync(GetEscalationPolicyArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

Name string
The name to use to find an escalation policy in the PagerDuty API.
Name string
The name to use to find an escalation policy in the PagerDuty API.
name string
The name to use to find an escalation policy in the PagerDuty API.
name str
The name to use to find an escalation policy in the PagerDuty API.

getEscalationPolicy Result

The following output properties are available:

Id string
The provider-assigned unique ID for this managed resource.
Name string
The short name of the found escalation policy.
Id string
The provider-assigned unique ID for this managed resource.
Name string
The short name of the found escalation policy.
id string
The provider-assigned unique ID for this managed resource.
name string
The short name of the found escalation policy.
id str
The provider-assigned unique ID for this managed resource.
name str
The short name of the found escalation policy.

Package Details

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