Extension

An extension can be associated with a service.

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,
            },
            Config = @"{
	""restrict"": ""any"",
	""notify_types"": {
			""resolve"": false,
			""acknowledge"": false,
			""assignments"": false
	},
	""access_token"": ""XXX""
}
",
        });
    }

}

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],
    config="""{
	"restrict": "any",
	"notify_types": {
			"resolve": false,
			"acknowledge": false,
			"assignments": false
	},
	"access_token": "XXX"
}
""")
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],
    config: `{
	"restrict": "any",
	"notify_types": {
			"resolve": false,
			"acknowledge": false,
			"assignments": false
	},
	"access_token": "XXX"
}
`,
});

Create a Extension Resource

new Extension(name: string, args: ExtensionArgs, opts?: CustomResourceOptions);
@overload
def Extension(resource_name: str,
              opts: Optional[ResourceOptions] = None,
              config: Optional[str] = None,
              endpoint_url: Optional[str] = None,
              extension_objects: Optional[Sequence[str]] = None,
              extension_schema: Optional[str] = None,
              name: Optional[str] = None,
              type: Optional[str] = None)
@overload
def Extension(resource_name: str,
              args: ExtensionArgs,
              opts: Optional[ResourceOptions] = None)
func NewExtension(ctx *Context, name string, args ExtensionArgs, opts ...ResourceOption) (*Extension, error)
public Extension(string name, ExtensionArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args ExtensionArgs
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 ExtensionArgs
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 ExtensionArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args ExtensionArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

Extension Resource Properties

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

Inputs

The Extension resource accepts the following input properties:

ExtensionObjects List<string>
This is the objects for which the extension applies (An array of service ids).
ExtensionSchema string
This is the schema for this extension.
Config string
The configuration of the service extension as string containing plain JSON-encoded data.
EndpointUrl string
The url of the extension. Note: The endpoint URL is Optional API wise in most cases. But in some cases it is a Required parameter. For example, pagerduty.getExtensionSchema named Generic V2 Webhook doesn’t accept pagerduty.Extension with no endpoint_url, but one with named Slack accepts.
Name string
The name of the service extension.
Type string
ExtensionObjects []string
This is the objects for which the extension applies (An array of service ids).
ExtensionSchema string
This is the schema for this extension.
Config string
The configuration of the service extension as string containing plain JSON-encoded data.
EndpointUrl string
The url of the extension. Note: The endpoint URL is Optional API wise in most cases. But in some cases it is a Required parameter. For example, pagerduty.getExtensionSchema named Generic V2 Webhook doesn’t accept pagerduty.Extension with no endpoint_url, but one with named Slack accepts.
Name string
The name of the service extension.
Type string
extensionObjects string[]
This is the objects for which the extension applies (An array of service ids).
extensionSchema string
This is the schema for this extension.
config string
The configuration of the service extension as string containing plain JSON-encoded data.
endpointUrl string
The url of the extension. Note: The endpoint URL is Optional API wise in most cases. But in some cases it is a Required parameter. For example, pagerduty.getExtensionSchema named Generic V2 Webhook doesn’t accept pagerduty.Extension with no endpoint_url, but one with named Slack accepts.
name string
The name of the service extension.
type string
extension_objects Sequence[str]
This is the objects for which the extension applies (An array of service ids).
extension_schema str
This is the schema for this extension.
config str
The configuration of the service extension as string containing plain JSON-encoded data.
endpoint_url str
The url of the extension. Note: The endpoint URL is Optional API wise in most cases. But in some cases it is a Required parameter. For example, pagerduty.getExtensionSchema named Generic V2 Webhook doesn’t accept pagerduty.Extension with no endpoint_url, but one with named Slack accepts.
name str
The name of the service extension.
type str

Outputs

All input properties are implicitly available as output properties. Additionally, the Extension resource produces the following output properties:

HtmlUrl string
URL at which the entity is uniquely displayed in the Web app
Id string
The provider-assigned unique ID for this managed resource.
HtmlUrl string
URL at which the entity is uniquely displayed in the Web app
Id string
The provider-assigned unique ID for this managed resource.
htmlUrl string
URL at which the entity is uniquely displayed in the Web app
id string
The provider-assigned unique ID for this managed resource.
html_url str
URL at which the entity is uniquely displayed in the Web app
id str
The provider-assigned unique ID for this managed resource.

Look up an Existing Extension Resource

Get an existing Extension 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?: ExtensionState, opts?: CustomResourceOptions): Extension
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        config: Optional[str] = None,
        endpoint_url: Optional[str] = None,
        extension_objects: Optional[Sequence[str]] = None,
        extension_schema: Optional[str] = None,
        html_url: Optional[str] = None,
        name: Optional[str] = None,
        type: Optional[str] = None) -> Extension
func GetExtension(ctx *Context, name string, id IDInput, state *ExtensionState, opts ...ResourceOption) (*Extension, error)
public static Extension Get(string name, Input<string> id, ExtensionState? 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:

Config string
The configuration of the service extension as string containing plain JSON-encoded data.
EndpointUrl string
The url of the extension. Note: The endpoint URL is Optional API wise in most cases. But in some cases it is a Required parameter. For example, pagerduty.getExtensionSchema named Generic V2 Webhook doesn’t accept pagerduty.Extension with no endpoint_url, but one with named Slack accepts.
ExtensionObjects List<string>
This is the objects for which the extension applies (An array of service ids).
ExtensionSchema string
This is the schema for this extension.
HtmlUrl string
URL at which the entity is uniquely displayed in the Web app
Name string
The name of the service extension.
Type string
Config string
The configuration of the service extension as string containing plain JSON-encoded data.
EndpointUrl string
The url of the extension. Note: The endpoint URL is Optional API wise in most cases. But in some cases it is a Required parameter. For example, pagerduty.getExtensionSchema named Generic V2 Webhook doesn’t accept pagerduty.Extension with no endpoint_url, but one with named Slack accepts.
ExtensionObjects []string
This is the objects for which the extension applies (An array of service ids).
ExtensionSchema string
This is the schema for this extension.
HtmlUrl string
URL at which the entity is uniquely displayed in the Web app
Name string
The name of the service extension.
Type string
config string
The configuration of the service extension as string containing plain JSON-encoded data.
endpointUrl string
The url of the extension. Note: The endpoint URL is Optional API wise in most cases. But in some cases it is a Required parameter. For example, pagerduty.getExtensionSchema named Generic V2 Webhook doesn’t accept pagerduty.Extension with no endpoint_url, but one with named Slack accepts.
extensionObjects string[]
This is the objects for which the extension applies (An array of service ids).
extensionSchema string
This is the schema for this extension.
htmlUrl string
URL at which the entity is uniquely displayed in the Web app
name string
The name of the service extension.
type string
config str
The configuration of the service extension as string containing plain JSON-encoded data.
endpoint_url str
The url of the extension. Note: The endpoint URL is Optional API wise in most cases. But in some cases it is a Required parameter. For example, pagerduty.getExtensionSchema named Generic V2 Webhook doesn’t accept pagerduty.Extension with no endpoint_url, but one with named Slack accepts.
extension_objects Sequence[str]
This is the objects for which the extension applies (An array of service ids).
extension_schema str
This is the schema for this extension.
html_url str
URL at which the entity is uniquely displayed in the Web app
name str
The name of the service extension.
type str

Import

Extensions can be imported using the id.e.g.

 $ pulumi import pagerduty:index/extension:Extension 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.