@volcengine/pulumi
Version:
A Pulumi package for creating and managing volcengine cloud resources.
301 lines (300 loc) • 9.33 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 vmp alerting rule
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as volcengine from "@volcengine/pulumi";
*
* const fooWorkspace = new volcengine.vmp.Workspace("fooWorkspace", {
* instanceTypeId: "vmp.standard.15d",
* deleteProtectionEnabled: false,
* description: "acc-test-1",
* username: "admin123",
* password: "Pass123456",
* });
* const fooContact = new volcengine.vmp.Contact("fooContact", {
* email: "acctest1@tftest.com",
* webhook: {
* address: "https://www.acctest1.com",
* },
* larkBotWebhook: {
* address: "https://www.acctest1.com",
* },
* dingTalkBotWebhook: {
* address: "https://www.dingacctest1.com",
* atMobiles: ["18046891812"],
* },
* phoneNumber: {
* countryCode: "+86",
* number: "18310101010",
* },
* });
* const foo1Contact = new volcengine.vmp.Contact("foo1Contact", {
* email: "acctest2@tftest.com",
* webhook: {
* address: "https://www.acctest2.com",
* },
* larkBotWebhook: {
* address: "https://www.acctest2.com",
* },
* dingTalkBotWebhook: {
* address: "https://www.dingacctest2.com",
* atMobiles: ["18046891813"],
* },
* phoneNumber: {
* countryCode: "+86",
* number: "18310101011",
* },
* });
* const fooContactGroup = new volcengine.vmp.ContactGroup("fooContactGroup", {contactIds: [fooContact.id]});
* const foo1ContactGroup = new volcengine.vmp.ContactGroup("foo1ContactGroup", {contactIds: [foo1Contact.id]});
* const fooNotifyPolicy = new volcengine.vmp.NotifyPolicy("fooNotifyPolicy", {
* description: "acc-test-1",
* levels: [
* {
* level: "P1",
* contactGroupIds: [fooContactGroup.id],
* channels: [
* "Email",
* "Webhook",
* ],
* },
* {
* level: "P0",
* contactGroupIds: [foo1ContactGroup.id],
* channels: ["LarkBotWebhook"],
* },
* ],
* });
* const fooNotifyGroupPolicy = new volcengine.vmp.NotifyGroupPolicy("fooNotifyGroupPolicy", {
* description: "acc-test-1",
* levels: [
* {
* level: "P2",
* groupBies: ["__rule__"],
* groupWait: "35",
* groupInterval: "60",
* repeatInterval: "70",
* },
* {
* level: "P0",
* groupBies: ["__rule__"],
* groupWait: "30",
* groupInterval: "60",
* repeatInterval: "70",
* },
* {
* level: "P1",
* groupBies: ["__rule__"],
* groupWait: "40",
* groupInterval: "75",
* repeatInterval: "75",
* },
* ],
* });
* const fooAlertingRule = new volcengine.vmp.AlertingRule("fooAlertingRule", {
* description: "acc-test-1",
* notifyPolicyId: fooNotifyPolicy.id,
* notifyGroupPolicyId: fooNotifyGroupPolicy.id,
* query: {
* workspaceId: fooWorkspace.id,
* promQl: "sum(up)",
* },
* levels: [
* {
* level: "P0",
* "for": "0s",
* comparator: ">=",
* threshold: 2,
* },
* {
* level: "P1",
* "for": "0s",
* comparator: ">=",
* threshold: 1,
* },
* {
* level: "P2",
* "for": "0s",
* comparator: ">=",
* threshold: 0.5,
* },
* ],
* annotations: [{
* name: "annotation",
* value: "acc-test",
* }],
* labels: [{
* name: "label",
* value: "acc-test",
* }],
* });
* ```
*
* ## Import
*
* VmpAlertingRule can be imported using the id, e.g.
*
* ```sh
* $ pulumi import volcengine:vmp/alertingRule:AlertingRule default 5bd29e81-2717-4ac8-a1a6-d76da2b1****
* ```
*/
export declare class AlertingRule extends pulumi.CustomResource {
/**
* Get an existing AlertingRule 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?: AlertingRuleState, opts?: pulumi.CustomResourceOptions): AlertingRule;
/**
* Returns true if the given object is an instance of AlertingRule. 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 AlertingRule;
/**
* The annotations of the vmp alerting rule.
*/
readonly annotations: pulumi.Output<outputs.vmp.AlertingRuleAnnotation[] | undefined>;
/**
* The create time of the vmp alerting rule.
*/
readonly createTime: pulumi.Output<string>;
/**
* The description of the vmp alerting rule.
*/
readonly description: pulumi.Output<string>;
/**
* The labels of the vmp alerting rule.
*/
readonly labels: pulumi.Output<outputs.vmp.AlertingRuleLabel[] | undefined>;
/**
* The alerting levels of the vmp alerting rule.
*/
readonly levels: pulumi.Output<outputs.vmp.AlertingRuleLevel[]>;
/**
* The name of the vmp alerting rule.
*/
readonly name: pulumi.Output<string>;
/**
* The id of the notify group policy.
*/
readonly notifyGroupPolicyId: pulumi.Output<string>;
/**
* The id of the notify policy.
*/
readonly notifyPolicyId: pulumi.Output<string | undefined>;
/**
* The alerting query of the vmp alerting rule.
*/
readonly query: pulumi.Output<outputs.vmp.AlertingRuleQuery>;
/**
* The status of the vmp alerting rule.
*/
readonly status: pulumi.Output<string>;
/**
* The update time of the vmp alerting rule.
*/
readonly updateTime: pulumi.Output<string>;
/**
* Create a AlertingRule 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: AlertingRuleArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering AlertingRule resources.
*/
export interface AlertingRuleState {
/**
* The annotations of the vmp alerting rule.
*/
annotations?: pulumi.Input<pulumi.Input<inputs.vmp.AlertingRuleAnnotation>[]>;
/**
* The create time of the vmp alerting rule.
*/
createTime?: pulumi.Input<string>;
/**
* The description of the vmp alerting rule.
*/
description?: pulumi.Input<string>;
/**
* The labels of the vmp alerting rule.
*/
labels?: pulumi.Input<pulumi.Input<inputs.vmp.AlertingRuleLabel>[]>;
/**
* The alerting levels of the vmp alerting rule.
*/
levels?: pulumi.Input<pulumi.Input<inputs.vmp.AlertingRuleLevel>[]>;
/**
* The name of the vmp alerting rule.
*/
name?: pulumi.Input<string>;
/**
* The id of the notify group policy.
*/
notifyGroupPolicyId?: pulumi.Input<string>;
/**
* The id of the notify policy.
*/
notifyPolicyId?: pulumi.Input<string>;
/**
* The alerting query of the vmp alerting rule.
*/
query?: pulumi.Input<inputs.vmp.AlertingRuleQuery>;
/**
* The status of the vmp alerting rule.
*/
status?: pulumi.Input<string>;
/**
* The update time of the vmp alerting rule.
*/
updateTime?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a AlertingRule resource.
*/
export interface AlertingRuleArgs {
/**
* The annotations of the vmp alerting rule.
*/
annotations?: pulumi.Input<pulumi.Input<inputs.vmp.AlertingRuleAnnotation>[]>;
/**
* The description of the vmp alerting rule.
*/
description?: pulumi.Input<string>;
/**
* The labels of the vmp alerting rule.
*/
labels?: pulumi.Input<pulumi.Input<inputs.vmp.AlertingRuleLabel>[]>;
/**
* The alerting levels of the vmp alerting rule.
*/
levels: pulumi.Input<pulumi.Input<inputs.vmp.AlertingRuleLevel>[]>;
/**
* The name of the vmp alerting rule.
*/
name?: pulumi.Input<string>;
/**
* The id of the notify group policy.
*/
notifyGroupPolicyId: pulumi.Input<string>;
/**
* The id of the notify policy.
*/
notifyPolicyId?: pulumi.Input<string>;
/**
* The alerting query of the vmp alerting rule.
*/
query: pulumi.Input<inputs.vmp.AlertingRuleQuery>;
}