GroupMetricRule

Provides a Cloud Monitor Service Group Metric Rule resource. For information about Cloud Monitor Service Group Metric Rule and how to use it, see What is Group Metric Rule.

NOTE: Available in v1.104.0+.

Example Usage

Basic Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.random.RandomUuid;
import com.pulumi.alicloud.cms.GroupMetricRule;
import com.pulumi.alicloud.cms.GroupMetricRuleArgs;
import com.pulumi.alicloud.cms.inputs.GroupMetricRuleEscalationsArgs;
import com.pulumi.alicloud.cms.inputs.GroupMetricRuleEscalationsWarnArgs;
import com.pulumi.alicloud.cms.inputs.GroupMetricRuleEscalationsInfoArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var thisRandomUuid = new RandomUuid("thisRandomUuid");
var thisGroupMetricRule = new GroupMetricRule("thisGroupMetricRule", GroupMetricRuleArgs.builder()
.groupId("539****")
.ruleId(thisRandomUuid.id())
.category("ecs")
.namespace("acs_ecs_dashboard")
.metricName("cpu_total")
.period("60")
.groupMetricRuleName("tf-testacc-rule-name")
.emailSubject("tf-testacc-rule-name-warning")
.interval("3600")
.silenceTime(85800)
.noEffectiveInterval("00:00-05:30")
.webhook("http://www.aliyun.com")
.escalations(GroupMetricRuleEscalationsArgs.builder()
.warn(GroupMetricRuleEscalationsWarnArgs.builder()
.comparisonOperator("GreaterThanOrEqualToThreshold")
.statistics("Average")
.threshold("90")
.times(3)
.build())
.info(GroupMetricRuleEscalationsInfoArgs.builder()
.comparisonOperator("LessThanLastWeek")
.statistics("Average")
.threshold("90")
.times(5)
.build())
.build())
.build());
}
}

Import

Cloud Monitor Service Group Metric Rule can be imported using the id, e.g.

$ pulumi import alicloud:cms/groupMetricRule:GroupMetricRule example <rule_id>

Properties

Link copied to clipboard
val category: Output<String>

The abbreviation of the service name.

Link copied to clipboard
val contactGroups: Output<String>

Alarm contact group.

Link copied to clipboard
val dimensions: Output<String>

The dimensions that specify the resources to be associated with the alert rule.

Link copied to clipboard

The time period during which the alert rule is effective.

Link copied to clipboard
val emailSubject: Output<String>

The subject of the alert notification email. .

Link copied to clipboard

Alarm level. See the following Block escalations.

Link copied to clipboard
val groupId: Output<String>

The ID of the application group.

Link copied to clipboard

The name of the alert rule.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val interval: Output<String>?

The interval at which Cloud Monitor checks whether the alert rule is triggered. Unit: seconds.

Link copied to clipboard
val metricName: Output<String>

The name of the metric.

Link copied to clipboard
val namespace: Output<String>

The namespace of the service.

Link copied to clipboard

The time period during which the alert rule is ineffective.

Link copied to clipboard
val period: Output<Int>

The aggregation period of the monitoring data. Unit: seconds. The value is an integral multiple of 60. Default value: 300.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val ruleId: Output<String>

The ID of the alert rule.

Link copied to clipboard
val silenceTime: Output<Int>?

The mute period during which new alerts are not reported even if the alert trigger conditions are met. Unit: seconds. Default value: 86400, which is equivalent to one day.

Link copied to clipboard
val status: Output<String>

The status of Group Metric Rule.

Link copied to clipboard

The information about the resource for which alerts are triggered. See the following Block targets.

Link copied to clipboard
val urn: Output<String>
Link copied to clipboard
val webhook: Output<String>?

The callback URL.