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,
Target =
{
{
{ "id", exampleUser.Id },
{ "type", "user" },
},
},
},
},
});
var exampleService = new Pagerduty.Service("exampleService", new Pagerduty.ServiceArgs
{
AcknowledgementTimeout = 600,
AutoResolveTimeout = 14400,
EscalationPolicy = pagerduty_escalation_policy.Example.Id,
});
var slack = new Pagerduty.Extension("slack", new Pagerduty.ExtensionArgs
{
Config = @"{
""restrict"": ""any"",
""notify_types"": {
""resolve"": false,
""acknowledge"": false,
""assignments"": false
},
""access_token"": ""XXX""
}
",
EndpointUrl = "https://generic_webhook_url/XXXXXX/BBBBBB",
ExtensionObjects =
{
exampleService.Id,
},
ExtensionSchema = webhook.Apply(webhook => webhook.Id),
});
}
}
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=[{
"escalationDelayInMinutes": 10,
"target": [{
"id": example_user.id,
"type": "user",
}],
}])
example_service = pagerduty.Service("exampleService",
acknowledgement_timeout=600,
auto_resolve_timeout=14400,
escalation_policy=pagerduty_escalation_policy["example"]["id"])
slack = pagerduty.Extension("slack",
config="""{
"restrict": "any",
"notify_types": {
"resolve": false,
"acknowledge": false,
"assignments": false
},
"access_token": "XXX"
}
""",
endpoint_url="https://generic_webhook_url/XXXXXX/BBBBBB",
extension_objects=[example_service.id],
extension_schema=webhook.id)import * as pulumi from "@pulumi/pulumi";
import * as pagerduty from "@pulumi/pagerduty";
const webhook = pulumi.output(pagerduty.getExtensionSchema({
name: "Generic V2 Webhook",
}, { async: true }));
const exampleUser = new pagerduty.User("example", {
email: "howard.james@example.domain",
teams: [pagerduty_team_example.id],
});
const foo = new pagerduty.EscalationPolicy("foo", {
numLoops: 2,
rules: [{
escalationDelayInMinutes: 10,
targets: [{
id: exampleUser.id,
type: "user",
}],
}],
});
const exampleService = new pagerduty.Service("example", {
acknowledgementTimeout: "600",
autoResolveTimeout: "14400",
escalationPolicy: pagerduty_escalation_policy_example.id,
});
const slack = new pagerduty.Extension("slack", {
config: `{
"restrict": "any",
"notify_types": {
"resolve": false,
"acknowledge": false,
"assignments": false
},
"access_token": "XXX"
}
`,
endpointUrl: "https://generic_webhook_url/XXXXXX/BBBBBB",
extensionObjects: [exampleService.id],
extensionSchema: webhook.id,
});Create a Extension Resource
new Extension(name: string, args: ExtensionArgs, opts?: CustomResourceOptions);def Extension(resource_name, opts=None, config=None, endpoint_url=None, extension_objects=None, extension_schema=None, name=None, type=None, __props__=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.
- opts ResourceOptions
- A bag of options that control this 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:
- Extension
Objects List<string> This is the objects for which the extension applies (An array of service ids).
- Extension
Schema string This is the schema for this extension.
- Config string
The configuration of the service extension as string containing plain JSON-encoded data.
- Endpoint
Url 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..getExtensionSchemanamedGeneric V2 Webhookdoesn’t acceptpagerduty..Extensionwith noendpoint_url, but one with namedSlackaccepts.- Name string
The name of the service extension.
- Type string
- Extension
Objects []string This is the objects for which the extension applies (An array of service ids).
- Extension
Schema string This is the schema for this extension.
- Config string
The configuration of the service extension as string containing plain JSON-encoded data.
- Endpoint
Url 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..getExtensionSchemanamedGeneric V2 Webhookdoesn’t acceptpagerduty..Extensionwith noendpoint_url, but one with namedSlackaccepts.- Name string
The name of the service extension.
- Type string
- extension
Objects string[] This is the objects for which the extension applies (An array of service ids).
- extension
Schema string This is the schema for this extension.
- config string
The configuration of the service extension as string containing plain JSON-encoded data.
- endpoint
Url 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..getExtensionSchemanamedGeneric V2 Webhookdoesn’t acceptpagerduty..Extensionwith noendpoint_url, but one with namedSlackaccepts.- name string
The name of the service extension.
- type string
- extension_
objects List[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..getExtensionSchemanamedGeneric V2 Webhookdoesn’t acceptpagerduty..Extensionwith noendpoint_url, but one with namedSlackaccepts.- 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:
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): Extensionstatic get(resource_name, id, opts=None, config=None, endpoint_url=None, extension_objects=None, extension_schema=None, html_url=None, name=None, type=None, __props__=None);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.
- Endpoint
Url 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..getExtensionSchemanamedGeneric V2 Webhookdoesn’t acceptpagerduty..Extensionwith noendpoint_url, but one with namedSlackaccepts.- Extension
Objects List<string> This is the objects for which the extension applies (An array of service ids).
- Extension
Schema string This is the schema for this extension.
- Html
Url 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.
- Endpoint
Url 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..getExtensionSchemanamedGeneric V2 Webhookdoesn’t acceptpagerduty..Extensionwith noendpoint_url, but one with namedSlackaccepts.- Extension
Objects []string This is the objects for which the extension applies (An array of service ids).
- Extension
Schema string This is the schema for this extension.
- Html
Url 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.
- endpoint
Url 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..getExtensionSchemanamedGeneric V2 Webhookdoesn’t acceptpagerduty..Extensionwith noendpoint_url, but one with namedSlackaccepts.- extension
Objects string[] This is the objects for which the extension applies (An array of service ids).
- extension
Schema string This is the schema for this extension.
- html
Url 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..getExtensionSchemanamedGeneric V2 Webhookdoesn’t acceptpagerduty..Extensionwith noendpoint_url, but one with namedSlackaccepts.- extension_
objects List[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
Package Details
- Repository
- https://github.com/pulumi/pulumi-pagerduty
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
pagerdutyTerraform Provider.