PagerDuty

Pulumi Official
Package maintained by Pulumi
v3.4.1 published on Thursday, May 26, 2022 by Pulumi

getExtensionSchema

Use this data source to get information about a specific extension vendor that you can use for a service (e.g: Slack, Generic Webhook, ServiceNow).

Example Usage

using Pulumi;
using Pagerduty = Pulumi.Pagerduty;

class MyStack : Stack
{
    public MyStack()
    {
        var webhook = Output.Create(Pagerduty.GetExtensionSchema.InvokeAsync(new Pagerduty.GetExtensionSchemaArgs
        {
            Name = "Generic V2 Webhook",
        }));
        var exampleUser = new Pagerduty.User("exampleUser", new Pagerduty.UserArgs
        {
            Email = "howard.james@example.domain",
            Teams = 
            {
                pagerduty_team.Example.Id,
            },
        });
        var foo = new Pagerduty.EscalationPolicy("foo", new Pagerduty.EscalationPolicyArgs
        {
            NumLoops = 2,
            Rules = 
            {
                new Pagerduty.Inputs.EscalationPolicyRuleArgs
                {
                    EscalationDelayInMinutes = 10,
                    Targets = 
                    {
                        new Pagerduty.Inputs.EscalationPolicyRuleTargetArgs
                        {
                            Type = "user",
                            Id = exampleUser.Id,
                        },
                    },
                },
            },
        });
        var exampleService = new Pagerduty.Service("exampleService", new Pagerduty.ServiceArgs
        {
            AutoResolveTimeout = "14400",
            AcknowledgementTimeout = "600",
            EscalationPolicy = pagerduty_escalation_policy.Example.Id,
        });
        var slack = new Pagerduty.Extension("slack", new Pagerduty.ExtensionArgs
        {
            EndpointUrl = "https://generic_webhook_url/XXXXXX/BBBBBB",
            ExtensionSchema = webhook.Apply(webhook => webhook.Id),
            ExtensionObjects = 
            {
                exampleService.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 {
		webhook, err := pagerduty.GetExtensionSchema(ctx, &GetExtensionSchemaArgs{
			Name: "Generic V2 Webhook",
		}, nil)
		if err != nil {
			return err
		}
		exampleUser, err := pagerduty.NewUser(ctx, "exampleUser", &pagerduty.UserArgs{
			Email: pulumi.String("howard.james@example.domain"),
			Teams: pulumi.StringArray{
				pulumi.Any(pagerduty_team.Example.Id),
			},
		})
		if err != nil {
			return err
		}
		_, err = pagerduty.NewEscalationPolicy(ctx, "foo", &pagerduty.EscalationPolicyArgs{
			NumLoops: pulumi.Int(2),
			Rules: EscalationPolicyRuleArray{
				&EscalationPolicyRuleArgs{
					EscalationDelayInMinutes: pulumi.Int(10),
					Targets: EscalationPolicyRuleTargetArray{
						&EscalationPolicyRuleTargetArgs{
							Type: pulumi.String("user"),
							Id:   exampleUser.ID(),
						},
					},
				},
			},
		})
		if err != nil {
			return err
		}
		exampleService, err := pagerduty.NewService(ctx, "exampleService", &pagerduty.ServiceArgs{
			AutoResolveTimeout:     pulumi.String("14400"),
			AcknowledgementTimeout: pulumi.String("600"),
			EscalationPolicy:       pulumi.Any(pagerduty_escalation_policy.Example.Id),
		})
		if err != nil {
			return err
		}
		_, err = pagerduty.NewExtension(ctx, "slack", &pagerduty.ExtensionArgs{
			EndpointUrl:     pulumi.String("https://generic_webhook_url/XXXXXX/BBBBBB"),
			ExtensionSchema: pulumi.String(webhook.Id),
			ExtensionObjects: pulumi.StringArray{
				exampleService.ID(),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}

Coming soon!

import pulumi
import pulumi_pagerduty as pagerduty

webhook = pagerduty.get_extension_schema(name="Generic V2 Webhook")
example_user = pagerduty.User("exampleUser",
    email="howard.james@example.domain",
    teams=[pagerduty_team["example"]["id"]])
foo = pagerduty.EscalationPolicy("foo",
    num_loops=2,
    rules=[pagerduty.EscalationPolicyRuleArgs(
        escalation_delay_in_minutes=10,
        targets=[pagerduty.EscalationPolicyRuleTargetArgs(
            type="user",
            id=example_user.id,
        )],
    )])
example_service = pagerduty.Service("exampleService",
    auto_resolve_timeout="14400",
    acknowledgement_timeout="600",
    escalation_policy=pagerduty_escalation_policy["example"]["id"])
slack = pagerduty.Extension("slack",
    endpoint_url="https://generic_webhook_url/XXXXXX/BBBBBB",
    extension_schema=webhook.id,
    extension_objects=[example_service.id])
import * as pulumi from "@pulumi/pulumi";
import * as pagerduty from "@pulumi/pagerduty";

const webhook = pagerduty.getExtensionSchema({
    name: "Generic V2 Webhook",
});
const exampleUser = new pagerduty.User("exampleUser", {
    email: "howard.james@example.domain",
    teams: [pagerduty_team.example.id],
});
const foo = new pagerduty.EscalationPolicy("foo", {
    numLoops: 2,
    rules: [{
        escalationDelayInMinutes: 10,
        targets: [{
            type: "user",
            id: exampleUser.id,
        }],
    }],
});
const exampleService = new pagerduty.Service("exampleService", {
    autoResolveTimeout: "14400",
    acknowledgementTimeout: "600",
    escalationPolicy: pagerduty_escalation_policy.example.id,
});
const slack = new pagerduty.Extension("slack", {
    endpointUrl: "https://generic_webhook_url/XXXXXX/BBBBBB",
    extensionSchema: webhook.then(webhook => webhook.id),
    extensionObjects: [exampleService.id],
});

Coming soon!

Using getExtensionSchema

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 getExtensionSchema(args: GetExtensionSchemaArgs, opts?: InvokeOptions): Promise<GetExtensionSchemaResult>
function getExtensionSchemaOutput(args: GetExtensionSchemaOutputArgs, opts?: InvokeOptions): Output<GetExtensionSchemaResult>
def get_extension_schema(name: Optional[str] = None,
                         opts: Optional[InvokeOptions] = None) -> GetExtensionSchemaResult
def get_extension_schema_output(name: Optional[pulumi.Input[str]] = None,
                         opts: Optional[InvokeOptions] = None) -> Output[GetExtensionSchemaResult]
func GetExtensionSchema(ctx *Context, args *GetExtensionSchemaArgs, opts ...InvokeOption) (*GetExtensionSchemaResult, error)
func GetExtensionSchemaOutput(ctx *Context, args *GetExtensionSchemaOutputArgs, opts ...InvokeOption) GetExtensionSchemaResultOutput

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

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

The following arguments are supported:

Name string

The extension name to use to find an extension vendor in the PagerDuty API.

Name string

The extension name to use to find an extension vendor in the PagerDuty API.

name String

The extension name to use to find an extension vendor in the PagerDuty API.

name string

The extension name to use to find an extension vendor in the PagerDuty API.

name str

The extension name to use to find an extension vendor in the PagerDuty API.

name String

The extension name to use to find an extension vendor in the PagerDuty API.

getExtensionSchema 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 extension vendor.

Type string

The generic service type for this extension vendor.

Id string

The provider-assigned unique ID for this managed resource.

Name string

The short name of the found extension vendor.

Type string

The generic service type for this extension vendor.

id String

The provider-assigned unique ID for this managed resource.

name String

The short name of the found extension vendor.

type String

The generic service type for this extension vendor.

id string

The provider-assigned unique ID for this managed resource.

name string

The short name of the found extension vendor.

type string

The generic service type for this extension vendor.

id str

The provider-assigned unique ID for this managed resource.

name str

The short name of the found extension vendor.

type str

The generic service type for this extension vendor.

id String

The provider-assigned unique ID for this managed resource.

name String

The short name of the found extension vendor.

type String

The generic service type for this extension vendor.

Package Details

Repository
https://github.com/pulumi/pulumi-pagerduty
License
Apache-2.0
Notes

This Pulumi package is based on the pagerduty Terraform Provider.