UNPKG

@pulumi/wavefront

Version:

A Pulumi package for creating and managing wavefront cloud resources.

117 lines 4.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.AlertTarget = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * Provides a wavefront Alert Target resource. This allows alert targets to created, updated, and deleted. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as wavefront from "@pulumi/wavefront"; * * const testTarget = new wavefront.AlertTarget("test_target", { * name: "Terraform Test Target", * description: "Test target", * method: "WEBHOOK", * recipient: "https://hooks.slack.com/services/test/me", * contentType: "application/json", * customHeaders: { * Testing: "true", * }, * template: "{}", * triggers: [ * "ALERT_OPENED", * "ALERT_RESOLVED", * ], * }); * ``` * * ## Import * * Alert Targets can be imported using the `id`, e.g.: * * ```sh * $ pulumi import wavefront:index/alertTarget:AlertTarget alert_target abcdEFGhijKLMNO * ``` */ class AlertTarget extends pulumi.CustomResource { /** * Get an existing AlertTarget 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 AlertTarget(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of AlertTarget. 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'] === AlertTarget.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["contentType"] = state?.contentType; resourceInputs["customHeaders"] = state?.customHeaders; resourceInputs["description"] = state?.description; resourceInputs["emailSubject"] = state?.emailSubject; resourceInputs["isHtmlContent"] = state?.isHtmlContent; resourceInputs["method"] = state?.method; resourceInputs["name"] = state?.name; resourceInputs["recipient"] = state?.recipient; resourceInputs["routes"] = state?.routes; resourceInputs["targetId"] = state?.targetId; resourceInputs["template"] = state?.template; resourceInputs["triggers"] = state?.triggers; } else { const args = argsOrState; if (args?.description === undefined && !opts.urn) { throw new Error("Missing required property 'description'"); } if (args?.recipient === undefined && !opts.urn) { throw new Error("Missing required property 'recipient'"); } if (args?.template === undefined && !opts.urn) { throw new Error("Missing required property 'template'"); } if (args?.triggers === undefined && !opts.urn) { throw new Error("Missing required property 'triggers'"); } resourceInputs["contentType"] = args?.contentType; resourceInputs["customHeaders"] = args?.customHeaders; resourceInputs["description"] = args?.description; resourceInputs["emailSubject"] = args?.emailSubject; resourceInputs["isHtmlContent"] = args?.isHtmlContent; resourceInputs["method"] = args?.method; resourceInputs["name"] = args?.name; resourceInputs["recipient"] = args?.recipient; resourceInputs["routes"] = args?.routes; resourceInputs["template"] = args?.template; resourceInputs["triggers"] = args?.triggers; resourceInputs["targetId"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(AlertTarget.__pulumiType, name, resourceInputs, opts); } } exports.AlertTarget = AlertTarget; /** @internal */ AlertTarget.__pulumiType = 'wavefront:index/alertTarget:AlertTarget'; //# sourceMappingURL=alertTarget.js.map