@pulumi/pagerduty
Version:
A Pulumi package for creating and managing pagerduty cloud resources.
336 lines (335 loc) • 13.9 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "./types/input";
import * as outputs from "./types/output";
/**
* A [service integration](https://developer.pagerduty.com/api-reference/reference/REST/openapiv3.json/paths/~1services~1%7Bid%7D~1integrations/post) is an integration that belongs to a service.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pagerduty from "@pulumi/pagerduty";
*
* const example = new pagerduty.User("example", {
* name: "Earline Greenholt",
* email: "125.greenholt.earline@graham.name",
* teams: [examplePagerdutyTeam.id],
* });
* const foo = new pagerduty.EscalationPolicy("foo", {
* name: "Engineering Escalation Policy",
* numLoops: 2,
* rules: [{
* escalationDelayInMinutes: 10,
* targets: [{
* type: "user",
* id: example.id,
* }],
* }],
* });
* const exampleService = new pagerduty.Service("example", {
* name: "My Web App",
* autoResolveTimeout: "14400",
* acknowledgementTimeout: "600",
* escalationPolicy: examplePagerdutyEscalationPolicy.id,
* });
* const exampleServiceIntegration = new pagerduty.ServiceIntegration("example", {
* name: "Generic API Service Integration",
* type: "generic_events_api_inbound_integration",
* service: exampleService.id,
* });
* const apiv2 = new pagerduty.ServiceIntegration("apiv2", {
* name: "API V2",
* type: "events_api_v2_inbound_integration",
* service: exampleService.id,
* });
* const emailX = new pagerduty.ServiceIntegration("email_x", {
* name: "Email X",
* type: "generic_email_inbound_integration",
* integrationEmail: "ecommerce@subdomain.pagerduty.com",
* service: exampleService.id,
* });
* const datadog = pagerduty.getVendor({
* name: "Datadog",
* });
* const datadogServiceIntegration = new pagerduty.ServiceIntegration("datadog", {
* name: datadog.then(datadog => datadog.name),
* service: exampleService.id,
* vendor: datadog.then(datadog => datadog.id),
* });
* const cloudwatch = pagerduty.getVendor({
* name: "Cloudwatch",
* });
* const cloudwatchServiceIntegration = new pagerduty.ServiceIntegration("cloudwatch", {
* name: cloudwatch.then(cloudwatch => cloudwatch.name),
* service: exampleService.id,
* vendor: cloudwatch.then(cloudwatch => cloudwatch.id),
* });
* const email = pagerduty.getVendor({
* name: "Email",
* });
* const emailServiceIntegration = new pagerduty.ServiceIntegration("email", {
* name: email.then(email => email.name),
* service: exampleService.id,
* vendor: email.then(email => email.id),
* integrationEmail: "s1@your_account.pagerduty.com",
* emailIncidentCreation: "use_rules",
* emailFilterMode: "and-rules-email",
* emailFilters: [
* {
* bodyMode: "always",
* bodyRegex: null,
* fromEmailMode: "match",
* fromEmailRegex: "(@foo.test*)",
* subjectMode: "match",
* subjectRegex: "(CRITICAL*)",
* },
* {
* bodyMode: "always",
* bodyRegex: null,
* fromEmailMode: "match",
* fromEmailRegex: "(@bar.com*)",
* subjectMode: "match",
* subjectRegex: "(CRITICAL*)",
* },
* ],
* emailParsers: [{
* action: "resolve",
* matchPredicate: {
* type: "any",
* predicates: [
* {
* matcher: "foo",
* part: "subject",
* type: "contains",
* },
* {
* type: "not",
* predicates: [{
* matcher: "(bar*)",
* part: "body",
* type: "regex",
* }],
* },
* ],
* },
* valueExtractors: [
* {
* endsBefore: "end",
* part: "subject",
* startsAfter: "start",
* type: "between",
* valueName: "incident_key",
* },
* {
* endsBefore: "end",
* part: "subject",
* startsAfter: "start",
* type: "between",
* valueName: "FieldName1",
* },
* ],
* }],
* });
* ```
*
* ## Import
*
* Services can be imported using their related `service` id and service integration `id` separated by a dot, e.g.
*
* ```sh
* $ pulumi import pagerduty:index/serviceIntegration:ServiceIntegration main PLSSSSS.PLIIIII
* ```
*/
export declare class ServiceIntegration extends pulumi.CustomResource {
/**
* Get an existing ServiceIntegration 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?: ServiceIntegrationState, opts?: pulumi.CustomResourceOptions): ServiceIntegration;
/**
* Returns true if the given object is an instance of ServiceIntegration. 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 ServiceIntegration;
/**
* Mode of Emails Filters feature ([explained in PD docs](https://support.pagerduty.com/docs/email-management-filters-and-rules#configure-a-regex-filter)). Can be `all-email`, `or-rules-email` or `and-rules-email`.
*/
readonly emailFilterMode: pulumi.Output<string>;
readonly emailFilters: pulumi.Output<outputs.ServiceIntegrationEmailFilter[]>;
/**
* Behaviour of Email Management feature ([explained in PD docs](https://support.pagerduty.com/docs/email-management-filters-and-rules#control-when-a-new-incident-or-alert-is-triggered)). Can be `onNewEmail`, `onNewEmailSubject`, `onlyIfNoOpenIncidents` or `useRules`.
*/
readonly emailIncidentCreation: pulumi.Output<string>;
readonly emailParsers: pulumi.Output<outputs.ServiceIntegrationEmailParser[] | undefined>;
/**
* Can be `openNewIncident` or `discard`.
*/
readonly emailParsingFallback: pulumi.Output<string>;
/**
* URL at which the entity is uniquely displayed in the Web app.
*/
readonly htmlUrl: pulumi.Output<string>;
/**
* This is the unique fully-qualified email address used for routing emails to this integration for processing.
*/
readonly integrationEmail: pulumi.Output<string>;
/**
* (Deprecated) This is the unique key used to route events to this integration when received via the PagerDuty Events API.
*/
readonly integrationKey: pulumi.Output<string>;
/**
* The name of the service integration.
*/
readonly name: pulumi.Output<string>;
/**
* The ID of the service the integration should belong to.
*/
readonly service: pulumi.Output<string>;
/**
* The service type. Can be:
* `awsCloudwatchInboundIntegration`,
* `cloudkickInboundIntegration`,
* `eventTransformerApiInboundIntegration`,
* `eventsApiV2InboundIntegration` (requires service `alertCreation` to be `createAlertsAndIncidents`),
* `genericEmailInboundIntegration`,
* `genericEventsApiInboundIntegration`,
* `keynoteInboundIntegration`,
* `nagiosInboundIntegration`,
* `pingdomInboundIntegration`or `sqlMonitorInboundIntegration`.
*
* **Note:** This is meant for **generic** service integrations.
* To integrate with a **vendor** (e.g. Datadog or Amazon Cloudwatch) use the `vendor` field instead.
*/
readonly type: pulumi.Output<string>;
/**
* The ID of the vendor the integration should integrate with (e.g. Datadog or Amazon Cloudwatch).
*/
readonly vendor: pulumi.Output<string>;
/**
* Create a ServiceIntegration 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: ServiceIntegrationArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering ServiceIntegration resources.
*/
export interface ServiceIntegrationState {
/**
* Mode of Emails Filters feature ([explained in PD docs](https://support.pagerduty.com/docs/email-management-filters-and-rules#configure-a-regex-filter)). Can be `all-email`, `or-rules-email` or `and-rules-email`.
*/
emailFilterMode?: pulumi.Input<string>;
emailFilters?: pulumi.Input<pulumi.Input<inputs.ServiceIntegrationEmailFilter>[]>;
/**
* Behaviour of Email Management feature ([explained in PD docs](https://support.pagerduty.com/docs/email-management-filters-and-rules#control-when-a-new-incident-or-alert-is-triggered)). Can be `onNewEmail`, `onNewEmailSubject`, `onlyIfNoOpenIncidents` or `useRules`.
*/
emailIncidentCreation?: pulumi.Input<string>;
emailParsers?: pulumi.Input<pulumi.Input<inputs.ServiceIntegrationEmailParser>[]>;
/**
* Can be `openNewIncident` or `discard`.
*/
emailParsingFallback?: pulumi.Input<string>;
/**
* URL at which the entity is uniquely displayed in the Web app.
*/
htmlUrl?: pulumi.Input<string>;
/**
* This is the unique fully-qualified email address used for routing emails to this integration for processing.
*/
integrationEmail?: pulumi.Input<string>;
/**
* (Deprecated) This is the unique key used to route events to this integration when received via the PagerDuty Events API.
*/
integrationKey?: pulumi.Input<string>;
/**
* The name of the service integration.
*/
name?: pulumi.Input<string>;
/**
* The ID of the service the integration should belong to.
*/
service?: pulumi.Input<string>;
/**
* The service type. Can be:
* `awsCloudwatchInboundIntegration`,
* `cloudkickInboundIntegration`,
* `eventTransformerApiInboundIntegration`,
* `eventsApiV2InboundIntegration` (requires service `alertCreation` to be `createAlertsAndIncidents`),
* `genericEmailInboundIntegration`,
* `genericEventsApiInboundIntegration`,
* `keynoteInboundIntegration`,
* `nagiosInboundIntegration`,
* `pingdomInboundIntegration`or `sqlMonitorInboundIntegration`.
*
* **Note:** This is meant for **generic** service integrations.
* To integrate with a **vendor** (e.g. Datadog or Amazon Cloudwatch) use the `vendor` field instead.
*/
type?: pulumi.Input<string>;
/**
* The ID of the vendor the integration should integrate with (e.g. Datadog or Amazon Cloudwatch).
*/
vendor?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a ServiceIntegration resource.
*/
export interface ServiceIntegrationArgs {
/**
* Mode of Emails Filters feature ([explained in PD docs](https://support.pagerduty.com/docs/email-management-filters-and-rules#configure-a-regex-filter)). Can be `all-email`, `or-rules-email` or `and-rules-email`.
*/
emailFilterMode?: pulumi.Input<string>;
emailFilters?: pulumi.Input<pulumi.Input<inputs.ServiceIntegrationEmailFilter>[]>;
/**
* Behaviour of Email Management feature ([explained in PD docs](https://support.pagerduty.com/docs/email-management-filters-and-rules#control-when-a-new-incident-or-alert-is-triggered)). Can be `onNewEmail`, `onNewEmailSubject`, `onlyIfNoOpenIncidents` or `useRules`.
*/
emailIncidentCreation?: pulumi.Input<string>;
emailParsers?: pulumi.Input<pulumi.Input<inputs.ServiceIntegrationEmailParser>[]>;
/**
* Can be `openNewIncident` or `discard`.
*/
emailParsingFallback?: pulumi.Input<string>;
/**
* This is the unique fully-qualified email address used for routing emails to this integration for processing.
*/
integrationEmail?: pulumi.Input<string>;
/**
* (Deprecated) This is the unique key used to route events to this integration when received via the PagerDuty Events API.
*/
integrationKey?: pulumi.Input<string>;
/**
* The name of the service integration.
*/
name?: pulumi.Input<string>;
/**
* The ID of the service the integration should belong to.
*/
service: pulumi.Input<string>;
/**
* The service type. Can be:
* `awsCloudwatchInboundIntegration`,
* `cloudkickInboundIntegration`,
* `eventTransformerApiInboundIntegration`,
* `eventsApiV2InboundIntegration` (requires service `alertCreation` to be `createAlertsAndIncidents`),
* `genericEmailInboundIntegration`,
* `genericEventsApiInboundIntegration`,
* `keynoteInboundIntegration`,
* `nagiosInboundIntegration`,
* `pingdomInboundIntegration`or `sqlMonitorInboundIntegration`.
*
* **Note:** This is meant for **generic** service integrations.
* To integrate with a **vendor** (e.g. Datadog or Amazon Cloudwatch) use the `vendor` field instead.
*/
type?: pulumi.Input<string>;
/**
* The ID of the vendor the integration should integrate with (e.g. Datadog or Amazon Cloudwatch).
*/
vendor?: pulumi.Input<string>;
}