UNPKG

@pulumi/pagerduty

Version:

A Pulumi package for creating and managing pagerduty cloud resources.

134 lines 6.82 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.Service = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * A [service](https://developer.pagerduty.com/api-reference/b3A6Mjc0ODE5Nw-create-a-service) represents something you monitor (like a web service, email service, or database service). It is a container for related incidents that associates them with escalation policies. * * ## 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", * }); * const foo = new pagerduty.EscalationPolicy("foo", { * name: "Engineering Escalation Policy", * numLoops: 2, * rules: [{ * escalationDelayInMinutes: 10, * targets: [{ * type: "user_reference", * id: example.id, * }], * }], * }); * const exampleService = new pagerduty.Service("example", { * name: "My Web App", * autoResolveTimeout: "14400", * acknowledgementTimeout: "600", * escalationPolicy: foo.id, * alertCreation: "create_alerts_and_incidents", * autoPauseNotificationsParameters: { * enabled: true, * timeout: 300, * }, * }); * ``` * * ## Import * * Services can be imported using the `id`, e.g. * * ```sh * $ pulumi import pagerduty:index/service:Service main PLBP09X * ``` */ class Service extends pulumi.CustomResource { /** * Get an existing Service 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 Service(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of Service. 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'] === Service.__pulumiType; } constructor(name, argsOrState, opts) { var _a; let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["acknowledgementTimeout"] = state ? state.acknowledgementTimeout : undefined; resourceInputs["alertCreation"] = state ? state.alertCreation : undefined; resourceInputs["alertGrouping"] = state ? state.alertGrouping : undefined; resourceInputs["alertGroupingParameters"] = state ? state.alertGroupingParameters : undefined; resourceInputs["alertGroupingTimeout"] = state ? state.alertGroupingTimeout : undefined; resourceInputs["autoPauseNotificationsParameters"] = state ? state.autoPauseNotificationsParameters : undefined; resourceInputs["autoResolveTimeout"] = state ? state.autoResolveTimeout : undefined; resourceInputs["createdAt"] = state ? state.createdAt : undefined; resourceInputs["description"] = state ? state.description : undefined; resourceInputs["escalationPolicy"] = state ? state.escalationPolicy : undefined; resourceInputs["htmlUrl"] = state ? state.htmlUrl : undefined; resourceInputs["incidentUrgencyRule"] = state ? state.incidentUrgencyRule : undefined; resourceInputs["lastIncidentTimestamp"] = state ? state.lastIncidentTimestamp : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["responsePlay"] = state ? state.responsePlay : undefined; resourceInputs["scheduledActions"] = state ? state.scheduledActions : undefined; resourceInputs["status"] = state ? state.status : undefined; resourceInputs["supportHours"] = state ? state.supportHours : undefined; resourceInputs["type"] = state ? state.type : undefined; } else { const args = argsOrState; if ((!args || args.escalationPolicy === undefined) && !opts.urn) { throw new Error("Missing required property 'escalationPolicy'"); } resourceInputs["acknowledgementTimeout"] = args ? args.acknowledgementTimeout : undefined; resourceInputs["alertCreation"] = args ? args.alertCreation : undefined; resourceInputs["alertGrouping"] = args ? args.alertGrouping : undefined; resourceInputs["alertGroupingParameters"] = args ? args.alertGroupingParameters : undefined; resourceInputs["alertGroupingTimeout"] = args ? args.alertGroupingTimeout : undefined; resourceInputs["autoPauseNotificationsParameters"] = args ? args.autoPauseNotificationsParameters : undefined; resourceInputs["autoResolveTimeout"] = args ? args.autoResolveTimeout : undefined; resourceInputs["description"] = (_a = (args ? args.description : undefined)) !== null && _a !== void 0 ? _a : "Managed by Pulumi"; resourceInputs["escalationPolicy"] = args ? args.escalationPolicy : undefined; resourceInputs["incidentUrgencyRule"] = args ? args.incidentUrgencyRule : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["responsePlay"] = args ? args.responsePlay : undefined; resourceInputs["scheduledActions"] = args ? args.scheduledActions : undefined; resourceInputs["supportHours"] = args ? args.supportHours : undefined; resourceInputs["createdAt"] = undefined /*out*/; resourceInputs["htmlUrl"] = undefined /*out*/; resourceInputs["lastIncidentTimestamp"] = undefined /*out*/; resourceInputs["status"] = undefined /*out*/; resourceInputs["type"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Service.__pulumiType, name, resourceInputs, opts); } } exports.Service = Service; /** @internal */ Service.__pulumiType = 'pagerduty:index/service:Service'; //# sourceMappingURL=service.js.map