UNPKG

@pulumi/pagerduty

Version:

A Pulumi package for creating and managing pagerduty cloud resources.

133 lines 6.11 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, { ...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) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["acknowledgementTimeout"] = state?.acknowledgementTimeout; resourceInputs["alertCreation"] = state?.alertCreation; resourceInputs["alertGrouping"] = state?.alertGrouping; resourceInputs["alertGroupingParameters"] = state?.alertGroupingParameters; resourceInputs["alertGroupingTimeout"] = state?.alertGroupingTimeout; resourceInputs["autoPauseNotificationsParameters"] = state?.autoPauseNotificationsParameters; resourceInputs["autoResolveTimeout"] = state?.autoResolveTimeout; resourceInputs["createdAt"] = state?.createdAt; resourceInputs["description"] = state?.description; resourceInputs["escalationPolicy"] = state?.escalationPolicy; resourceInputs["htmlUrl"] = state?.htmlUrl; resourceInputs["incidentUrgencyRule"] = state?.incidentUrgencyRule; resourceInputs["lastIncidentTimestamp"] = state?.lastIncidentTimestamp; resourceInputs["name"] = state?.name; resourceInputs["responsePlay"] = state?.responsePlay; resourceInputs["scheduledActions"] = state?.scheduledActions; resourceInputs["status"] = state?.status; resourceInputs["supportHours"] = state?.supportHours; resourceInputs["type"] = state?.type; } else { const args = argsOrState; if (args?.escalationPolicy === undefined && !opts.urn) { throw new Error("Missing required property 'escalationPolicy'"); } resourceInputs["acknowledgementTimeout"] = args?.acknowledgementTimeout; resourceInputs["alertCreation"] = args?.alertCreation; resourceInputs["alertGrouping"] = args?.alertGrouping; resourceInputs["alertGroupingParameters"] = args?.alertGroupingParameters; resourceInputs["alertGroupingTimeout"] = args?.alertGroupingTimeout; resourceInputs["autoPauseNotificationsParameters"] = args?.autoPauseNotificationsParameters; resourceInputs["autoResolveTimeout"] = args?.autoResolveTimeout; resourceInputs["description"] = (args?.description) ?? "Managed by Pulumi"; resourceInputs["escalationPolicy"] = args?.escalationPolicy; resourceInputs["incidentUrgencyRule"] = args?.incidentUrgencyRule; resourceInputs["name"] = args?.name; resourceInputs["responsePlay"] = args?.responsePlay; resourceInputs["scheduledActions"] = args?.scheduledActions; resourceInputs["supportHours"] = args?.supportHours; 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