@volcengine/pulumi
Version:
A Pulumi package for creating and managing volcengine cloud resources.
131 lines • 5.94 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.Alarm = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Provides a resource to manage tls alarm
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as volcengine from "@volcengine/pulumi";
*
* const foo = new volcengine.tls.Alarm("foo", {
* alarmName: "test",
* alarmNotifyGroups: ["3019107f-28a2-4208-a2b6-c33fcb97ac3a"],
* alarmPeriodDetail: {
* email: 2,
* generalWebhook: 3,
* phone: 10,
* sms: 10,
* },
* condition: "$1.errNum>0",
* projectId: "cc44f8b6-0328-4622-b043-023fca735cd4",
* queryRequests: [{
* endTimeOffset: 0,
* number: 1,
* query: "Failed | select count(*) as errNum",
* startTimeOffset: -15,
* topicId: "af1a2240-ba62-4f18-b421-bde2f9684e57",
* }],
* requestCycle: {
* time: 11,
* type: "Period",
* },
* userDefineMsg: "test for terraform",
* });
* ```
*
* ## Import
*
* tls alarm can be imported using the id and project id, e.g.
*
* ```sh
* $ pulumi import volcengine:tls/alarm:Alarm default projectId:fc************
* ```
*/
class Alarm extends pulumi.CustomResource {
/**
* Get an existing Alarm 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 Alarm(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of Alarm. 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'] === Alarm.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["alarmId"] = state ? state.alarmId : undefined;
resourceInputs["alarmName"] = state ? state.alarmName : undefined;
resourceInputs["alarmNotifyGroups"] = state ? state.alarmNotifyGroups : undefined;
resourceInputs["alarmPeriod"] = state ? state.alarmPeriod : undefined;
resourceInputs["alarmPeriodDetail"] = state ? state.alarmPeriodDetail : undefined;
resourceInputs["condition"] = state ? state.condition : undefined;
resourceInputs["projectId"] = state ? state.projectId : undefined;
resourceInputs["queryRequests"] = state ? state.queryRequests : undefined;
resourceInputs["requestCycle"] = state ? state.requestCycle : undefined;
resourceInputs["status"] = state ? state.status : undefined;
resourceInputs["triggerPeriod"] = state ? state.triggerPeriod : undefined;
resourceInputs["userDefineMsg"] = state ? state.userDefineMsg : undefined;
}
else {
const args = argsOrState;
if ((!args || args.alarmName === undefined) && !opts.urn) {
throw new Error("Missing required property 'alarmName'");
}
if ((!args || args.alarmNotifyGroups === undefined) && !opts.urn) {
throw new Error("Missing required property 'alarmNotifyGroups'");
}
if ((!args || args.condition === undefined) && !opts.urn) {
throw new Error("Missing required property 'condition'");
}
if ((!args || args.projectId === undefined) && !opts.urn) {
throw new Error("Missing required property 'projectId'");
}
if ((!args || args.queryRequests === undefined) && !opts.urn) {
throw new Error("Missing required property 'queryRequests'");
}
if ((!args || args.requestCycle === undefined) && !opts.urn) {
throw new Error("Missing required property 'requestCycle'");
}
resourceInputs["alarmName"] = args ? args.alarmName : undefined;
resourceInputs["alarmNotifyGroups"] = args ? args.alarmNotifyGroups : undefined;
resourceInputs["alarmPeriod"] = args ? args.alarmPeriod : undefined;
resourceInputs["alarmPeriodDetail"] = args ? args.alarmPeriodDetail : undefined;
resourceInputs["condition"] = args ? args.condition : undefined;
resourceInputs["projectId"] = args ? args.projectId : undefined;
resourceInputs["queryRequests"] = args ? args.queryRequests : undefined;
resourceInputs["requestCycle"] = args ? args.requestCycle : undefined;
resourceInputs["status"] = args ? args.status : undefined;
resourceInputs["triggerPeriod"] = args ? args.triggerPeriod : undefined;
resourceInputs["userDefineMsg"] = args ? args.userDefineMsg : undefined;
resourceInputs["alarmId"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Alarm.__pulumiType, name, resourceInputs, opts);
}
}
exports.Alarm = Alarm;
/** @internal */
Alarm.__pulumiType = 'volcengine:tls/alarm:Alarm';
//# sourceMappingURL=alarm.js.map