PagerDuty v4.17.0 published on Wednesday, Nov 20, 2024 by Pulumi
pagerduty.getEscalationPolicy
Explore with Pulumi AI
Use this data source to get information about a specific escalation policy that you can use for other PagerDuty resources.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as pagerduty from "@pulumi/pagerduty";
const test = pagerduty.getEscalationPolicy({
name: "Engineering Escalation Policy",
});
const testService = new pagerduty.Service("test", {
name: "My Web App",
autoResolveTimeout: "14400",
acknowledgementTimeout: "600",
escalationPolicy: test.then(test => test.id),
});
import pulumi
import pulumi_pagerduty as pagerduty
test = pagerduty.get_escalation_policy(name="Engineering Escalation Policy")
test_service = pagerduty.Service("test",
name="My Web App",
auto_resolve_timeout="14400",
acknowledgement_timeout="600",
escalation_policy=test.id)
package main
import (
"github.com/pulumi/pulumi-pagerduty/sdk/v4/go/pagerduty"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
test, err := pagerduty.LookupEscalationPolicy(ctx, &pagerduty.LookupEscalationPolicyArgs{
Name: "Engineering Escalation Policy",
}, nil)
if err != nil {
return err
}
_, err = pagerduty.NewService(ctx, "test", &pagerduty.ServiceArgs{
Name: pulumi.String("My Web App"),
AutoResolveTimeout: pulumi.String("14400"),
AcknowledgementTimeout: pulumi.String("600"),
EscalationPolicy: pulumi.String(test.Id),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Pagerduty = Pulumi.Pagerduty;
return await Deployment.RunAsync(() =>
{
var test = Pagerduty.GetEscalationPolicy.Invoke(new()
{
Name = "Engineering Escalation Policy",
});
var testService = new Pagerduty.Service("test", new()
{
Name = "My Web App",
AutoResolveTimeout = "14400",
AcknowledgementTimeout = "600",
EscalationPolicy = test.Apply(getEscalationPolicyResult => getEscalationPolicyResult.Id),
});
});
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 test = PagerdutyFunctions.getEscalationPolicy(GetEscalationPolicyArgs.builder()
.name("Engineering Escalation Policy")
.build());
var testService = new Service("testService", ServiceArgs.builder()
.name("My Web App")
.autoResolveTimeout(14400)
.acknowledgementTimeout(600)
.escalationPolicy(test.applyValue(getEscalationPolicyResult -> getEscalationPolicyResult.id()))
.build());
}
}
resources:
testService:
type: pagerduty:Service
name: test
properties:
name: My Web App
autoResolveTimeout: 14400
acknowledgementTimeout: 600
escalationPolicy: ${test.id}
variables:
test:
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:
Package Details
- Repository
- PagerDuty pulumi/pulumi-pagerduty
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
pagerduty
Terraform Provider.