@pulumi/wavefront
Version:
A Pulumi package for creating and managing wavefront cloud resources.
117 lines • 5.33 kB
JavaScript
;
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** 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, Object.assign(Object.assign({}, 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 ? state.contentType : undefined;
resourceInputs["customHeaders"] = state ? state.customHeaders : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["emailSubject"] = state ? state.emailSubject : undefined;
resourceInputs["isHtmlContent"] = state ? state.isHtmlContent : undefined;
resourceInputs["method"] = state ? state.method : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["recipient"] = state ? state.recipient : undefined;
resourceInputs["routes"] = state ? state.routes : undefined;
resourceInputs["targetId"] = state ? state.targetId : undefined;
resourceInputs["template"] = state ? state.template : undefined;
resourceInputs["triggers"] = state ? state.triggers : undefined;
}
else {
const args = argsOrState;
if ((!args || args.description === undefined) && !opts.urn) {
throw new Error("Missing required property 'description'");
}
if ((!args || args.recipient === undefined) && !opts.urn) {
throw new Error("Missing required property 'recipient'");
}
if ((!args || args.template === undefined) && !opts.urn) {
throw new Error("Missing required property 'template'");
}
if ((!args || args.triggers === undefined) && !opts.urn) {
throw new Error("Missing required property 'triggers'");
}
resourceInputs["contentType"] = args ? args.contentType : undefined;
resourceInputs["customHeaders"] = args ? args.customHeaders : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["emailSubject"] = args ? args.emailSubject : undefined;
resourceInputs["isHtmlContent"] = args ? args.isHtmlContent : undefined;
resourceInputs["method"] = args ? args.method : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["recipient"] = args ? args.recipient : undefined;
resourceInputs["routes"] = args ? args.routes : undefined;
resourceInputs["template"] = args ? args.template : undefined;
resourceInputs["triggers"] = args ? args.triggers : undefined;
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