@pulumi/digitalocean
Version:
A Pulumi package for creating and managing DigitalOcean cloud resources.
84 lines • 3.88 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.UptimeAlert = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Provides a [DigitalOcean Uptime Alerts](https://docs.digitalocean.com/reference/api/digitalocean/#tag/Uptime/operation/uptime_create_alert)
* resource. Uptime Alerts provide the ability to add alerts to your [DigitalOcean Uptime Checks](https://docs.digitalocean.com/reference/api/digitalocean/#tag/Uptime) when your endpoints are slow, unavailable, or SSL certificates are expiring.
*
* ## Import
*
* Uptime alerts can be imported using both the ID of the alert's parent check and
*
* its own separated by a comma in the format: `check_id,alert_id`. For example:
*
* ```sh
* $ pulumi import digitalocean:index/uptimeAlert:UptimeAlert target 94a7d216-d821-11ee-a327-33d3239ffc4b,5a4981aa-9653-4bd1-bef5-d6bff52042e4
* ```
*/
class UptimeAlert extends pulumi.CustomResource {
/**
* Get an existing UptimeAlert 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 UptimeAlert(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of UptimeAlert. 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'] === UptimeAlert.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["checkId"] = state?.checkId;
resourceInputs["comparison"] = state?.comparison;
resourceInputs["name"] = state?.name;
resourceInputs["notifications"] = state?.notifications;
resourceInputs["period"] = state?.period;
resourceInputs["threshold"] = state?.threshold;
resourceInputs["type"] = state?.type;
}
else {
const args = argsOrState;
if (args?.checkId === undefined && !opts.urn) {
throw new Error("Missing required property 'checkId'");
}
if (args?.notifications === undefined && !opts.urn) {
throw new Error("Missing required property 'notifications'");
}
if (args?.type === undefined && !opts.urn) {
throw new Error("Missing required property 'type'");
}
resourceInputs["checkId"] = args?.checkId;
resourceInputs["comparison"] = args?.comparison;
resourceInputs["name"] = args?.name;
resourceInputs["notifications"] = args?.notifications;
resourceInputs["period"] = args?.period;
resourceInputs["threshold"] = args?.threshold;
resourceInputs["type"] = args?.type;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(UptimeAlert.__pulumiType, name, resourceInputs, opts);
}
}
exports.UptimeAlert = UptimeAlert;
/** @internal */
UptimeAlert.__pulumiType = 'digitalocean:index/uptimeAlert:UptimeAlert';
//# sourceMappingURL=uptimeAlert.js.map