UNPKG

@pulumi/pagerduty

Version:

A Pulumi package for creating and managing pagerduty cloud resources.

192 lines • 7.54 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.JiraCloudAccountMappingRule = void 0; const pulumi = __importStar(require("@pulumi/pulumi")); const utilities = __importStar(require("./utilities")); /** * An Jira Cloud's account mapping [rule](https://developer.pagerduty.com/api-reference/85dc30ba966a6-create-a-rule) * configures the bidirectional synchronization between Jira issues and PagerDuty * incidents. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as pagerduty from "@pulumi/pagerduty"; * * const _default = pagerduty.getEscalationPolicy({ * name: "Default", * }); * const p1 = pagerduty.getPriority({ * name: "P1", * }); * const p2 = pagerduty.getPriority({ * name: "P2", * }); * const p3 = pagerduty.getPriority({ * name: "P3", * }); * const foo = new pagerduty.Service("foo", { * name: "My Web App", * escalationPolicy: _default.then(_default => _default.id), * }); * const fooUser = new pagerduty.User("foo", { * name: "Earline Greenholt", * email: "125.greenholt.earline@graham.name", * }); * const fooJiraCloudAccountMappingRule = new pagerduty.JiraCloudAccountMappingRule("foo", { * name: "Integration with My Web App", * accountMapping: "PLBP09X", * config: { * service: foo.id, * jira: { * autocreateJql: "priority = Highest", * createIssueOnIncidentTrigger: true, * customFields: [ * { * sourceIncidentField: "incident_description", * targetIssueField: "description", * targetIssueFieldName: "Description", * type: "attribute", * }, * { * targetIssueField: "security", * targetIssueFieldName: "Security Level", * type: "jira_value", * value: JSON.stringify({ * displayName: "Sec Level 1", * id: "10000", * }), * }, * ], * issueType: { * id: "10001", * name: "Incident", * }, * priorities: [ * { * jiraId: "1", * pagerdutyId: p1.then(p1 => p1.id), * }, * { * jiraId: "2", * pagerdutyId: p2.then(p2 => p2.id), * }, * { * jiraId: "3", * pagerdutyId: p3.then(p3 => p3.id), * }, * ], * project: { * id: "10100", * key: "ITS", * name: "IT Support", * }, * statusMapping: { * acknowledged: { * id: "2", * name: "In Progress", * }, * resolved: { * id: "3", * name: "Resolved", * }, * triggered: { * id: "1", * name: "Open", * }, * }, * syncNotesUser: fooUser.id, * }, * }, * }); * ``` * * ## Import * * Jira Cloud account mapping rules can be imported using the `accountMappingId` and `ruleId`, e.g. * * ```sh * $ pulumi import pagerduty:index/jiraCloudAccountMappingRule:JiraCloudAccountMappingRule main PLBP09X:PLB09Z * ``` */ class JiraCloudAccountMappingRule extends pulumi.CustomResource { /** * Get an existing JiraCloudAccountMappingRule 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, id, state, opts) { return new JiraCloudAccountMappingRule(name, state, { ...opts, id: id }); } /** @internal */ static __pulumiType = 'pagerduty:index/jiraCloudAccountMappingRule:JiraCloudAccountMappingRule'; /** * Returns true if the given object is an instance of JiraCloudAccountMappingRule. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj) { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === JiraCloudAccountMappingRule.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["accountMapping"] = state?.accountMapping; resourceInputs["autocreateJqlDisabledReason"] = state?.autocreateJqlDisabledReason; resourceInputs["autocreateJqlDisabledUntil"] = state?.autocreateJqlDisabledUntil; resourceInputs["config"] = state?.config; resourceInputs["enabled"] = state?.enabled; resourceInputs["name"] = state?.name; } else { const args = argsOrState; if (args?.accountMapping === undefined && !opts.urn) { throw new Error("Missing required property 'accountMapping'"); } resourceInputs["accountMapping"] = args?.accountMapping; resourceInputs["config"] = args?.config; resourceInputs["enabled"] = args?.enabled; resourceInputs["name"] = args?.name; resourceInputs["autocreateJqlDisabledReason"] = undefined /*out*/; resourceInputs["autocreateJqlDisabledUntil"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(JiraCloudAccountMappingRule.__pulumiType, name, resourceInputs, opts); } } exports.JiraCloudAccountMappingRule = JiraCloudAccountMappingRule; //# sourceMappingURL=jiraCloudAccountMappingRule.js.map