@pulumi/wavefront
Version:
A Pulumi package for creating and managing wavefront cloud resources.
121 lines • 5.42 kB
JavaScript
;
// *** 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.Alert = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Provides a Wavefront Alert resource. This allows alerts to be created, updated, and deleted.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as wavefront from "@pulumi/wavefront";
*
* const foobar = new wavefront.Alert("foobar", {
* name: "Test Alert",
* target: "test@example.com,target:alert-target-id",
* condition: "100-ts(\"cpu.usage_idle\", environment=preprod and cpu=cpu-total ) > 80",
* displayExpression: "100-ts(\"cpu.usage_idle\", environment=preprod and cpu=cpu-total )",
* minutes: 5,
* resolveAfterMinutes: 5,
* severity: "WARN",
* tags: [
* "terraform",
* "test",
* ],
* });
* ```
*
* ## Import
*
* Alerts can be imported using the `id`, e.g.
*
* ```sh
* $ pulumi import wavefront:index/alert:Alert alert_target 1479868728473
* ```
*/
class Alert extends pulumi.CustomResource {
/**
* Get an existing Alert 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 Alert(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of Alert. 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'] === Alert.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["additionalInformation"] = state?.additionalInformation;
resourceInputs["alertTriageDashboards"] = state?.alertTriageDashboards;
resourceInputs["alertType"] = state?.alertType;
resourceInputs["canModifies"] = state?.canModifies;
resourceInputs["canViews"] = state?.canViews;
resourceInputs["condition"] = state?.condition;
resourceInputs["conditions"] = state?.conditions;
resourceInputs["displayExpression"] = state?.displayExpression;
resourceInputs["minutes"] = state?.minutes;
resourceInputs["name"] = state?.name;
resourceInputs["notificationResendFrequencyMinutes"] = state?.notificationResendFrequencyMinutes;
resourceInputs["processRateMinutes"] = state?.processRateMinutes;
resourceInputs["resolveAfterMinutes"] = state?.resolveAfterMinutes;
resourceInputs["runbookLinks"] = state?.runbookLinks;
resourceInputs["severity"] = state?.severity;
resourceInputs["tags"] = state?.tags;
resourceInputs["target"] = state?.target;
resourceInputs["thresholdTargets"] = state?.thresholdTargets;
}
else {
const args = argsOrState;
if (args?.minutes === undefined && !opts.urn) {
throw new Error("Missing required property 'minutes'");
}
if (args?.tags === undefined && !opts.urn) {
throw new Error("Missing required property 'tags'");
}
resourceInputs["additionalInformation"] = args?.additionalInformation;
resourceInputs["alertTriageDashboards"] = args?.alertTriageDashboards;
resourceInputs["alertType"] = args?.alertType;
resourceInputs["canModifies"] = args?.canModifies;
resourceInputs["canViews"] = args?.canViews;
resourceInputs["condition"] = args?.condition;
resourceInputs["conditions"] = args?.conditions;
resourceInputs["displayExpression"] = args?.displayExpression;
resourceInputs["minutes"] = args?.minutes;
resourceInputs["name"] = args?.name;
resourceInputs["notificationResendFrequencyMinutes"] = args?.notificationResendFrequencyMinutes;
resourceInputs["processRateMinutes"] = args?.processRateMinutes;
resourceInputs["resolveAfterMinutes"] = args?.resolveAfterMinutes;
resourceInputs["runbookLinks"] = args?.runbookLinks;
resourceInputs["severity"] = args?.severity;
resourceInputs["tags"] = args?.tags;
resourceInputs["target"] = args?.target;
resourceInputs["thresholdTargets"] = args?.thresholdTargets;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Alert.__pulumiType, name, resourceInputs, opts);
}
}
exports.Alert = Alert;
/** @internal */
Alert.__pulumiType = 'wavefront:index/alert:Alert';
//# sourceMappingURL=alert.js.map