UNPKG

@pulumi/pagerduty

Version:

A Pulumi package for creating and managing pagerduty cloud resources.

210 lines (209 loc) 8.12 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "./types/input"; import * as outputs from "./types/output"; /** * A [webhook subscription](https://developer.pagerduty.com/docs/ZG9jOjExMDI5NTkw-v3-overview) allow you to receive HTTP callbacks when incidents are created, updated and deleted. These are also known as V3 Webhooks. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as pagerduty from "@pulumi/pagerduty"; * * const example = pagerduty.getService({ * name: "My Service", * }); * const foo = new pagerduty.WebhookSubscription("foo", { * deliveryMethods: [{ * type: "http_delivery_method", * url: "https://example.com/receive_a_pagerduty_webhook", * customHeaders: [ * { * name: "X-Foo", * value: "foo", * }, * { * name: "X-Bar", * value: "bar", * }, * ], * }], * description: "%s", * events: [ * "incident.acknowledged", * "incident.annotated", * "incident.delegated", * "incident.escalated", * "incident.priority_updated", * "incident.reassigned", * "incident.reopened", * "incident.resolved", * "incident.responder.added", * "incident.responder.replied", * "incident.status_update_published", * "incident.triggered", * "incident.unacknowledged", * ], * active: true, * filters: [{ * id: example.then(example => example.id), * type: "service_reference", * }], * type: "webhook_subscription", * }); * ``` * * ## Import * * Webhook Subscriptions can be imported using the `id`, e.g. * * ```sh * $ pulumi import pagerduty:index/webhookSubscription:WebhookSubscription main PUABCDL * ``` */ export declare class WebhookSubscription extends pulumi.CustomResource { /** * Get an existing WebhookSubscription resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input<pulumi.ID>, state?: WebhookSubscriptionState, opts?: pulumi.CustomResourceOptions): WebhookSubscription; /** * Returns true if the given object is an instance of WebhookSubscription. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is WebhookSubscription; /** * Determines whether the subscription will produce webhook events. */ readonly active: pulumi.Output<boolean>; /** * The object describing where to send the webhooks. */ readonly deliveryMethods: pulumi.Output<outputs.WebhookSubscriptionDeliveryMethod[]>; /** * A short description of the webhook subscription */ readonly description: pulumi.Output<string | undefined>; /** * A set of outbound event types the webhook will receive. The follow event types are possible: * * `incident.acknowledged` * * `incident.annotated` * * `incident.delegated` * * `incident.escalated` * * `incident.priority_updated` * * `incident.reassigned` * * `incident.reopened` * * `incident.resolved` * * `incident.responder.added` * * `incident.responder.replied` * * `incident.status_update_published` * * `incident.triggered` * * `incident.unacknowledged` */ readonly events: pulumi.Output<string[]>; /** * determines which events will match and produce a webhook. There are currently three types of filters that can be applied to webhook subscriptions: `serviceReference`, `teamReference` and `accountReference`. */ readonly filters: pulumi.Output<outputs.WebhookSubscriptionFilter[]>; /** * The type indicating the schema of the object. The provider sets this as `webhookSubscription`, which is currently the only acceptable value. */ readonly type: pulumi.Output<string | undefined>; /** * Create a WebhookSubscription resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: WebhookSubscriptionArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering WebhookSubscription resources. */ export interface WebhookSubscriptionState { /** * Determines whether the subscription will produce webhook events. */ active?: pulumi.Input<boolean>; /** * The object describing where to send the webhooks. */ deliveryMethods?: pulumi.Input<pulumi.Input<inputs.WebhookSubscriptionDeliveryMethod>[]>; /** * A short description of the webhook subscription */ description?: pulumi.Input<string>; /** * A set of outbound event types the webhook will receive. The follow event types are possible: * * `incident.acknowledged` * * `incident.annotated` * * `incident.delegated` * * `incident.escalated` * * `incident.priority_updated` * * `incident.reassigned` * * `incident.reopened` * * `incident.resolved` * * `incident.responder.added` * * `incident.responder.replied` * * `incident.status_update_published` * * `incident.triggered` * * `incident.unacknowledged` */ events?: pulumi.Input<pulumi.Input<string>[]>; /** * determines which events will match and produce a webhook. There are currently three types of filters that can be applied to webhook subscriptions: `serviceReference`, `teamReference` and `accountReference`. */ filters?: pulumi.Input<pulumi.Input<inputs.WebhookSubscriptionFilter>[]>; /** * The type indicating the schema of the object. The provider sets this as `webhookSubscription`, which is currently the only acceptable value. */ type?: pulumi.Input<string>; } /** * The set of arguments for constructing a WebhookSubscription resource. */ export interface WebhookSubscriptionArgs { /** * Determines whether the subscription will produce webhook events. */ active?: pulumi.Input<boolean>; /** * The object describing where to send the webhooks. */ deliveryMethods: pulumi.Input<pulumi.Input<inputs.WebhookSubscriptionDeliveryMethod>[]>; /** * A short description of the webhook subscription */ description?: pulumi.Input<string>; /** * A set of outbound event types the webhook will receive. The follow event types are possible: * * `incident.acknowledged` * * `incident.annotated` * * `incident.delegated` * * `incident.escalated` * * `incident.priority_updated` * * `incident.reassigned` * * `incident.reopened` * * `incident.resolved` * * `incident.responder.added` * * `incident.responder.replied` * * `incident.status_update_published` * * `incident.triggered` * * `incident.unacknowledged` */ events: pulumi.Input<pulumi.Input<string>[]>; /** * determines which events will match and produce a webhook. There are currently three types of filters that can be applied to webhook subscriptions: `serviceReference`, `teamReference` and `accountReference`. */ filters: pulumi.Input<pulumi.Input<inputs.WebhookSubscriptionFilter>[]>; /** * The type indicating the schema of the object. The provider sets this as `webhookSubscription`, which is currently the only acceptable value. */ type?: pulumi.Input<string>; }