@pulumi/wavefront
Version:
A Pulumi package for creating and managing wavefront cloud resources.
121 lines • 6.15 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.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, Object.assign(Object.assign({}, 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 ? state.additionalInformation : undefined;
resourceInputs["alertTriageDashboards"] = state ? state.alertTriageDashboards : undefined;
resourceInputs["alertType"] = state ? state.alertType : undefined;
resourceInputs["canModifies"] = state ? state.canModifies : undefined;
resourceInputs["canViews"] = state ? state.canViews : undefined;
resourceInputs["condition"] = state ? state.condition : undefined;
resourceInputs["conditions"] = state ? state.conditions : undefined;
resourceInputs["displayExpression"] = state ? state.displayExpression : undefined;
resourceInputs["minutes"] = state ? state.minutes : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["notificationResendFrequencyMinutes"] = state ? state.notificationResendFrequencyMinutes : undefined;
resourceInputs["processRateMinutes"] = state ? state.processRateMinutes : undefined;
resourceInputs["resolveAfterMinutes"] = state ? state.resolveAfterMinutes : undefined;
resourceInputs["runbookLinks"] = state ? state.runbookLinks : undefined;
resourceInputs["severity"] = state ? state.severity : undefined;
resourceInputs["tags"] = state ? state.tags : undefined;
resourceInputs["target"] = state ? state.target : undefined;
resourceInputs["thresholdTargets"] = state ? state.thresholdTargets : undefined;
}
else {
const args = argsOrState;
if ((!args || args.minutes === undefined) && !opts.urn) {
throw new Error("Missing required property 'minutes'");
}
if ((!args || args.tags === undefined) && !opts.urn) {
throw new Error("Missing required property 'tags'");
}
resourceInputs["additionalInformation"] = args ? args.additionalInformation : undefined;
resourceInputs["alertTriageDashboards"] = args ? args.alertTriageDashboards : undefined;
resourceInputs["alertType"] = args ? args.alertType : undefined;
resourceInputs["canModifies"] = args ? args.canModifies : undefined;
resourceInputs["canViews"] = args ? args.canViews : undefined;
resourceInputs["condition"] = args ? args.condition : undefined;
resourceInputs["conditions"] = args ? args.conditions : undefined;
resourceInputs["displayExpression"] = args ? args.displayExpression : undefined;
resourceInputs["minutes"] = args ? args.minutes : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["notificationResendFrequencyMinutes"] = args ? args.notificationResendFrequencyMinutes : undefined;
resourceInputs["processRateMinutes"] = args ? args.processRateMinutes : undefined;
resourceInputs["resolveAfterMinutes"] = args ? args.resolveAfterMinutes : undefined;
resourceInputs["runbookLinks"] = args ? args.runbookLinks : undefined;
resourceInputs["severity"] = args ? args.severity : undefined;
resourceInputs["tags"] = args ? args.tags : undefined;
resourceInputs["target"] = args ? args.target : undefined;
resourceInputs["thresholdTargets"] = args ? args.thresholdTargets : undefined;
}
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