UNPKG

@pulumi/pagerduty

Version:

A Pulumi package for creating and managing pagerduty cloud resources.

153 lines 6.65 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! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.ExtensionServiceNow = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * A special case for [extension](https://developer.pagerduty.com/api-reference/b3A6Mjc0ODEzMw-create-an-extension) for ServiceNow. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as pagerduty from "@pulumi/pagerduty"; * * const servicenow = pagerduty.getExtensionSchema({ * name: "ServiceNow (v7)", * }); * const example = new pagerduty.User("example", { * name: "Howard James", * email: "howard.james@example.domain", * }); * const exampleEscalationPolicy = new pagerduty.EscalationPolicy("example", { * 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: exampleEscalationPolicy.id, * }); * const snow = new pagerduty.ExtensionServiceNow("snow", { * name: "My Web App Extension", * extensionSchema: servicenow.then(servicenow => servicenow.id), * extensionObjects: [exampleService.id], * snowUser: "meeps", * snowPassword: "zorz", * syncOptions: "manual_sync", * target: "https://foo.servicenow.com/webhook_foo", * taskType: "incident", * referer: "None", * }); * ``` * * ## Import * * Extensions can be imported using the id.e.g. * * ```sh * $ pulumi import pagerduty:index/extensionServiceNow:ExtensionServiceNow main PLBP09X * ``` */ class ExtensionServiceNow extends pulumi.CustomResource { /** * Get an existing ExtensionServiceNow 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 ExtensionServiceNow(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of ExtensionServiceNow. 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'] === ExtensionServiceNow.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["endpointUrl"] = state?.endpointUrl; resourceInputs["extensionObjects"] = state?.extensionObjects; resourceInputs["extensionSchema"] = state?.extensionSchema; resourceInputs["htmlUrl"] = state?.htmlUrl; resourceInputs["name"] = state?.name; resourceInputs["referer"] = state?.referer; resourceInputs["snowPassword"] = state?.snowPassword; resourceInputs["snowUser"] = state?.snowUser; resourceInputs["summary"] = state?.summary; resourceInputs["syncOptions"] = state?.syncOptions; resourceInputs["target"] = state?.target; resourceInputs["taskType"] = state?.taskType; resourceInputs["type"] = state?.type; } else { const args = argsOrState; if (args?.extensionObjects === undefined && !opts.urn) { throw new Error("Missing required property 'extensionObjects'"); } if (args?.extensionSchema === undefined && !opts.urn) { throw new Error("Missing required property 'extensionSchema'"); } if (args?.referer === undefined && !opts.urn) { throw new Error("Missing required property 'referer'"); } if (args?.snowPassword === undefined && !opts.urn) { throw new Error("Missing required property 'snowPassword'"); } if (args?.snowUser === undefined && !opts.urn) { throw new Error("Missing required property 'snowUser'"); } if (args?.syncOptions === undefined && !opts.urn) { throw new Error("Missing required property 'syncOptions'"); } if (args?.target === undefined && !opts.urn) { throw new Error("Missing required property 'target'"); } if (args?.taskType === undefined && !opts.urn) { throw new Error("Missing required property 'taskType'"); } resourceInputs["endpointUrl"] = args?.endpointUrl ? pulumi.secret(args.endpointUrl) : undefined; resourceInputs["extensionObjects"] = args?.extensionObjects; resourceInputs["extensionSchema"] = args?.extensionSchema; resourceInputs["name"] = args?.name; resourceInputs["referer"] = args?.referer; resourceInputs["snowPassword"] = args?.snowPassword ? pulumi.secret(args.snowPassword) : undefined; resourceInputs["snowUser"] = args?.snowUser; resourceInputs["summary"] = args?.summary; resourceInputs["syncOptions"] = args?.syncOptions; resourceInputs["target"] = args?.target; resourceInputs["taskType"] = args?.taskType; resourceInputs["type"] = args?.type; resourceInputs["htmlUrl"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const secretOpts = { additionalSecretOutputs: ["endpointUrl", "snowPassword"] }; opts = pulumi.mergeOptions(opts, secretOpts); super(ExtensionServiceNow.__pulumiType, name, resourceInputs, opts); } } exports.ExtensionServiceNow = ExtensionServiceNow; /** @internal */ ExtensionServiceNow.__pulumiType = 'pagerduty:index/extensionServiceNow:ExtensionServiceNow'; //# sourceMappingURL=extensionServiceNow.js.map