PagerDuty

Pulumi Official
Package maintained by Pulumi
v3.5.1 published on Thursday, Aug 4, 2022 by Pulumi

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/v3/go/pagerduty"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		testEscalationPolicy, err := pagerduty.LookupEscalationPolicy(ctx, &GetEscalationPolicyArgs{
			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
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.pagerduty.PagerdutyFunctions;
import com.pulumi.pagerduty.inputs.GetEscalationPolicyArgs;
import com.pulumi.pagerduty.Service;
import com.pulumi.pagerduty.ServiceArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var testEscalationPolicy = PagerdutyFunctions.getEscalationPolicy(GetEscalationPolicyArgs.builder()
            .name("Engineering Escalation Policy")
            .build());

        var testService = new Service("testService", ServiceArgs.builder()        
            .autoResolveTimeout(14400)
            .acknowledgementTimeout(600)
            .escalationPolicy(testEscalationPolicy.applyValue(getEscalationPolicyResult -> getEscalationPolicyResult.id()))
            .build());

    }
}
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),
});
resources:
  testService:
    type: pagerduty:Service
    properties:
      autoResolveTimeout: 14400
      acknowledgementTimeout: 600
      escalationPolicy: ${testEscalationPolicy.id}
variables:
  testEscalationPolicy:
    Fn::Invoke:
      Function: pagerduty:getEscalationPolicy
      Arguments:
        name: Engineering Escalation Policy

Using getEscalationPolicy

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getEscalationPolicy(args: GetEscalationPolicyArgs, opts?: InvokeOptions): Promise<GetEscalationPolicyResult>
function getEscalationPolicyOutput(args: GetEscalationPolicyOutputArgs, opts?: InvokeOptions): Output<GetEscalationPolicyResult>
def get_escalation_policy(name: Optional[str] = None,
                          opts: Optional[InvokeOptions] = None) -> GetEscalationPolicyResult
def get_escalation_policy_output(name: Optional[pulumi.Input[str]] = None,
                          opts: Optional[InvokeOptions] = None) -> Output[GetEscalationPolicyResult]
func LookupEscalationPolicy(ctx *Context, args *LookupEscalationPolicyArgs, opts ...InvokeOption) (*LookupEscalationPolicyResult, error)
func LookupEscalationPolicyOutput(ctx *Context, args *LookupEscalationPolicyOutputArgs, opts ...InvokeOption) LookupEscalationPolicyResultOutput

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

public static class GetEscalationPolicy 
{
    public static Task<GetEscalationPolicyResult> InvokeAsync(GetEscalationPolicyArgs args, InvokeOptions? opts = null)
    public static Output<GetEscalationPolicyResult> Invoke(GetEscalationPolicyInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetEscalationPolicyResult> getEscalationPolicy(GetEscalationPolicyArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
Fn::Invoke:
  Function: pagerduty:index/getEscalationPolicy:getEscalationPolicy
  Arguments:
    # Arguments dictionary

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 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.

name String

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 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.

id String

The provider-assigned unique ID for this managed resource.

name String

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.