@volcengine/pulumi
Version:
A Pulumi package for creating and managing volcengine cloud resources.
380 lines (379 loc) • 13.1 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "../types/input";
import * as outputs from "../types/output";
/**
* Provides a resource to manage cloud monitor rule
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as volcengine from "@volcengine/pulumi";
*
* const foo = new volcengine.cloud_monitor.Rule("foo", {
* alertMethods: [
* "Email",
* "Webhook",
* ],
* conditionOperator: "||",
* conditions: [
* {
* comparisonOperator: ">",
* metricName: "DiskUsageAvail",
* metricUnit: "Megabytes",
* statistics: "avg",
* threshold: "100",
* },
* {
* comparisonOperator: ">",
* metricName: "DiskUsageUtilization",
* metricUnit: "Percent",
* statistics: "avg",
* threshold: "90",
* },
* ],
* contactGroupIds: ["174284616403161****"],
* description: "acc-test",
* effectEndAt: "22:55",
* effectStartAt: "00:15",
* enableState: "disable",
* evaluationCount: 5,
* level: "warning",
* multipleConditions: true,
* namespace: "VCM_ECS",
* originalDimensions: [
* {
* key: "ResourceID",
* values: ["*"],
* },
* {
* key: "DiskName",
* values: [
* "vda",
* "vda1",
* ],
* },
* ],
* recoveryNotify: {
* enable: true,
* },
* regions: [
* "cn-beijing",
* "cn-shanghai",
* ],
* ruleName: "acc-test-rule",
* silenceTime: 5,
* subNamespace: "Storage",
* webhookIds: [
* "187655704106731****",
* "187655712542447****",
* ],
* });
* ```
*
* ## Import
*
* CloudMonitorRule can be imported using the id, e.g.
*
* ```sh
* $ pulumi import volcengine:cloud_monitor/rule:Rule default 174284623567451****
* ```
*/
export declare class Rule extends pulumi.CustomResource {
/**
* Get an existing Rule 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: string, id: pulumi.Input<pulumi.ID>, state?: RuleState, opts?: pulumi.CustomResourceOptions): Rule;
/**
* Returns true if the given object is an instance of Rule. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj: any): obj is Rule;
/**
* The alert methods of the cloud monitor rule. Valid values: `Email`, `Phone`, `SMS`, `Webhook`.
*/
readonly alertMethods: pulumi.Output<string[]>;
/**
* The alert state of the cloud monitor rule.
*/
readonly alertState: pulumi.Output<string>;
/**
* The condition operator of the cloud monitor rule. Valid values: `&&`, `||`.
*/
readonly conditionOperator: pulumi.Output<string>;
/**
* The conditions of the cloud monitor rule.
*/
readonly conditions: pulumi.Output<outputs.cloud_monitor.RuleCondition[]>;
/**
* The contact group ids of the cloud monitor rule. When the alert method is `Email`, `SMS`, or `Phone`, This field must be specified.
*/
readonly contactGroupIds: pulumi.Output<string[] | undefined>;
/**
* The created time of the cloud monitor rule.
*/
readonly createdAt: pulumi.Output<string>;
/**
* The description of the cloud monitor rule.
*/
readonly description: pulumi.Output<string>;
/**
* The effect end time of the cloud monitor rule. The expression is `HH:MM`.
*/
readonly effectEndAt: pulumi.Output<string>;
/**
* The effect start time of the cloud monitor rule. The expression is `HH:MM`.
*/
readonly effectStartAt: pulumi.Output<string>;
/**
* The enable state of the cloud monitor rule. Valid values: `enable`, `disable`.
*/
readonly enableState: pulumi.Output<string>;
/**
* The evaluation count of the cloud monitor rule.
*/
readonly evaluationCount: pulumi.Output<number>;
/**
* The level of the cloud monitor rule. Valid values: `critical`, `warning`, `notice`.
*/
readonly level: pulumi.Output<string>;
/**
* Whether to enable the multiple conditions function of the cloud monitor rule.
*/
readonly multipleConditions: pulumi.Output<boolean>;
/**
* The namespace of the cloud monitor rule.
*/
readonly namespace: pulumi.Output<string>;
/**
* The original dimensions of the cloud monitor rule.
*/
readonly originalDimensions: pulumi.Output<outputs.cloud_monitor.RuleOriginalDimension[]>;
/**
* The recovery notify of the cloud monitor rule.
*/
readonly recoveryNotify: pulumi.Output<outputs.cloud_monitor.RuleRecoveryNotify>;
/**
* The region ids of the cloud monitor rule.
*/
readonly regions: pulumi.Output<string[]>;
/**
* The name of the cloud monitor rule.
*/
readonly ruleName: pulumi.Output<string>;
/**
* The silence time of the cloud monitor rule. Unit in minutes. Valid values: 5, 30, 60, 180, 360, 720, 1440.
*/
readonly silenceTime: pulumi.Output<number>;
/**
* The sub namespace of the cloud monitor rule.
*/
readonly subNamespace: pulumi.Output<string>;
/**
* The updated time of the cloud monitor rule.
*/
readonly updatedAt: pulumi.Output<string>;
/**
* The web hook of the cloud monitor rule. When the alert method is `Webhook`, one of `webHook` and `webhookIds` must be specified.
*/
readonly webHook: pulumi.Output<string | undefined>;
/**
* The web hook id list of the cloud monitor rule. When the alert method is `Webhook`, one of `webHook` and `webhookIds` must be specified.
*/
readonly webhookIds: pulumi.Output<string[] | undefined>;
/**
* Create a Rule resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args: RuleArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering Rule resources.
*/
export interface RuleState {
/**
* The alert methods of the cloud monitor rule. Valid values: `Email`, `Phone`, `SMS`, `Webhook`.
*/
alertMethods?: pulumi.Input<pulumi.Input<string>[]>;
/**
* The alert state of the cloud monitor rule.
*/
alertState?: pulumi.Input<string>;
/**
* The condition operator of the cloud monitor rule. Valid values: `&&`, `||`.
*/
conditionOperator?: pulumi.Input<string>;
/**
* The conditions of the cloud monitor rule.
*/
conditions?: pulumi.Input<pulumi.Input<inputs.cloud_monitor.RuleCondition>[]>;
/**
* The contact group ids of the cloud monitor rule. When the alert method is `Email`, `SMS`, or `Phone`, This field must be specified.
*/
contactGroupIds?: pulumi.Input<pulumi.Input<string>[]>;
/**
* The created time of the cloud monitor rule.
*/
createdAt?: pulumi.Input<string>;
/**
* The description of the cloud monitor rule.
*/
description?: pulumi.Input<string>;
/**
* The effect end time of the cloud monitor rule. The expression is `HH:MM`.
*/
effectEndAt?: pulumi.Input<string>;
/**
* The effect start time of the cloud monitor rule. The expression is `HH:MM`.
*/
effectStartAt?: pulumi.Input<string>;
/**
* The enable state of the cloud monitor rule. Valid values: `enable`, `disable`.
*/
enableState?: pulumi.Input<string>;
/**
* The evaluation count of the cloud monitor rule.
*/
evaluationCount?: pulumi.Input<number>;
/**
* The level of the cloud monitor rule. Valid values: `critical`, `warning`, `notice`.
*/
level?: pulumi.Input<string>;
/**
* Whether to enable the multiple conditions function of the cloud monitor rule.
*/
multipleConditions?: pulumi.Input<boolean>;
/**
* The namespace of the cloud monitor rule.
*/
namespace?: pulumi.Input<string>;
/**
* The original dimensions of the cloud monitor rule.
*/
originalDimensions?: pulumi.Input<pulumi.Input<inputs.cloud_monitor.RuleOriginalDimension>[]>;
/**
* The recovery notify of the cloud monitor rule.
*/
recoveryNotify?: pulumi.Input<inputs.cloud_monitor.RuleRecoveryNotify>;
/**
* The region ids of the cloud monitor rule.
*/
regions?: pulumi.Input<pulumi.Input<string>[]>;
/**
* The name of the cloud monitor rule.
*/
ruleName?: pulumi.Input<string>;
/**
* The silence time of the cloud monitor rule. Unit in minutes. Valid values: 5, 30, 60, 180, 360, 720, 1440.
*/
silenceTime?: pulumi.Input<number>;
/**
* The sub namespace of the cloud monitor rule.
*/
subNamespace?: pulumi.Input<string>;
/**
* The updated time of the cloud monitor rule.
*/
updatedAt?: pulumi.Input<string>;
/**
* The web hook of the cloud monitor rule. When the alert method is `Webhook`, one of `webHook` and `webhookIds` must be specified.
*/
webHook?: pulumi.Input<string>;
/**
* The web hook id list of the cloud monitor rule. When the alert method is `Webhook`, one of `webHook` and `webhookIds` must be specified.
*/
webhookIds?: pulumi.Input<pulumi.Input<string>[]>;
}
/**
* The set of arguments for constructing a Rule resource.
*/
export interface RuleArgs {
/**
* The alert methods of the cloud monitor rule. Valid values: `Email`, `Phone`, `SMS`, `Webhook`.
*/
alertMethods: pulumi.Input<pulumi.Input<string>[]>;
/**
* The condition operator of the cloud monitor rule. Valid values: `&&`, `||`.
*/
conditionOperator?: pulumi.Input<string>;
/**
* The conditions of the cloud monitor rule.
*/
conditions: pulumi.Input<pulumi.Input<inputs.cloud_monitor.RuleCondition>[]>;
/**
* The contact group ids of the cloud monitor rule. When the alert method is `Email`, `SMS`, or `Phone`, This field must be specified.
*/
contactGroupIds?: pulumi.Input<pulumi.Input<string>[]>;
/**
* The description of the cloud monitor rule.
*/
description?: pulumi.Input<string>;
/**
* The effect end time of the cloud monitor rule. The expression is `HH:MM`.
*/
effectEndAt: pulumi.Input<string>;
/**
* The effect start time of the cloud monitor rule. The expression is `HH:MM`.
*/
effectStartAt: pulumi.Input<string>;
/**
* The enable state of the cloud monitor rule. Valid values: `enable`, `disable`.
*/
enableState: pulumi.Input<string>;
/**
* The evaluation count of the cloud monitor rule.
*/
evaluationCount: pulumi.Input<number>;
/**
* The level of the cloud monitor rule. Valid values: `critical`, `warning`, `notice`.
*/
level: pulumi.Input<string>;
/**
* Whether to enable the multiple conditions function of the cloud monitor rule.
*/
multipleConditions?: pulumi.Input<boolean>;
/**
* The namespace of the cloud monitor rule.
*/
namespace: pulumi.Input<string>;
/**
* The original dimensions of the cloud monitor rule.
*/
originalDimensions: pulumi.Input<pulumi.Input<inputs.cloud_monitor.RuleOriginalDimension>[]>;
/**
* The recovery notify of the cloud monitor rule.
*/
recoveryNotify?: pulumi.Input<inputs.cloud_monitor.RuleRecoveryNotify>;
/**
* The region ids of the cloud monitor rule.
*/
regions: pulumi.Input<pulumi.Input<string>[]>;
/**
* The name of the cloud monitor rule.
*/
ruleName: pulumi.Input<string>;
/**
* The silence time of the cloud monitor rule. Unit in minutes. Valid values: 5, 30, 60, 180, 360, 720, 1440.
*/
silenceTime: pulumi.Input<number>;
/**
* The sub namespace of the cloud monitor rule.
*/
subNamespace: pulumi.Input<string>;
/**
* The web hook of the cloud monitor rule. When the alert method is `Webhook`, one of `webHook` and `webhookIds` must be specified.
*/
webHook?: pulumi.Input<string>;
/**
* The web hook id list of the cloud monitor rule. When the alert method is `Webhook`, one of `webHook` and `webhookIds` must be specified.
*/
webhookIds?: pulumi.Input<pulumi.Input<string>[]>;
}