1. Packages
  2. Packages
  3. Alibaba Cloud Provider
  4. API Docs
  5. cloudmonitor
  6. ServiceMetricAlarmRule
Viewing docs for Alibaba Cloud v3.105.0
published on Thursday, Jul 16, 2026 by Pulumi
alicloud logo alicloud logo
Viewing docs for Alibaba Cloud v3.105.0
published on Thursday, Jul 16, 2026 by Pulumi

    Provides a Cloud Monitor Service Metric Alarm Rule resource.

    Describes the time-series metric alarm rule configured by the user.

    For information about Cloud Monitor Service Metric Alarm Rule and how to use it, see What is Metric Alarm Rule.

    NOTE: Available since v1.285.0.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const config = new pulumi.Config();
    const name = config.get("name") || "terraform-example";
    const _default = new alicloud.cloudmonitor.ServiceMetricAlarmRule("default", {
        status: true,
        sendOk: true,
        contactGroups: "云账号报警联系人",
        silenceTime: "86400",
        metricAlarmRuleId: "SystemDefault_acs_drds_IOPSUsageOfDo",
        period: "60",
        effectiveInterval: "00:00-23:59 +0800 dayofweek 1,2,3,4,5,6,7",
        noDataPolicy: "KEEP_LAST_STATE",
        namespace: "acs_drds",
        metricName: "IOPSUsageOfDN",
        escalations: {
            critical: {
                comparisonOperator: "GreaterThanThreshold",
                times: 5,
                statistics: "Average",
                threshold: "80",
            },
        },
        resources: JSON.stringify([{
            resource: "_ALL",
        }]),
        ruleName: "SystemDefault_acs_drds_IOPSUsageOfDN",
    });
    
    import pulumi
    import json
    import pulumi_alicloud as alicloud
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "terraform-example"
    default = alicloud.cloudmonitor.ServiceMetricAlarmRule("default",
        status=True,
        send_ok=True,
        contact_groups="云账号报警联系人",
        silence_time="86400",
        metric_alarm_rule_id="SystemDefault_acs_drds_IOPSUsageOfDo",
        period="60",
        effective_interval="00:00-23:59 +0800 dayofweek 1,2,3,4,5,6,7",
        no_data_policy="KEEP_LAST_STATE",
        namespace="acs_drds",
        metric_name="IOPSUsageOfDN",
        escalations={
            "critical": {
                "comparison_operator": "GreaterThanThreshold",
                "times": 5,
                "statistics": "Average",
                "threshold": "80",
            },
        },
        resources=json.dumps([{
            "resource": "_ALL",
        }]),
        rule_name="SystemDefault_acs_drds_IOPSUsageOfDN")
    
    package main
    
    import (
    	"encoding/json"
    
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/cloudmonitor"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		cfg := config.New(ctx, "")
    		name := "terraform-example"
    		if param := cfg.Get("name"); param != "" {
    			name = param
    		}
    		tmpJSON0, err := json.Marshal([]map[string]interface{}{
    			map[string]interface{}{
    				"resource": "_ALL",
    			},
    		})
    		if err != nil {
    			return err
    		}
    		json0 := string(tmpJSON0)
    		_, err = cloudmonitor.NewServiceMetricAlarmRule(ctx, "default", &cloudmonitor.ServiceMetricAlarmRuleArgs{
    			Status:            pulumi.Bool(true),
    			SendOk:            pulumi.Bool(true),
    			ContactGroups:     pulumi.String("云账号报警联系人"),
    			SilenceTime:       pulumi.String("86400"),
    			MetricAlarmRuleId: pulumi.String("SystemDefault_acs_drds_IOPSUsageOfDo"),
    			Period:            pulumi.String("60"),
    			EffectiveInterval: pulumi.String("00:00-23:59 +0800 dayofweek 1,2,3,4,5,6,7"),
    			NoDataPolicy:      pulumi.String("KEEP_LAST_STATE"),
    			Namespace:         pulumi.String("acs_drds"),
    			MetricName:        pulumi.String("IOPSUsageOfDN"),
    			Escalations: &cloudmonitor.ServiceMetricAlarmRuleEscalationsArgs{
    				Critical: &cloudmonitor.ServiceMetricAlarmRuleEscalationsCriticalArgs{
    					ComparisonOperator: pulumi.String("GreaterThanThreshold"),
    					Times:              pulumi.Int(5),
    					Statistics:         pulumi.String("Average"),
    					Threshold:          pulumi.String("80"),
    				},
    			},
    			Resources: pulumi.String(json0),
    			RuleName:  pulumi.String("SystemDefault_acs_drds_IOPSUsageOfDN"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using System.Text.Json;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var config = new Config();
        var name = config.Get("name") ?? "terraform-example";
        var @default = new AliCloud.CloudMonitor.ServiceMetricAlarmRule("default", new()
        {
            Status = true,
            SendOk = true,
            ContactGroups = "云账号报警联系人",
            SilenceTime = "86400",
            MetricAlarmRuleId = "SystemDefault_acs_drds_IOPSUsageOfDo",
            Period = "60",
            EffectiveInterval = "00:00-23:59 +0800 dayofweek 1,2,3,4,5,6,7",
            NoDataPolicy = "KEEP_LAST_STATE",
            Namespace = "acs_drds",
            MetricName = "IOPSUsageOfDN",
            Escalations = new AliCloud.CloudMonitor.Inputs.ServiceMetricAlarmRuleEscalationsArgs
            {
                Critical = new AliCloud.CloudMonitor.Inputs.ServiceMetricAlarmRuleEscalationsCriticalArgs
                {
                    ComparisonOperator = "GreaterThanThreshold",
                    Times = 5,
                    Statistics = "Average",
                    Threshold = "80",
                },
            },
            Resources = JsonSerializer.Serialize(new[]
            {
                new Dictionary<string, object?>
                {
                    ["resource"] = "_ALL",
                },
            }),
            RuleName = "SystemDefault_acs_drds_IOPSUsageOfDN",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.cloudmonitor.ServiceMetricAlarmRule;
    import com.pulumi.alicloud.cloudmonitor.ServiceMetricAlarmRuleArgs;
    import com.pulumi.alicloud.cloudmonitor.inputs.ServiceMetricAlarmRuleEscalationsArgs;
    import com.pulumi.alicloud.cloudmonitor.inputs.ServiceMetricAlarmRuleEscalationsCriticalArgs;
    import static com.pulumi.codegen.internal.Serialization.*;
    import java.util.ArrayList;
    import java.util.Arrays;
    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) {
            final var config = ctx.config();
            final var name = config.get("name").orElse("terraform-example");
            var default_ = new ServiceMetricAlarmRule("default", ServiceMetricAlarmRuleArgs.builder()
                .status(true)
                .sendOk(true)
                .contactGroups("云账号报警联系人")
                .silenceTime("86400")
                .metricAlarmRuleId("SystemDefault_acs_drds_IOPSUsageOfDo")
                .period("60")
                .effectiveInterval("00:00-23:59 +0800 dayofweek 1,2,3,4,5,6,7")
                .noDataPolicy("KEEP_LAST_STATE")
                .namespace("acs_drds")
                .metricName("IOPSUsageOfDN")
                .escalations(ServiceMetricAlarmRuleEscalationsArgs.builder()
                    .critical(ServiceMetricAlarmRuleEscalationsCriticalArgs.builder()
                        .comparisonOperator("GreaterThanThreshold")
                        .times(5)
                        .statistics("Average")
                        .threshold("80")
                        .build())
                    .build())
                .resources(serializeJson(
                    jsonArray(jsonObject(
                        jsonProperty("resource", "_ALL")
                    ))))
                .ruleName("SystemDefault_acs_drds_IOPSUsageOfDN")
                .build());
    
        }
    }
    
    configuration:
      name:
        type: string
        default: terraform-example
    resources:
      default:
        type: alicloud:cloudmonitor:ServiceMetricAlarmRule
        properties:
          status: true
          sendOk: true
          contactGroups: 云账号报警联系人
          silenceTime: '86400'
          metricAlarmRuleId: SystemDefault_acs_drds_IOPSUsageOfDo
          period: '60'
          effectiveInterval: 00:00-23:59 +0800 dayofweek 1,2,3,4,5,6,7
          noDataPolicy: KEEP_LAST_STATE
          namespace: acs_drds
          metricName: IOPSUsageOfDN
          escalations:
            critical:
              comparisonOperator: GreaterThanThreshold
              times: '5'
              statistics: Average
              threshold: '80'
          resources:
            fn::toJSON:
              - resource: _ALL
          ruleName: SystemDefault_acs_drds_IOPSUsageOfDN
    
    pulumi {
      required_providers {
        alicloud = {
          source = "pulumi/alicloud"
        }
      }
    }
    
    resource "alicloud_cloudmonitor_servicemetricalarmrule" "default" {
      status               = true
      send_ok              = true
      contact_groups       = "云账号报警联系人"
      silence_time         = "86400"
      metric_alarm_rule_id = "SystemDefault_acs_drds_IOPSUsageOfDo"
      period               = "60"
      effective_interval   = "00:00-23:59 +0800 dayofweek 1,2,3,4,5,6,7"
      no_data_policy       = "KEEP_LAST_STATE"
      namespace            = "acs_drds"
      metric_name          = "IOPSUsageOfDN"
      escalations = {
        critical = {
          comparison_operator = "GreaterThanThreshold"
          times               = "5"
          statistics          = "Average"
          threshold           = "80"
        }
      }
      resources = jsonencode([{
        "resource" = "_ALL"
      }])
      rule_name = "SystemDefault_acs_drds_IOPSUsageOfDN"
    }
    variable "name" {
      type    = string
      default = "terraform-example"
    }
    

    📚 Need more examples? VIEW MORE EXAMPLES

    Create ServiceMetricAlarmRule Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new ServiceMetricAlarmRule(name: string, args: ServiceMetricAlarmRuleArgs, opts?: CustomResourceOptions);
    @overload
    def ServiceMetricAlarmRule(resource_name: str,
                               args: ServiceMetricAlarmRuleArgs,
                               opts: Optional[ResourceOptions] = None)
    
    @overload
    def ServiceMetricAlarmRule(resource_name: str,
                               opts: Optional[ResourceOptions] = None,
                               metric_alarm_rule_id: Optional[str] = None,
                               contact_groups: Optional[str] = None,
                               rule_name: Optional[str] = None,
                               resources: Optional[str] = None,
                               namespace: Optional[str] = None,
                               metric_name: Optional[str] = None,
                               interval: Optional[str] = None,
                               prometheus: Optional[ServiceMetricAlarmRulePrometheusArgs] = None,
                               composite_expression: Optional[ServiceMetricAlarmRuleCompositeExpressionArgs] = None,
                               escalations: Optional[ServiceMetricAlarmRuleEscalationsArgs] = None,
                               no_data_policy: Optional[str] = None,
                               no_effective_interval: Optional[str] = None,
                               period: Optional[str] = None,
                               labels: Optional[Sequence[ServiceMetricAlarmRuleLabelArgs]] = None,
                               email_subject: Optional[str] = None,
                               effective_interval: Optional[str] = None,
                               send_ok: Optional[bool] = None,
                               silence_time: Optional[str] = None,
                               status: Optional[bool] = None,
                               webhook: Optional[str] = None)
    func NewServiceMetricAlarmRule(ctx *Context, name string, args ServiceMetricAlarmRuleArgs, opts ...ResourceOption) (*ServiceMetricAlarmRule, error)
    public ServiceMetricAlarmRule(string name, ServiceMetricAlarmRuleArgs args, CustomResourceOptions? opts = null)
    public ServiceMetricAlarmRule(String name, ServiceMetricAlarmRuleArgs args)
    public ServiceMetricAlarmRule(String name, ServiceMetricAlarmRuleArgs args, CustomResourceOptions options)
    
    type: alicloud:cloudmonitor:ServiceMetricAlarmRule
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "alicloud_cloudmonitor_service_metric_alarm_rule" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args ServiceMetricAlarmRuleArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args ServiceMetricAlarmRuleArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args ServiceMetricAlarmRuleArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ServiceMetricAlarmRuleArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ServiceMetricAlarmRuleArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var serviceMetricAlarmRuleResource = new AliCloud.CloudMonitor.ServiceMetricAlarmRule("serviceMetricAlarmRuleResource", new()
    {
        MetricAlarmRuleId = "string",
        ContactGroups = "string",
        RuleName = "string",
        Resources = "string",
        Namespace = "string",
        MetricName = "string",
        Interval = "string",
        Prometheus = new AliCloud.CloudMonitor.Inputs.ServiceMetricAlarmRulePrometheusArgs
        {
            Annotations = new[]
            {
                new AliCloud.CloudMonitor.Inputs.ServiceMetricAlarmRulePrometheusAnnotationArgs
                {
                    Key = "string",
                    Value = "string",
                },
            },
            Level = "string",
            PromQl = "string",
            Times = 0,
        },
        CompositeExpression = new AliCloud.CloudMonitor.Inputs.ServiceMetricAlarmRuleCompositeExpressionArgs
        {
            ExpressionListJoin = "string",
            ExpressionLists = new[]
            {
                new AliCloud.CloudMonitor.Inputs.ServiceMetricAlarmRuleCompositeExpressionExpressionListArgs
                {
                    ComparisonOperator = "string",
                    MetricName = "string",
                    Period = 0,
                    Statistics = "string",
                    Threshold = "string",
                },
            },
            ExpressionRaw = "string",
            Level = "string",
            Times = 0,
        },
        Escalations = new AliCloud.CloudMonitor.Inputs.ServiceMetricAlarmRuleEscalationsArgs
        {
            Critical = new AliCloud.CloudMonitor.Inputs.ServiceMetricAlarmRuleEscalationsCriticalArgs
            {
                ComparisonOperator = "string",
                PreCondition = "string",
                Statistics = "string",
                Threshold = "string",
                Times = 0,
            },
            Info = new AliCloud.CloudMonitor.Inputs.ServiceMetricAlarmRuleEscalationsInfoArgs
            {
                ComparisonOperator = "string",
                PreCondition = "string",
                Statistics = "string",
                Threshold = "string",
                Times = 0,
            },
            Warn = new AliCloud.CloudMonitor.Inputs.ServiceMetricAlarmRuleEscalationsWarnArgs
            {
                ComparisonOperator = "string",
                PreCondition = "string",
                Statistics = "string",
                Threshold = "string",
                Times = 0,
            },
        },
        NoDataPolicy = "string",
        NoEffectiveInterval = "string",
        Period = "string",
        Labels = new[]
        {
            new AliCloud.CloudMonitor.Inputs.ServiceMetricAlarmRuleLabelArgs
            {
                Key = "string",
                Value = "string",
            },
        },
        EmailSubject = "string",
        EffectiveInterval = "string",
        SendOk = false,
        SilenceTime = "string",
        Status = false,
        Webhook = "string",
    });
    
    example, err := cloudmonitor.NewServiceMetricAlarmRule(ctx, "serviceMetricAlarmRuleResource", &cloudmonitor.ServiceMetricAlarmRuleArgs{
    	MetricAlarmRuleId: pulumi.String("string"),
    	ContactGroups:     pulumi.String("string"),
    	RuleName:          pulumi.String("string"),
    	Resources:         pulumi.String("string"),
    	Namespace:         pulumi.String("string"),
    	MetricName:        pulumi.String("string"),
    	Interval:          pulumi.String("string"),
    	Prometheus: &cloudmonitor.ServiceMetricAlarmRulePrometheusArgs{
    		Annotations: cloudmonitor.ServiceMetricAlarmRulePrometheusAnnotationArray{
    			&cloudmonitor.ServiceMetricAlarmRulePrometheusAnnotationArgs{
    				Key:   pulumi.String("string"),
    				Value: pulumi.String("string"),
    			},
    		},
    		Level:  pulumi.String("string"),
    		PromQl: pulumi.String("string"),
    		Times:  pulumi.Int(0),
    	},
    	CompositeExpression: &cloudmonitor.ServiceMetricAlarmRuleCompositeExpressionArgs{
    		ExpressionListJoin: pulumi.String("string"),
    		ExpressionLists: cloudmonitor.ServiceMetricAlarmRuleCompositeExpressionExpressionListArray{
    			&cloudmonitor.ServiceMetricAlarmRuleCompositeExpressionExpressionListArgs{
    				ComparisonOperator: pulumi.String("string"),
    				MetricName:         pulumi.String("string"),
    				Period:             pulumi.Int(0),
    				Statistics:         pulumi.String("string"),
    				Threshold:          pulumi.String("string"),
    			},
    		},
    		ExpressionRaw: pulumi.String("string"),
    		Level:         pulumi.String("string"),
    		Times:         pulumi.Int(0),
    	},
    	Escalations: &cloudmonitor.ServiceMetricAlarmRuleEscalationsArgs{
    		Critical: &cloudmonitor.ServiceMetricAlarmRuleEscalationsCriticalArgs{
    			ComparisonOperator: pulumi.String("string"),
    			PreCondition:       pulumi.String("string"),
    			Statistics:         pulumi.String("string"),
    			Threshold:          pulumi.String("string"),
    			Times:              pulumi.Int(0),
    		},
    		Info: &cloudmonitor.ServiceMetricAlarmRuleEscalationsInfoArgs{
    			ComparisonOperator: pulumi.String("string"),
    			PreCondition:       pulumi.String("string"),
    			Statistics:         pulumi.String("string"),
    			Threshold:          pulumi.String("string"),
    			Times:              pulumi.Int(0),
    		},
    		Warn: &cloudmonitor.ServiceMetricAlarmRuleEscalationsWarnArgs{
    			ComparisonOperator: pulumi.String("string"),
    			PreCondition:       pulumi.String("string"),
    			Statistics:         pulumi.String("string"),
    			Threshold:          pulumi.String("string"),
    			Times:              pulumi.Int(0),
    		},
    	},
    	NoDataPolicy:        pulumi.String("string"),
    	NoEffectiveInterval: pulumi.String("string"),
    	Period:              pulumi.String("string"),
    	Labels: cloudmonitor.ServiceMetricAlarmRuleLabelArray{
    		&cloudmonitor.ServiceMetricAlarmRuleLabelArgs{
    			Key:   pulumi.String("string"),
    			Value: pulumi.String("string"),
    		},
    	},
    	EmailSubject:      pulumi.String("string"),
    	EffectiveInterval: pulumi.String("string"),
    	SendOk:            pulumi.Bool(false),
    	SilenceTime:       pulumi.String("string"),
    	Status:            pulumi.Bool(false),
    	Webhook:           pulumi.String("string"),
    })
    
    resource "alicloud_cloudmonitor_service_metric_alarm_rule" "serviceMetricAlarmRuleResource" {
      lifecycle {
        create_before_destroy = true
      }
      metric_alarm_rule_id = "string"
      contact_groups       = "string"
      rule_name            = "string"
      resources            = "string"
      namespace            = "string"
      metric_name          = "string"
      interval             = "string"
      prometheus = {
        annotations = [{
          key   = "string"
          value = "string"
        }]
        level   = "string"
        prom_ql = "string"
        times   = 0
      }
      composite_expression = {
        expression_list_join = "string"
        expression_lists = [{
          comparison_operator = "string"
          metric_name         = "string"
          period              = 0
          statistics          = "string"
          threshold           = "string"
        }]
        expression_raw = "string"
        level          = "string"
        times          = 0
      }
      escalations = {
        critical = {
          comparison_operator = "string"
          pre_condition       = "string"
          statistics          = "string"
          threshold           = "string"
          times               = 0
        }
        info = {
          comparison_operator = "string"
          pre_condition       = "string"
          statistics          = "string"
          threshold           = "string"
          times               = 0
        }
        warn = {
          comparison_operator = "string"
          pre_condition       = "string"
          statistics          = "string"
          threshold           = "string"
          times               = 0
        }
      }
      no_data_policy        = "string"
      no_effective_interval = "string"
      period                = "string"
      labels {
        key   = "string"
        value = "string"
      }
      email_subject      = "string"
      effective_interval = "string"
      send_ok            = false
      silence_time       = "string"
      status             = false
      webhook            = "string"
    }
    
    var serviceMetricAlarmRuleResource = new ServiceMetricAlarmRule("serviceMetricAlarmRuleResource", ServiceMetricAlarmRuleArgs.builder()
        .metricAlarmRuleId("string")
        .contactGroups("string")
        .ruleName("string")
        .resources("string")
        .namespace("string")
        .metricName("string")
        .interval("string")
        .prometheus(ServiceMetricAlarmRulePrometheusArgs.builder()
            .annotations(ServiceMetricAlarmRulePrometheusAnnotationArgs.builder()
                .key("string")
                .value("string")
                .build())
            .level("string")
            .promQl("string")
            .times(0)
            .build())
        .compositeExpression(ServiceMetricAlarmRuleCompositeExpressionArgs.builder()
            .expressionListJoin("string")
            .expressionLists(ServiceMetricAlarmRuleCompositeExpressionExpressionListArgs.builder()
                .comparisonOperator("string")
                .metricName("string")
                .period(0)
                .statistics("string")
                .threshold("string")
                .build())
            .expressionRaw("string")
            .level("string")
            .times(0)
            .build())
        .escalations(ServiceMetricAlarmRuleEscalationsArgs.builder()
            .critical(ServiceMetricAlarmRuleEscalationsCriticalArgs.builder()
                .comparisonOperator("string")
                .preCondition("string")
                .statistics("string")
                .threshold("string")
                .times(0)
                .build())
            .info(ServiceMetricAlarmRuleEscalationsInfoArgs.builder()
                .comparisonOperator("string")
                .preCondition("string")
                .statistics("string")
                .threshold("string")
                .times(0)
                .build())
            .warn(ServiceMetricAlarmRuleEscalationsWarnArgs.builder()
                .comparisonOperator("string")
                .preCondition("string")
                .statistics("string")
                .threshold("string")
                .times(0)
                .build())
            .build())
        .noDataPolicy("string")
        .noEffectiveInterval("string")
        .period("string")
        .labels(ServiceMetricAlarmRuleLabelArgs.builder()
            .key("string")
            .value("string")
            .build())
        .emailSubject("string")
        .effectiveInterval("string")
        .sendOk(false)
        .silenceTime("string")
        .status(false)
        .webhook("string")
        .build());
    
    service_metric_alarm_rule_resource = alicloud.cloudmonitor.ServiceMetricAlarmRule("serviceMetricAlarmRuleResource",
        metric_alarm_rule_id="string",
        contact_groups="string",
        rule_name="string",
        resources="string",
        namespace="string",
        metric_name="string",
        interval="string",
        prometheus={
            "annotations": [{
                "key": "string",
                "value": "string",
            }],
            "level": "string",
            "prom_ql": "string",
            "times": 0,
        },
        composite_expression={
            "expression_list_join": "string",
            "expression_lists": [{
                "comparison_operator": "string",
                "metric_name": "string",
                "period": 0,
                "statistics": "string",
                "threshold": "string",
            }],
            "expression_raw": "string",
            "level": "string",
            "times": 0,
        },
        escalations={
            "critical": {
                "comparison_operator": "string",
                "pre_condition": "string",
                "statistics": "string",
                "threshold": "string",
                "times": 0,
            },
            "info": {
                "comparison_operator": "string",
                "pre_condition": "string",
                "statistics": "string",
                "threshold": "string",
                "times": 0,
            },
            "warn": {
                "comparison_operator": "string",
                "pre_condition": "string",
                "statistics": "string",
                "threshold": "string",
                "times": 0,
            },
        },
        no_data_policy="string",
        no_effective_interval="string",
        period="string",
        labels=[{
            "key": "string",
            "value": "string",
        }],
        email_subject="string",
        effective_interval="string",
        send_ok=False,
        silence_time="string",
        status=False,
        webhook="string")
    
    const serviceMetricAlarmRuleResource = new alicloud.cloudmonitor.ServiceMetricAlarmRule("serviceMetricAlarmRuleResource", {
        metricAlarmRuleId: "string",
        contactGroups: "string",
        ruleName: "string",
        resources: "string",
        namespace: "string",
        metricName: "string",
        interval: "string",
        prometheus: {
            annotations: [{
                key: "string",
                value: "string",
            }],
            level: "string",
            promQl: "string",
            times: 0,
        },
        compositeExpression: {
            expressionListJoin: "string",
            expressionLists: [{
                comparisonOperator: "string",
                metricName: "string",
                period: 0,
                statistics: "string",
                threshold: "string",
            }],
            expressionRaw: "string",
            level: "string",
            times: 0,
        },
        escalations: {
            critical: {
                comparisonOperator: "string",
                preCondition: "string",
                statistics: "string",
                threshold: "string",
                times: 0,
            },
            info: {
                comparisonOperator: "string",
                preCondition: "string",
                statistics: "string",
                threshold: "string",
                times: 0,
            },
            warn: {
                comparisonOperator: "string",
                preCondition: "string",
                statistics: "string",
                threshold: "string",
                times: 0,
            },
        },
        noDataPolicy: "string",
        noEffectiveInterval: "string",
        period: "string",
        labels: [{
            key: "string",
            value: "string",
        }],
        emailSubject: "string",
        effectiveInterval: "string",
        sendOk: false,
        silenceTime: "string",
        status: false,
        webhook: "string",
    });
    
    type: alicloud:cloudmonitor:ServiceMetricAlarmRule
    properties:
        compositeExpression:
            expressionListJoin: string
            expressionLists:
                - comparisonOperator: string
                  metricName: string
                  period: 0
                  statistics: string
                  threshold: string
            expressionRaw: string
            level: string
            times: 0
        contactGroups: string
        effectiveInterval: string
        emailSubject: string
        escalations:
            critical:
                comparisonOperator: string
                preCondition: string
                statistics: string
                threshold: string
                times: 0
            info:
                comparisonOperator: string
                preCondition: string
                statistics: string
                threshold: string
                times: 0
            warn:
                comparisonOperator: string
                preCondition: string
                statistics: string
                threshold: string
                times: 0
        interval: string
        labels:
            - key: string
              value: string
        metricAlarmRuleId: string
        metricName: string
        namespace: string
        noDataPolicy: string
        noEffectiveInterval: string
        period: string
        prometheus:
            annotations:
                - key: string
                  value: string
            level: string
            promQl: string
            times: 0
        resources: string
        ruleName: string
        sendOk: false
        silenceTime: string
        status: false
        webhook: string
    

    ServiceMetricAlarmRule Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The ServiceMetricAlarmRule resource accepts the following input properties:

    ContactGroups string

    Alarm contact groups. Alarm notifications are sent to the contacts in these groups.

    NOTE: An alarm contact group is a collection of one or more alarm contacts. For information about how to create alarm contacts and alarm contact groups, see PutContact and PutContactGroup.

    MetricAlarmRuleId string

    The ID of the alarm rule.

    You can specify a new alarm rule ID or use an existing alarm rule ID from CloudMonitor. For information about how to query alarm rule IDs, see DescribeMetricRuleList.

    NOTE: Specifying a new alarm rule ID creates a threshold-based alarm rule.

    MetricName string

    The name of the metric. For information about how to query metric names, see Cloud Service Metrics.

    NOTE: When you create a Prometheus alert rule for Enterprise Cloud Monitoring, this parameter specifies the metric store name. For information about how to obtain the metric store name, see DescribeHybridMonitorNamespaceList.

    Namespace string

    The namespace of the cloud service metric data. For information about how to query the namespace of a cloud service, see Cloud Service Metrics.

    NOTE: When you create a Prometheus alert rule for Enterprise Cloud Monitoring, this parameter must be set to acsPrometheus.

    Resources string
    Resource information, for example: [{"instanceId":"i-uf6j91r34rnwawoo****"}], [{"userId":"100931896542****"}]. For dimensions supported in resource information, see Cloud Service Metrics.
    RuleName string

    Alert rule name.

    You can enter a new alert rule name or use an existing alert rule name in CloudMonitor. For information about how to query alert rule names, see DescribeMetricRuleList.

    NOTE: Entering a new alert rule name creates a threshold-based alert rule.

    CompositeExpression Pulumi.AliCloud.CloudMonitor.Inputs.ServiceMetricAlarmRuleCompositeExpression

    Alert condition for multiple metrics.

    NOTE: Single-metric and multi-metric conditions are mutually exclusive and cannot be configured simultaneously. See compositeExpression below.

    EffectiveInterval string
    The time range during which the alert rule is effective.
    EmailSubject string
    Subject of alert emails.
    Escalations Pulumi.AliCloud.CloudMonitor.Inputs.ServiceMetricAlarmRuleEscalations
    The trigger conditions for alert levels. See escalations below.
    Interval string

    The trigger interval of the alarm rule. Unit: seconds.

    NOTE: For information about how to query the statistical period of a metric, see Cloud Service Metrics.

    NOTE: This parameter is immutable. Changing it after creation has no effect.

    Labels List<Pulumi.AliCloud.CloudMonitor.Inputs.ServiceMetricAlarmRuleLabel>

    When a metric meets the alert condition and an alert is triggered, the labels are written to the metric and displayed in the alert notification.

    NOTE: This feature is equivalent to the Label in Prometheus alerts. See labels below.

    NoDataPolicy string
    The policy to apply when no monitoring data is available. Valid values:

    • KEEP_LAST_STATE (default): No action is taken.
    • INSUFFICIENT_DATA: The alert status is set to "Insufficient Data."
    • OK: The alert status is set to "OK."
    NoEffectiveInterval string
    The time range during which the alarm rule is inactive.
    Period string

    The statistical period of the metric. Unit: seconds. By default, this is the original reporting period of the metric.

    NOTE: For information about how to query the statistical period of a metric, see Cloud Service Metrics.

    Prometheus Pulumi.AliCloud.CloudMonitor.Inputs.ServiceMetricAlarmRulePrometheus

    Prometheus alert.

    NOTE: You must specify this parameter only when you create a Prometheus alert rule for Enterprise Cloud Monitor. See prometheus below.

    SendOk bool
    Specifies whether to send recovery notifications.
    SilenceTime string

    Channel silence period. Unit: seconds. Default value: 86400.

    NOTE: The channel silence period specifies how long to wait before resending an alarm notification if the alarm condition has not returned to normal after the initial alarm.

    Status bool
    The enabled status of the alarm rule. Valid values:

    • true: enabled.
    • false: disabled.
    Webhook string
    The URL address specified for callback when an alert is triggered. A POST request is sent to this URL.
    ContactGroups string

    Alarm contact groups. Alarm notifications are sent to the contacts in these groups.

    NOTE: An alarm contact group is a collection of one or more alarm contacts. For information about how to create alarm contacts and alarm contact groups, see PutContact and PutContactGroup.

    MetricAlarmRuleId string

    The ID of the alarm rule.

    You can specify a new alarm rule ID or use an existing alarm rule ID from CloudMonitor. For information about how to query alarm rule IDs, see DescribeMetricRuleList.

    NOTE: Specifying a new alarm rule ID creates a threshold-based alarm rule.

    MetricName string

    The name of the metric. For information about how to query metric names, see Cloud Service Metrics.

    NOTE: When you create a Prometheus alert rule for Enterprise Cloud Monitoring, this parameter specifies the metric store name. For information about how to obtain the metric store name, see DescribeHybridMonitorNamespaceList.

    Namespace string

    The namespace of the cloud service metric data. For information about how to query the namespace of a cloud service, see Cloud Service Metrics.

    NOTE: When you create a Prometheus alert rule for Enterprise Cloud Monitoring, this parameter must be set to acsPrometheus.

    Resources string
    Resource information, for example: [{"instanceId":"i-uf6j91r34rnwawoo****"}], [{"userId":"100931896542****"}]. For dimensions supported in resource information, see Cloud Service Metrics.
    RuleName string

    Alert rule name.

    You can enter a new alert rule name or use an existing alert rule name in CloudMonitor. For information about how to query alert rule names, see DescribeMetricRuleList.

    NOTE: Entering a new alert rule name creates a threshold-based alert rule.

    CompositeExpression ServiceMetricAlarmRuleCompositeExpressionArgs

    Alert condition for multiple metrics.

    NOTE: Single-metric and multi-metric conditions are mutually exclusive and cannot be configured simultaneously. See compositeExpression below.

    EffectiveInterval string
    The time range during which the alert rule is effective.
    EmailSubject string
    Subject of alert emails.
    Escalations ServiceMetricAlarmRuleEscalationsArgs
    The trigger conditions for alert levels. See escalations below.
    Interval string

    The trigger interval of the alarm rule. Unit: seconds.

    NOTE: For information about how to query the statistical period of a metric, see Cloud Service Metrics.

    NOTE: This parameter is immutable. Changing it after creation has no effect.

    Labels []ServiceMetricAlarmRuleLabelArgs

    When a metric meets the alert condition and an alert is triggered, the labels are written to the metric and displayed in the alert notification.

    NOTE: This feature is equivalent to the Label in Prometheus alerts. See labels below.

    NoDataPolicy string
    The policy to apply when no monitoring data is available. Valid values:

    • KEEP_LAST_STATE (default): No action is taken.
    • INSUFFICIENT_DATA: The alert status is set to "Insufficient Data."
    • OK: The alert status is set to "OK."
    NoEffectiveInterval string
    The time range during which the alarm rule is inactive.
    Period string

    The statistical period of the metric. Unit: seconds. By default, this is the original reporting period of the metric.

    NOTE: For information about how to query the statistical period of a metric, see Cloud Service Metrics.

    Prometheus ServiceMetricAlarmRulePrometheusArgs

    Prometheus alert.

    NOTE: You must specify this parameter only when you create a Prometheus alert rule for Enterprise Cloud Monitor. See prometheus below.

    SendOk bool
    Specifies whether to send recovery notifications.
    SilenceTime string

    Channel silence period. Unit: seconds. Default value: 86400.

    NOTE: The channel silence period specifies how long to wait before resending an alarm notification if the alarm condition has not returned to normal after the initial alarm.

    Status bool
    The enabled status of the alarm rule. Valid values:

    • true: enabled.
    • false: disabled.
    Webhook string
    The URL address specified for callback when an alert is triggered. A POST request is sent to this URL.
    contact_groups string

    Alarm contact groups. Alarm notifications are sent to the contacts in these groups.

    NOTE: An alarm contact group is a collection of one or more alarm contacts. For information about how to create alarm contacts and alarm contact groups, see PutContact and PutContactGroup.

    metric_alarm_rule_id string

    The ID of the alarm rule.

    You can specify a new alarm rule ID or use an existing alarm rule ID from CloudMonitor. For information about how to query alarm rule IDs, see DescribeMetricRuleList.

    NOTE: Specifying a new alarm rule ID creates a threshold-based alarm rule.

    metric_name string

    The name of the metric. For information about how to query metric names, see Cloud Service Metrics.

    NOTE: When you create a Prometheus alert rule for Enterprise Cloud Monitoring, this parameter specifies the metric store name. For information about how to obtain the metric store name, see DescribeHybridMonitorNamespaceList.

    namespace string

    The namespace of the cloud service metric data. For information about how to query the namespace of a cloud service, see Cloud Service Metrics.

    NOTE: When you create a Prometheus alert rule for Enterprise Cloud Monitoring, this parameter must be set to acsPrometheus.

    resources string
    Resource information, for example: [{"instanceId":"i-uf6j91r34rnwawoo****"}], [{"userId":"100931896542****"}]. For dimensions supported in resource information, see Cloud Service Metrics.
    rule_name string

    Alert rule name.

    You can enter a new alert rule name or use an existing alert rule name in CloudMonitor. For information about how to query alert rule names, see DescribeMetricRuleList.

    NOTE: Entering a new alert rule name creates a threshold-based alert rule.

    composite_expression object

    Alert condition for multiple metrics.

    NOTE: Single-metric and multi-metric conditions are mutually exclusive and cannot be configured simultaneously. See compositeExpression below.

    effective_interval string
    The time range during which the alert rule is effective.
    email_subject string
    Subject of alert emails.
    escalations object
    The trigger conditions for alert levels. See escalations below.
    interval string

    The trigger interval of the alarm rule. Unit: seconds.

    NOTE: For information about how to query the statistical period of a metric, see Cloud Service Metrics.

    NOTE: This parameter is immutable. Changing it after creation has no effect.

    labels list(object)

    When a metric meets the alert condition and an alert is triggered, the labels are written to the metric and displayed in the alert notification.

    NOTE: This feature is equivalent to the Label in Prometheus alerts. See labels below.

    no_data_policy string
    The policy to apply when no monitoring data is available. Valid values:

    • KEEP_LAST_STATE (default): No action is taken.
    • INSUFFICIENT_DATA: The alert status is set to "Insufficient Data."
    • OK: The alert status is set to "OK."
    no_effective_interval string
    The time range during which the alarm rule is inactive.
    period string

    The statistical period of the metric. Unit: seconds. By default, this is the original reporting period of the metric.

    NOTE: For information about how to query the statistical period of a metric, see Cloud Service Metrics.

    prometheus object

    Prometheus alert.

    NOTE: You must specify this parameter only when you create a Prometheus alert rule for Enterprise Cloud Monitor. See prometheus below.

    send_ok bool
    Specifies whether to send recovery notifications.
    silence_time string

    Channel silence period. Unit: seconds. Default value: 86400.

    NOTE: The channel silence period specifies how long to wait before resending an alarm notification if the alarm condition has not returned to normal after the initial alarm.

    status bool
    The enabled status of the alarm rule. Valid values:

    • true: enabled.
    • false: disabled.
    webhook string
    The URL address specified for callback when an alert is triggered. A POST request is sent to this URL.
    contactGroups String

    Alarm contact groups. Alarm notifications are sent to the contacts in these groups.

    NOTE: An alarm contact group is a collection of one or more alarm contacts. For information about how to create alarm contacts and alarm contact groups, see PutContact and PutContactGroup.

    metricAlarmRuleId String

    The ID of the alarm rule.

    You can specify a new alarm rule ID or use an existing alarm rule ID from CloudMonitor. For information about how to query alarm rule IDs, see DescribeMetricRuleList.

    NOTE: Specifying a new alarm rule ID creates a threshold-based alarm rule.

    metricName String

    The name of the metric. For information about how to query metric names, see Cloud Service Metrics.

    NOTE: When you create a Prometheus alert rule for Enterprise Cloud Monitoring, this parameter specifies the metric store name. For information about how to obtain the metric store name, see DescribeHybridMonitorNamespaceList.

    namespace String

    The namespace of the cloud service metric data. For information about how to query the namespace of a cloud service, see Cloud Service Metrics.

    NOTE: When you create a Prometheus alert rule for Enterprise Cloud Monitoring, this parameter must be set to acsPrometheus.

    resources String
    Resource information, for example: [{"instanceId":"i-uf6j91r34rnwawoo****"}], [{"userId":"100931896542****"}]. For dimensions supported in resource information, see Cloud Service Metrics.
    ruleName String

    Alert rule name.

    You can enter a new alert rule name or use an existing alert rule name in CloudMonitor. For information about how to query alert rule names, see DescribeMetricRuleList.

    NOTE: Entering a new alert rule name creates a threshold-based alert rule.

    compositeExpression ServiceMetricAlarmRuleCompositeExpression

    Alert condition for multiple metrics.

    NOTE: Single-metric and multi-metric conditions are mutually exclusive and cannot be configured simultaneously. See compositeExpression below.

    effectiveInterval String
    The time range during which the alert rule is effective.
    emailSubject String
    Subject of alert emails.
    escalations ServiceMetricAlarmRuleEscalations
    The trigger conditions for alert levels. See escalations below.
    interval String

    The trigger interval of the alarm rule. Unit: seconds.

    NOTE: For information about how to query the statistical period of a metric, see Cloud Service Metrics.

    NOTE: This parameter is immutable. Changing it after creation has no effect.

    labels List<ServiceMetricAlarmRuleLabel>

    When a metric meets the alert condition and an alert is triggered, the labels are written to the metric and displayed in the alert notification.

    NOTE: This feature is equivalent to the Label in Prometheus alerts. See labels below.

    noDataPolicy String
    The policy to apply when no monitoring data is available. Valid values:

    • KEEP_LAST_STATE (default): No action is taken.
    • INSUFFICIENT_DATA: The alert status is set to "Insufficient Data."
    • OK: The alert status is set to "OK."
    noEffectiveInterval String
    The time range during which the alarm rule is inactive.
    period String

    The statistical period of the metric. Unit: seconds. By default, this is the original reporting period of the metric.

    NOTE: For information about how to query the statistical period of a metric, see Cloud Service Metrics.

    prometheus ServiceMetricAlarmRulePrometheus

    Prometheus alert.

    NOTE: You must specify this parameter only when you create a Prometheus alert rule for Enterprise Cloud Monitor. See prometheus below.

    sendOk Boolean
    Specifies whether to send recovery notifications.
    silenceTime String

    Channel silence period. Unit: seconds. Default value: 86400.

    NOTE: The channel silence period specifies how long to wait before resending an alarm notification if the alarm condition has not returned to normal after the initial alarm.

    status Boolean
    The enabled status of the alarm rule. Valid values:

    • true: enabled.
    • false: disabled.
    webhook String
    The URL address specified for callback when an alert is triggered. A POST request is sent to this URL.
    contactGroups string

    Alarm contact groups. Alarm notifications are sent to the contacts in these groups.

    NOTE: An alarm contact group is a collection of one or more alarm contacts. For information about how to create alarm contacts and alarm contact groups, see PutContact and PutContactGroup.

    metricAlarmRuleId string

    The ID of the alarm rule.

    You can specify a new alarm rule ID or use an existing alarm rule ID from CloudMonitor. For information about how to query alarm rule IDs, see DescribeMetricRuleList.

    NOTE: Specifying a new alarm rule ID creates a threshold-based alarm rule.

    metricName string

    The name of the metric. For information about how to query metric names, see Cloud Service Metrics.

    NOTE: When you create a Prometheus alert rule for Enterprise Cloud Monitoring, this parameter specifies the metric store name. For information about how to obtain the metric store name, see DescribeHybridMonitorNamespaceList.

    namespace string

    The namespace of the cloud service metric data. For information about how to query the namespace of a cloud service, see Cloud Service Metrics.

    NOTE: When you create a Prometheus alert rule for Enterprise Cloud Monitoring, this parameter must be set to acsPrometheus.

    resources string
    Resource information, for example: [{"instanceId":"i-uf6j91r34rnwawoo****"}], [{"userId":"100931896542****"}]. For dimensions supported in resource information, see Cloud Service Metrics.
    ruleName string

    Alert rule name.

    You can enter a new alert rule name or use an existing alert rule name in CloudMonitor. For information about how to query alert rule names, see DescribeMetricRuleList.

    NOTE: Entering a new alert rule name creates a threshold-based alert rule.

    compositeExpression ServiceMetricAlarmRuleCompositeExpression

    Alert condition for multiple metrics.

    NOTE: Single-metric and multi-metric conditions are mutually exclusive and cannot be configured simultaneously. See compositeExpression below.

    effectiveInterval string
    The time range during which the alert rule is effective.
    emailSubject string
    Subject of alert emails.
    escalations ServiceMetricAlarmRuleEscalations
    The trigger conditions for alert levels. See escalations below.
    interval string

    The trigger interval of the alarm rule. Unit: seconds.

    NOTE: For information about how to query the statistical period of a metric, see Cloud Service Metrics.

    NOTE: This parameter is immutable. Changing it after creation has no effect.

    labels ServiceMetricAlarmRuleLabel[]

    When a metric meets the alert condition and an alert is triggered, the labels are written to the metric and displayed in the alert notification.

    NOTE: This feature is equivalent to the Label in Prometheus alerts. See labels below.

    noDataPolicy string
    The policy to apply when no monitoring data is available. Valid values:

    • KEEP_LAST_STATE (default): No action is taken.
    • INSUFFICIENT_DATA: The alert status is set to "Insufficient Data."
    • OK: The alert status is set to "OK."
    noEffectiveInterval string
    The time range during which the alarm rule is inactive.
    period string

    The statistical period of the metric. Unit: seconds. By default, this is the original reporting period of the metric.

    NOTE: For information about how to query the statistical period of a metric, see Cloud Service Metrics.

    prometheus ServiceMetricAlarmRulePrometheus

    Prometheus alert.

    NOTE: You must specify this parameter only when you create a Prometheus alert rule for Enterprise Cloud Monitor. See prometheus below.

    sendOk boolean
    Specifies whether to send recovery notifications.
    silenceTime string

    Channel silence period. Unit: seconds. Default value: 86400.

    NOTE: The channel silence period specifies how long to wait before resending an alarm notification if the alarm condition has not returned to normal after the initial alarm.

    status boolean
    The enabled status of the alarm rule. Valid values:

    • true: enabled.
    • false: disabled.
    webhook string
    The URL address specified for callback when an alert is triggered. A POST request is sent to this URL.
    contact_groups str

    Alarm contact groups. Alarm notifications are sent to the contacts in these groups.

    NOTE: An alarm contact group is a collection of one or more alarm contacts. For information about how to create alarm contacts and alarm contact groups, see PutContact and PutContactGroup.

    metric_alarm_rule_id str

    The ID of the alarm rule.

    You can specify a new alarm rule ID or use an existing alarm rule ID from CloudMonitor. For information about how to query alarm rule IDs, see DescribeMetricRuleList.

    NOTE: Specifying a new alarm rule ID creates a threshold-based alarm rule.

    metric_name str

    The name of the metric. For information about how to query metric names, see Cloud Service Metrics.

    NOTE: When you create a Prometheus alert rule for Enterprise Cloud Monitoring, this parameter specifies the metric store name. For information about how to obtain the metric store name, see DescribeHybridMonitorNamespaceList.

    namespace str

    The namespace of the cloud service metric data. For information about how to query the namespace of a cloud service, see Cloud Service Metrics.

    NOTE: When you create a Prometheus alert rule for Enterprise Cloud Monitoring, this parameter must be set to acsPrometheus.

    resources str
    Resource information, for example: [{"instanceId":"i-uf6j91r34rnwawoo****"}], [{"userId":"100931896542****"}]. For dimensions supported in resource information, see Cloud Service Metrics.
    rule_name str

    Alert rule name.

    You can enter a new alert rule name or use an existing alert rule name in CloudMonitor. For information about how to query alert rule names, see DescribeMetricRuleList.

    NOTE: Entering a new alert rule name creates a threshold-based alert rule.

    composite_expression ServiceMetricAlarmRuleCompositeExpressionArgs

    Alert condition for multiple metrics.

    NOTE: Single-metric and multi-metric conditions are mutually exclusive and cannot be configured simultaneously. See compositeExpression below.

    effective_interval str
    The time range during which the alert rule is effective.
    email_subject str
    Subject of alert emails.
    escalations ServiceMetricAlarmRuleEscalationsArgs
    The trigger conditions for alert levels. See escalations below.
    interval str

    The trigger interval of the alarm rule. Unit: seconds.

    NOTE: For information about how to query the statistical period of a metric, see Cloud Service Metrics.

    NOTE: This parameter is immutable. Changing it after creation has no effect.

    labels Sequence[ServiceMetricAlarmRuleLabelArgs]

    When a metric meets the alert condition and an alert is triggered, the labels are written to the metric and displayed in the alert notification.

    NOTE: This feature is equivalent to the Label in Prometheus alerts. See labels below.

    no_data_policy str
    The policy to apply when no monitoring data is available. Valid values:

    • KEEP_LAST_STATE (default): No action is taken.
    • INSUFFICIENT_DATA: The alert status is set to "Insufficient Data."
    • OK: The alert status is set to "OK."
    no_effective_interval str
    The time range during which the alarm rule is inactive.
    period str

    The statistical period of the metric. Unit: seconds. By default, this is the original reporting period of the metric.

    NOTE: For information about how to query the statistical period of a metric, see Cloud Service Metrics.

    prometheus ServiceMetricAlarmRulePrometheusArgs

    Prometheus alert.

    NOTE: You must specify this parameter only when you create a Prometheus alert rule for Enterprise Cloud Monitor. See prometheus below.

    send_ok bool
    Specifies whether to send recovery notifications.
    silence_time str

    Channel silence period. Unit: seconds. Default value: 86400.

    NOTE: The channel silence period specifies how long to wait before resending an alarm notification if the alarm condition has not returned to normal after the initial alarm.

    status bool
    The enabled status of the alarm rule. Valid values:

    • true: enabled.
    • false: disabled.
    webhook str
    The URL address specified for callback when an alert is triggered. A POST request is sent to this URL.
    contactGroups String

    Alarm contact groups. Alarm notifications are sent to the contacts in these groups.

    NOTE: An alarm contact group is a collection of one or more alarm contacts. For information about how to create alarm contacts and alarm contact groups, see PutContact and PutContactGroup.

    metricAlarmRuleId String

    The ID of the alarm rule.

    You can specify a new alarm rule ID or use an existing alarm rule ID from CloudMonitor. For information about how to query alarm rule IDs, see DescribeMetricRuleList.

    NOTE: Specifying a new alarm rule ID creates a threshold-based alarm rule.

    metricName String

    The name of the metric. For information about how to query metric names, see Cloud Service Metrics.

    NOTE: When you create a Prometheus alert rule for Enterprise Cloud Monitoring, this parameter specifies the metric store name. For information about how to obtain the metric store name, see DescribeHybridMonitorNamespaceList.

    namespace String

    The namespace of the cloud service metric data. For information about how to query the namespace of a cloud service, see Cloud Service Metrics.

    NOTE: When you create a Prometheus alert rule for Enterprise Cloud Monitoring, this parameter must be set to acsPrometheus.

    resources String
    Resource information, for example: [{"instanceId":"i-uf6j91r34rnwawoo****"}], [{"userId":"100931896542****"}]. For dimensions supported in resource information, see Cloud Service Metrics.
    ruleName String

    Alert rule name.

    You can enter a new alert rule name or use an existing alert rule name in CloudMonitor. For information about how to query alert rule names, see DescribeMetricRuleList.

    NOTE: Entering a new alert rule name creates a threshold-based alert rule.

    compositeExpression Property Map

    Alert condition for multiple metrics.

    NOTE: Single-metric and multi-metric conditions are mutually exclusive and cannot be configured simultaneously. See compositeExpression below.

    effectiveInterval String
    The time range during which the alert rule is effective.
    emailSubject String
    Subject of alert emails.
    escalations Property Map
    The trigger conditions for alert levels. See escalations below.
    interval String

    The trigger interval of the alarm rule. Unit: seconds.

    NOTE: For information about how to query the statistical period of a metric, see Cloud Service Metrics.

    NOTE: This parameter is immutable. Changing it after creation has no effect.

    labels List<Property Map>

    When a metric meets the alert condition and an alert is triggered, the labels are written to the metric and displayed in the alert notification.

    NOTE: This feature is equivalent to the Label in Prometheus alerts. See labels below.

    noDataPolicy String
    The policy to apply when no monitoring data is available. Valid values:

    • KEEP_LAST_STATE (default): No action is taken.
    • INSUFFICIENT_DATA: The alert status is set to "Insufficient Data."
    • OK: The alert status is set to "OK."
    noEffectiveInterval String
    The time range during which the alarm rule is inactive.
    period String

    The statistical period of the metric. Unit: seconds. By default, this is the original reporting period of the metric.

    NOTE: For information about how to query the statistical period of a metric, see Cloud Service Metrics.

    prometheus Property Map

    Prometheus alert.

    NOTE: You must specify this parameter only when you create a Prometheus alert rule for Enterprise Cloud Monitor. See prometheus below.

    sendOk Boolean
    Specifies whether to send recovery notifications.
    silenceTime String

    Channel silence period. Unit: seconds. Default value: 86400.

    NOTE: The channel silence period specifies how long to wait before resending an alarm notification if the alarm condition has not returned to normal after the initial alarm.

    status Boolean
    The enabled status of the alarm rule. Valid values:

    • true: enabled.
    • false: disabled.
    webhook String
    The URL address specified for callback when an alert is triggered. A POST request is sent to this URL.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the ServiceMetricAlarmRule resource produces the following output properties:

    Dimensions string
    The monitoring dimensions for the specified resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    SourceType string
    The type of the alarm rule.
    Dimensions string
    The monitoring dimensions for the specified resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    SourceType string
    The type of the alarm rule.
    dimensions string
    The monitoring dimensions for the specified resource.
    id string
    The provider-assigned unique ID for this managed resource.
    source_type string
    The type of the alarm rule.
    dimensions String
    The monitoring dimensions for the specified resource.
    id String
    The provider-assigned unique ID for this managed resource.
    sourceType String
    The type of the alarm rule.
    dimensions string
    The monitoring dimensions for the specified resource.
    id string
    The provider-assigned unique ID for this managed resource.
    sourceType string
    The type of the alarm rule.
    dimensions str
    The monitoring dimensions for the specified resource.
    id str
    The provider-assigned unique ID for this managed resource.
    source_type str
    The type of the alarm rule.
    dimensions String
    The monitoring dimensions for the specified resource.
    id String
    The provider-assigned unique ID for this managed resource.
    sourceType String
    The type of the alarm rule.

    Look up Existing ServiceMetricAlarmRule Resource

    Get an existing ServiceMetricAlarmRule resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: ServiceMetricAlarmRuleState, opts?: CustomResourceOptions): ServiceMetricAlarmRule
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            composite_expression: Optional[ServiceMetricAlarmRuleCompositeExpressionArgs] = None,
            contact_groups: Optional[str] = None,
            dimensions: Optional[str] = None,
            effective_interval: Optional[str] = None,
            email_subject: Optional[str] = None,
            escalations: Optional[ServiceMetricAlarmRuleEscalationsArgs] = None,
            interval: Optional[str] = None,
            labels: Optional[Sequence[ServiceMetricAlarmRuleLabelArgs]] = None,
            metric_alarm_rule_id: Optional[str] = None,
            metric_name: Optional[str] = None,
            namespace: Optional[str] = None,
            no_data_policy: Optional[str] = None,
            no_effective_interval: Optional[str] = None,
            period: Optional[str] = None,
            prometheus: Optional[ServiceMetricAlarmRulePrometheusArgs] = None,
            resources: Optional[str] = None,
            rule_name: Optional[str] = None,
            send_ok: Optional[bool] = None,
            silence_time: Optional[str] = None,
            source_type: Optional[str] = None,
            status: Optional[bool] = None,
            webhook: Optional[str] = None) -> ServiceMetricAlarmRule
    func GetServiceMetricAlarmRule(ctx *Context, name string, id IDInput, state *ServiceMetricAlarmRuleState, opts ...ResourceOption) (*ServiceMetricAlarmRule, error)
    public static ServiceMetricAlarmRule Get(string name, Input<string> id, ServiceMetricAlarmRuleState? state, CustomResourceOptions? opts = null)
    public static ServiceMetricAlarmRule get(String name, Output<String> id, ServiceMetricAlarmRuleState state, CustomResourceOptions options)
    resources:  _:    type: alicloud:cloudmonitor:ServiceMetricAlarmRule    get:      id: ${id}
    import {
      to = alicloud_cloudmonitor_service_metric_alarm_rule.example
      id = "${id}"
    }
    
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    CompositeExpression Pulumi.AliCloud.CloudMonitor.Inputs.ServiceMetricAlarmRuleCompositeExpression

    Alert condition for multiple metrics.

    NOTE: Single-metric and multi-metric conditions are mutually exclusive and cannot be configured simultaneously. See compositeExpression below.

    ContactGroups string

    Alarm contact groups. Alarm notifications are sent to the contacts in these groups.

    NOTE: An alarm contact group is a collection of one or more alarm contacts. For information about how to create alarm contacts and alarm contact groups, see PutContact and PutContactGroup.

    Dimensions string
    The monitoring dimensions for the specified resource.
    EffectiveInterval string
    The time range during which the alert rule is effective.
    EmailSubject string
    Subject of alert emails.
    Escalations Pulumi.AliCloud.CloudMonitor.Inputs.ServiceMetricAlarmRuleEscalations
    The trigger conditions for alert levels. See escalations below.
    Interval string

    The trigger interval of the alarm rule. Unit: seconds.

    NOTE: For information about how to query the statistical period of a metric, see Cloud Service Metrics.

    NOTE: This parameter is immutable. Changing it after creation has no effect.

    Labels List<Pulumi.AliCloud.CloudMonitor.Inputs.ServiceMetricAlarmRuleLabel>

    When a metric meets the alert condition and an alert is triggered, the labels are written to the metric and displayed in the alert notification.

    NOTE: This feature is equivalent to the Label in Prometheus alerts. See labels below.

    MetricAlarmRuleId string

    The ID of the alarm rule.

    You can specify a new alarm rule ID or use an existing alarm rule ID from CloudMonitor. For information about how to query alarm rule IDs, see DescribeMetricRuleList.

    NOTE: Specifying a new alarm rule ID creates a threshold-based alarm rule.

    MetricName string

    The name of the metric. For information about how to query metric names, see Cloud Service Metrics.

    NOTE: When you create a Prometheus alert rule for Enterprise Cloud Monitoring, this parameter specifies the metric store name. For information about how to obtain the metric store name, see DescribeHybridMonitorNamespaceList.

    Namespace string

    The namespace of the cloud service metric data. For information about how to query the namespace of a cloud service, see Cloud Service Metrics.

    NOTE: When you create a Prometheus alert rule for Enterprise Cloud Monitoring, this parameter must be set to acsPrometheus.

    NoDataPolicy string
    The policy to apply when no monitoring data is available. Valid values:

    • KEEP_LAST_STATE (default): No action is taken.
    • INSUFFICIENT_DATA: The alert status is set to "Insufficient Data."
    • OK: The alert status is set to "OK."
    NoEffectiveInterval string
    The time range during which the alarm rule is inactive.
    Period string

    The statistical period of the metric. Unit: seconds. By default, this is the original reporting period of the metric.

    NOTE: For information about how to query the statistical period of a metric, see Cloud Service Metrics.

    Prometheus Pulumi.AliCloud.CloudMonitor.Inputs.ServiceMetricAlarmRulePrometheus

    Prometheus alert.

    NOTE: You must specify this parameter only when you create a Prometheus alert rule for Enterprise Cloud Monitor. See prometheus below.

    Resources string
    Resource information, for example: [{"instanceId":"i-uf6j91r34rnwawoo****"}], [{"userId":"100931896542****"}]. For dimensions supported in resource information, see Cloud Service Metrics.
    RuleName string

    Alert rule name.

    You can enter a new alert rule name or use an existing alert rule name in CloudMonitor. For information about how to query alert rule names, see DescribeMetricRuleList.

    NOTE: Entering a new alert rule name creates a threshold-based alert rule.

    SendOk bool
    Specifies whether to send recovery notifications.
    SilenceTime string

    Channel silence period. Unit: seconds. Default value: 86400.

    NOTE: The channel silence period specifies how long to wait before resending an alarm notification if the alarm condition has not returned to normal after the initial alarm.

    SourceType string
    The type of the alarm rule.
    Status bool
    The enabled status of the alarm rule. Valid values:

    • true: enabled.
    • false: disabled.
    Webhook string
    The URL address specified for callback when an alert is triggered. A POST request is sent to this URL.
    CompositeExpression ServiceMetricAlarmRuleCompositeExpressionArgs

    Alert condition for multiple metrics.

    NOTE: Single-metric and multi-metric conditions are mutually exclusive and cannot be configured simultaneously. See compositeExpression below.

    ContactGroups string

    Alarm contact groups. Alarm notifications are sent to the contacts in these groups.

    NOTE: An alarm contact group is a collection of one or more alarm contacts. For information about how to create alarm contacts and alarm contact groups, see PutContact and PutContactGroup.

    Dimensions string
    The monitoring dimensions for the specified resource.
    EffectiveInterval string
    The time range during which the alert rule is effective.
    EmailSubject string
    Subject of alert emails.
    Escalations ServiceMetricAlarmRuleEscalationsArgs
    The trigger conditions for alert levels. See escalations below.
    Interval string

    The trigger interval of the alarm rule. Unit: seconds.

    NOTE: For information about how to query the statistical period of a metric, see Cloud Service Metrics.

    NOTE: This parameter is immutable. Changing it after creation has no effect.

    Labels []ServiceMetricAlarmRuleLabelArgs

    When a metric meets the alert condition and an alert is triggered, the labels are written to the metric and displayed in the alert notification.

    NOTE: This feature is equivalent to the Label in Prometheus alerts. See labels below.

    MetricAlarmRuleId string

    The ID of the alarm rule.

    You can specify a new alarm rule ID or use an existing alarm rule ID from CloudMonitor. For information about how to query alarm rule IDs, see DescribeMetricRuleList.

    NOTE: Specifying a new alarm rule ID creates a threshold-based alarm rule.

    MetricName string

    The name of the metric. For information about how to query metric names, see Cloud Service Metrics.

    NOTE: When you create a Prometheus alert rule for Enterprise Cloud Monitoring, this parameter specifies the metric store name. For information about how to obtain the metric store name, see DescribeHybridMonitorNamespaceList.

    Namespace string

    The namespace of the cloud service metric data. For information about how to query the namespace of a cloud service, see Cloud Service Metrics.

    NOTE: When you create a Prometheus alert rule for Enterprise Cloud Monitoring, this parameter must be set to acsPrometheus.

    NoDataPolicy string
    The policy to apply when no monitoring data is available. Valid values:

    • KEEP_LAST_STATE (default): No action is taken.
    • INSUFFICIENT_DATA: The alert status is set to "Insufficient Data."
    • OK: The alert status is set to "OK."
    NoEffectiveInterval string
    The time range during which the alarm rule is inactive.
    Period string

    The statistical period of the metric. Unit: seconds. By default, this is the original reporting period of the metric.

    NOTE: For information about how to query the statistical period of a metric, see Cloud Service Metrics.

    Prometheus ServiceMetricAlarmRulePrometheusArgs

    Prometheus alert.

    NOTE: You must specify this parameter only when you create a Prometheus alert rule for Enterprise Cloud Monitor. See prometheus below.

    Resources string
    Resource information, for example: [{"instanceId":"i-uf6j91r34rnwawoo****"}], [{"userId":"100931896542****"}]. For dimensions supported in resource information, see Cloud Service Metrics.
    RuleName string

    Alert rule name.

    You can enter a new alert rule name or use an existing alert rule name in CloudMonitor. For information about how to query alert rule names, see DescribeMetricRuleList.

    NOTE: Entering a new alert rule name creates a threshold-based alert rule.

    SendOk bool
    Specifies whether to send recovery notifications.
    SilenceTime string

    Channel silence period. Unit: seconds. Default value: 86400.

    NOTE: The channel silence period specifies how long to wait before resending an alarm notification if the alarm condition has not returned to normal after the initial alarm.

    SourceType string
    The type of the alarm rule.
    Status bool
    The enabled status of the alarm rule. Valid values:

    • true: enabled.
    • false: disabled.
    Webhook string
    The URL address specified for callback when an alert is triggered. A POST request is sent to this URL.
    composite_expression object

    Alert condition for multiple metrics.

    NOTE: Single-metric and multi-metric conditions are mutually exclusive and cannot be configured simultaneously. See compositeExpression below.

    contact_groups string

    Alarm contact groups. Alarm notifications are sent to the contacts in these groups.

    NOTE: An alarm contact group is a collection of one or more alarm contacts. For information about how to create alarm contacts and alarm contact groups, see PutContact and PutContactGroup.

    dimensions string
    The monitoring dimensions for the specified resource.
    effective_interval string
    The time range during which the alert rule is effective.
    email_subject string
    Subject of alert emails.
    escalations object
    The trigger conditions for alert levels. See escalations below.
    interval string

    The trigger interval of the alarm rule. Unit: seconds.

    NOTE: For information about how to query the statistical period of a metric, see Cloud Service Metrics.

    NOTE: This parameter is immutable. Changing it after creation has no effect.

    labels list(object)

    When a metric meets the alert condition and an alert is triggered, the labels are written to the metric and displayed in the alert notification.

    NOTE: This feature is equivalent to the Label in Prometheus alerts. See labels below.

    metric_alarm_rule_id string

    The ID of the alarm rule.

    You can specify a new alarm rule ID or use an existing alarm rule ID from CloudMonitor. For information about how to query alarm rule IDs, see DescribeMetricRuleList.

    NOTE: Specifying a new alarm rule ID creates a threshold-based alarm rule.

    metric_name string

    The name of the metric. For information about how to query metric names, see Cloud Service Metrics.

    NOTE: When you create a Prometheus alert rule for Enterprise Cloud Monitoring, this parameter specifies the metric store name. For information about how to obtain the metric store name, see DescribeHybridMonitorNamespaceList.

    namespace string

    The namespace of the cloud service metric data. For information about how to query the namespace of a cloud service, see Cloud Service Metrics.

    NOTE: When you create a Prometheus alert rule for Enterprise Cloud Monitoring, this parameter must be set to acsPrometheus.

    no_data_policy string
    The policy to apply when no monitoring data is available. Valid values:

    • KEEP_LAST_STATE (default): No action is taken.
    • INSUFFICIENT_DATA: The alert status is set to "Insufficient Data."
    • OK: The alert status is set to "OK."
    no_effective_interval string
    The time range during which the alarm rule is inactive.
    period string

    The statistical period of the metric. Unit: seconds. By default, this is the original reporting period of the metric.

    NOTE: For information about how to query the statistical period of a metric, see Cloud Service Metrics.

    prometheus object

    Prometheus alert.

    NOTE: You must specify this parameter only when you create a Prometheus alert rule for Enterprise Cloud Monitor. See prometheus below.

    resources string
    Resource information, for example: [{"instanceId":"i-uf6j91r34rnwawoo****"}], [{"userId":"100931896542****"}]. For dimensions supported in resource information, see Cloud Service Metrics.
    rule_name string

    Alert rule name.

    You can enter a new alert rule name or use an existing alert rule name in CloudMonitor. For information about how to query alert rule names, see DescribeMetricRuleList.

    NOTE: Entering a new alert rule name creates a threshold-based alert rule.

    send_ok bool
    Specifies whether to send recovery notifications.
    silence_time string

    Channel silence period. Unit: seconds. Default value: 86400.

    NOTE: The channel silence period specifies how long to wait before resending an alarm notification if the alarm condition has not returned to normal after the initial alarm.

    source_type string
    The type of the alarm rule.
    status bool
    The enabled status of the alarm rule. Valid values:

    • true: enabled.
    • false: disabled.
    webhook string
    The URL address specified for callback when an alert is triggered. A POST request is sent to this URL.
    compositeExpression ServiceMetricAlarmRuleCompositeExpression

    Alert condition for multiple metrics.

    NOTE: Single-metric and multi-metric conditions are mutually exclusive and cannot be configured simultaneously. See compositeExpression below.

    contactGroups String

    Alarm contact groups. Alarm notifications are sent to the contacts in these groups.

    NOTE: An alarm contact group is a collection of one or more alarm contacts. For information about how to create alarm contacts and alarm contact groups, see PutContact and PutContactGroup.

    dimensions String
    The monitoring dimensions for the specified resource.
    effectiveInterval String
    The time range during which the alert rule is effective.
    emailSubject String
    Subject of alert emails.
    escalations ServiceMetricAlarmRuleEscalations
    The trigger conditions for alert levels. See escalations below.
    interval String

    The trigger interval of the alarm rule. Unit: seconds.

    NOTE: For information about how to query the statistical period of a metric, see Cloud Service Metrics.

    NOTE: This parameter is immutable. Changing it after creation has no effect.

    labels List<ServiceMetricAlarmRuleLabel>

    When a metric meets the alert condition and an alert is triggered, the labels are written to the metric and displayed in the alert notification.

    NOTE: This feature is equivalent to the Label in Prometheus alerts. See labels below.

    metricAlarmRuleId String

    The ID of the alarm rule.

    You can specify a new alarm rule ID or use an existing alarm rule ID from CloudMonitor. For information about how to query alarm rule IDs, see DescribeMetricRuleList.

    NOTE: Specifying a new alarm rule ID creates a threshold-based alarm rule.

    metricName String

    The name of the metric. For information about how to query metric names, see Cloud Service Metrics.

    NOTE: When you create a Prometheus alert rule for Enterprise Cloud Monitoring, this parameter specifies the metric store name. For information about how to obtain the metric store name, see DescribeHybridMonitorNamespaceList.

    namespace String

    The namespace of the cloud service metric data. For information about how to query the namespace of a cloud service, see Cloud Service Metrics.

    NOTE: When you create a Prometheus alert rule for Enterprise Cloud Monitoring, this parameter must be set to acsPrometheus.

    noDataPolicy String
    The policy to apply when no monitoring data is available. Valid values:

    • KEEP_LAST_STATE (default): No action is taken.
    • INSUFFICIENT_DATA: The alert status is set to "Insufficient Data."
    • OK: The alert status is set to "OK."
    noEffectiveInterval String
    The time range during which the alarm rule is inactive.
    period String

    The statistical period of the metric. Unit: seconds. By default, this is the original reporting period of the metric.

    NOTE: For information about how to query the statistical period of a metric, see Cloud Service Metrics.

    prometheus ServiceMetricAlarmRulePrometheus

    Prometheus alert.

    NOTE: You must specify this parameter only when you create a Prometheus alert rule for Enterprise Cloud Monitor. See prometheus below.

    resources String
    Resource information, for example: [{"instanceId":"i-uf6j91r34rnwawoo****"}], [{"userId":"100931896542****"}]. For dimensions supported in resource information, see Cloud Service Metrics.
    ruleName String

    Alert rule name.

    You can enter a new alert rule name or use an existing alert rule name in CloudMonitor. For information about how to query alert rule names, see DescribeMetricRuleList.

    NOTE: Entering a new alert rule name creates a threshold-based alert rule.

    sendOk Boolean
    Specifies whether to send recovery notifications.
    silenceTime String

    Channel silence period. Unit: seconds. Default value: 86400.

    NOTE: The channel silence period specifies how long to wait before resending an alarm notification if the alarm condition has not returned to normal after the initial alarm.

    sourceType String
    The type of the alarm rule.
    status Boolean
    The enabled status of the alarm rule. Valid values:

    • true: enabled.
    • false: disabled.
    webhook String
    The URL address specified for callback when an alert is triggered. A POST request is sent to this URL.
    compositeExpression ServiceMetricAlarmRuleCompositeExpression

    Alert condition for multiple metrics.

    NOTE: Single-metric and multi-metric conditions are mutually exclusive and cannot be configured simultaneously. See compositeExpression below.

    contactGroups string

    Alarm contact groups. Alarm notifications are sent to the contacts in these groups.

    NOTE: An alarm contact group is a collection of one or more alarm contacts. For information about how to create alarm contacts and alarm contact groups, see PutContact and PutContactGroup.

    dimensions string
    The monitoring dimensions for the specified resource.
    effectiveInterval string
    The time range during which the alert rule is effective.
    emailSubject string
    Subject of alert emails.
    escalations ServiceMetricAlarmRuleEscalations
    The trigger conditions for alert levels. See escalations below.
    interval string

    The trigger interval of the alarm rule. Unit: seconds.

    NOTE: For information about how to query the statistical period of a metric, see Cloud Service Metrics.

    NOTE: This parameter is immutable. Changing it after creation has no effect.

    labels ServiceMetricAlarmRuleLabel[]

    When a metric meets the alert condition and an alert is triggered, the labels are written to the metric and displayed in the alert notification.

    NOTE: This feature is equivalent to the Label in Prometheus alerts. See labels below.

    metricAlarmRuleId string

    The ID of the alarm rule.

    You can specify a new alarm rule ID or use an existing alarm rule ID from CloudMonitor. For information about how to query alarm rule IDs, see DescribeMetricRuleList.

    NOTE: Specifying a new alarm rule ID creates a threshold-based alarm rule.

    metricName string

    The name of the metric. For information about how to query metric names, see Cloud Service Metrics.

    NOTE: When you create a Prometheus alert rule for Enterprise Cloud Monitoring, this parameter specifies the metric store name. For information about how to obtain the metric store name, see DescribeHybridMonitorNamespaceList.

    namespace string

    The namespace of the cloud service metric data. For information about how to query the namespace of a cloud service, see Cloud Service Metrics.

    NOTE: When you create a Prometheus alert rule for Enterprise Cloud Monitoring, this parameter must be set to acsPrometheus.

    noDataPolicy string
    The policy to apply when no monitoring data is available. Valid values:

    • KEEP_LAST_STATE (default): No action is taken.
    • INSUFFICIENT_DATA: The alert status is set to "Insufficient Data."
    • OK: The alert status is set to "OK."
    noEffectiveInterval string
    The time range during which the alarm rule is inactive.
    period string

    The statistical period of the metric. Unit: seconds. By default, this is the original reporting period of the metric.

    NOTE: For information about how to query the statistical period of a metric, see Cloud Service Metrics.

    prometheus ServiceMetricAlarmRulePrometheus

    Prometheus alert.

    NOTE: You must specify this parameter only when you create a Prometheus alert rule for Enterprise Cloud Monitor. See prometheus below.

    resources string
    Resource information, for example: [{"instanceId":"i-uf6j91r34rnwawoo****"}], [{"userId":"100931896542****"}]. For dimensions supported in resource information, see Cloud Service Metrics.
    ruleName string

    Alert rule name.

    You can enter a new alert rule name or use an existing alert rule name in CloudMonitor. For information about how to query alert rule names, see DescribeMetricRuleList.

    NOTE: Entering a new alert rule name creates a threshold-based alert rule.

    sendOk boolean
    Specifies whether to send recovery notifications.
    silenceTime string

    Channel silence period. Unit: seconds. Default value: 86400.

    NOTE: The channel silence period specifies how long to wait before resending an alarm notification if the alarm condition has not returned to normal after the initial alarm.

    sourceType string
    The type of the alarm rule.
    status boolean
    The enabled status of the alarm rule. Valid values:

    • true: enabled.
    • false: disabled.
    webhook string
    The URL address specified for callback when an alert is triggered. A POST request is sent to this URL.
    composite_expression ServiceMetricAlarmRuleCompositeExpressionArgs

    Alert condition for multiple metrics.

    NOTE: Single-metric and multi-metric conditions are mutually exclusive and cannot be configured simultaneously. See compositeExpression below.

    contact_groups str

    Alarm contact groups. Alarm notifications are sent to the contacts in these groups.

    NOTE: An alarm contact group is a collection of one or more alarm contacts. For information about how to create alarm contacts and alarm contact groups, see PutContact and PutContactGroup.

    dimensions str
    The monitoring dimensions for the specified resource.
    effective_interval str
    The time range during which the alert rule is effective.
    email_subject str
    Subject of alert emails.
    escalations ServiceMetricAlarmRuleEscalationsArgs
    The trigger conditions for alert levels. See escalations below.
    interval str

    The trigger interval of the alarm rule. Unit: seconds.

    NOTE: For information about how to query the statistical period of a metric, see Cloud Service Metrics.

    NOTE: This parameter is immutable. Changing it after creation has no effect.

    labels Sequence[ServiceMetricAlarmRuleLabelArgs]

    When a metric meets the alert condition and an alert is triggered, the labels are written to the metric and displayed in the alert notification.

    NOTE: This feature is equivalent to the Label in Prometheus alerts. See labels below.

    metric_alarm_rule_id str

    The ID of the alarm rule.

    You can specify a new alarm rule ID or use an existing alarm rule ID from CloudMonitor. For information about how to query alarm rule IDs, see DescribeMetricRuleList.

    NOTE: Specifying a new alarm rule ID creates a threshold-based alarm rule.

    metric_name str

    The name of the metric. For information about how to query metric names, see Cloud Service Metrics.

    NOTE: When you create a Prometheus alert rule for Enterprise Cloud Monitoring, this parameter specifies the metric store name. For information about how to obtain the metric store name, see DescribeHybridMonitorNamespaceList.

    namespace str

    The namespace of the cloud service metric data. For information about how to query the namespace of a cloud service, see Cloud Service Metrics.

    NOTE: When you create a Prometheus alert rule for Enterprise Cloud Monitoring, this parameter must be set to acsPrometheus.

    no_data_policy str
    The policy to apply when no monitoring data is available. Valid values:

    • KEEP_LAST_STATE (default): No action is taken.
    • INSUFFICIENT_DATA: The alert status is set to "Insufficient Data."
    • OK: The alert status is set to "OK."
    no_effective_interval str
    The time range during which the alarm rule is inactive.
    period str

    The statistical period of the metric. Unit: seconds. By default, this is the original reporting period of the metric.

    NOTE: For information about how to query the statistical period of a metric, see Cloud Service Metrics.

    prometheus ServiceMetricAlarmRulePrometheusArgs

    Prometheus alert.

    NOTE: You must specify this parameter only when you create a Prometheus alert rule for Enterprise Cloud Monitor. See prometheus below.

    resources str
    Resource information, for example: [{"instanceId":"i-uf6j91r34rnwawoo****"}], [{"userId":"100931896542****"}]. For dimensions supported in resource information, see Cloud Service Metrics.
    rule_name str

    Alert rule name.

    You can enter a new alert rule name or use an existing alert rule name in CloudMonitor. For information about how to query alert rule names, see DescribeMetricRuleList.

    NOTE: Entering a new alert rule name creates a threshold-based alert rule.

    send_ok bool
    Specifies whether to send recovery notifications.
    silence_time str

    Channel silence period. Unit: seconds. Default value: 86400.

    NOTE: The channel silence period specifies how long to wait before resending an alarm notification if the alarm condition has not returned to normal after the initial alarm.

    source_type str
    The type of the alarm rule.
    status bool
    The enabled status of the alarm rule. Valid values:

    • true: enabled.
    • false: disabled.
    webhook str
    The URL address specified for callback when an alert is triggered. A POST request is sent to this URL.
    compositeExpression Property Map

    Alert condition for multiple metrics.

    NOTE: Single-metric and multi-metric conditions are mutually exclusive and cannot be configured simultaneously. See compositeExpression below.

    contactGroups String

    Alarm contact groups. Alarm notifications are sent to the contacts in these groups.

    NOTE: An alarm contact group is a collection of one or more alarm contacts. For information about how to create alarm contacts and alarm contact groups, see PutContact and PutContactGroup.

    dimensions String
    The monitoring dimensions for the specified resource.
    effectiveInterval String
    The time range during which the alert rule is effective.
    emailSubject String
    Subject of alert emails.
    escalations Property Map
    The trigger conditions for alert levels. See escalations below.
    interval String

    The trigger interval of the alarm rule. Unit: seconds.

    NOTE: For information about how to query the statistical period of a metric, see Cloud Service Metrics.

    NOTE: This parameter is immutable. Changing it after creation has no effect.

    labels List<Property Map>

    When a metric meets the alert condition and an alert is triggered, the labels are written to the metric and displayed in the alert notification.

    NOTE: This feature is equivalent to the Label in Prometheus alerts. See labels below.

    metricAlarmRuleId String

    The ID of the alarm rule.

    You can specify a new alarm rule ID or use an existing alarm rule ID from CloudMonitor. For information about how to query alarm rule IDs, see DescribeMetricRuleList.

    NOTE: Specifying a new alarm rule ID creates a threshold-based alarm rule.

    metricName String

    The name of the metric. For information about how to query metric names, see Cloud Service Metrics.

    NOTE: When you create a Prometheus alert rule for Enterprise Cloud Monitoring, this parameter specifies the metric store name. For information about how to obtain the metric store name, see DescribeHybridMonitorNamespaceList.

    namespace String

    The namespace of the cloud service metric data. For information about how to query the namespace of a cloud service, see Cloud Service Metrics.

    NOTE: When you create a Prometheus alert rule for Enterprise Cloud Monitoring, this parameter must be set to acsPrometheus.

    noDataPolicy String
    The policy to apply when no monitoring data is available. Valid values:

    • KEEP_LAST_STATE (default): No action is taken.
    • INSUFFICIENT_DATA: The alert status is set to "Insufficient Data."
    • OK: The alert status is set to "OK."
    noEffectiveInterval String
    The time range during which the alarm rule is inactive.
    period String

    The statistical period of the metric. Unit: seconds. By default, this is the original reporting period of the metric.

    NOTE: For information about how to query the statistical period of a metric, see Cloud Service Metrics.

    prometheus Property Map

    Prometheus alert.

    NOTE: You must specify this parameter only when you create a Prometheus alert rule for Enterprise Cloud Monitor. See prometheus below.

    resources String
    Resource information, for example: [{"instanceId":"i-uf6j91r34rnwawoo****"}], [{"userId":"100931896542****"}]. For dimensions supported in resource information, see Cloud Service Metrics.
    ruleName String

    Alert rule name.

    You can enter a new alert rule name or use an existing alert rule name in CloudMonitor. For information about how to query alert rule names, see DescribeMetricRuleList.

    NOTE: Entering a new alert rule name creates a threshold-based alert rule.

    sendOk Boolean
    Specifies whether to send recovery notifications.
    silenceTime String

    Channel silence period. Unit: seconds. Default value: 86400.

    NOTE: The channel silence period specifies how long to wait before resending an alarm notification if the alarm condition has not returned to normal after the initial alarm.

    sourceType String
    The type of the alarm rule.
    status Boolean
    The enabled status of the alarm rule. Valid values:

    • true: enabled.
    • false: disabled.
    webhook String
    The URL address specified for callback when an alert is triggered. A POST request is sent to this URL.

    Supporting Types

    ServiceMetricAlarmRuleCompositeExpression, ServiceMetricAlarmRuleCompositeExpressionArgs

    ExpressionListJoin string
    The logical relationship between multiple metric-based alert conditions. Valid values:

    • &&: An alert is triggered only when all metrics meet their respective alert conditions. That is, an alert is triggered only when every expression in ExpressionList evaluates to true.
    • ||: An alert is triggered as soon as any one metric meets its alert condition.
    ExpressionLists List<Pulumi.AliCloud.CloudMonitor.Inputs.ServiceMetricAlarmRuleCompositeExpressionExpressionList>
    A list of alert conditions created using standard expressions. See expressionList below.
    ExpressionRaw string
    The alert condition created by an expression. This includes, but is not limited to, the following scenarios:

    • Configure an alert blacklist for specific resources. For example: $instanceId != 'i-io8kfvcpp7x5****' && $Average > 50 means that even if the Average metric of instance i-io8kfvcpp7x5**** in the alert rule exceeds 50, no alert will be triggered.
    • Set a special alert threshold for a specified instance in the rule. For example: $Average > ($instanceId == 'i-io8kfvcpp7x5****' ? 80 : 50) means that an alert is triggered only when the Average metric of instance i-io8kfvcpp7x5**** exceeds 80, while for other instances, an alert is triggered when their Average exceeds 50.
    • Limit the number of instances exceeding the threshold in the rule. For example: count($Average > 20) > 3 means that an alert is triggered only when more than three instances in the alert rule have an Average metric greater than 20.
    Level string
    The alert severity level. Valid values:

    • CRITICAL: Critical.
    • WARN: Warning.
    • INFO: Information.
    Times int
    Number of consecutive times the alert condition must be met before an alert notification is sent.
    ExpressionListJoin string
    The logical relationship between multiple metric-based alert conditions. Valid values:

    • &&: An alert is triggered only when all metrics meet their respective alert conditions. That is, an alert is triggered only when every expression in ExpressionList evaluates to true.
    • ||: An alert is triggered as soon as any one metric meets its alert condition.
    ExpressionLists []ServiceMetricAlarmRuleCompositeExpressionExpressionList
    A list of alert conditions created using standard expressions. See expressionList below.
    ExpressionRaw string
    The alert condition created by an expression. This includes, but is not limited to, the following scenarios:

    • Configure an alert blacklist for specific resources. For example: $instanceId != 'i-io8kfvcpp7x5****' && $Average > 50 means that even if the Average metric of instance i-io8kfvcpp7x5**** in the alert rule exceeds 50, no alert will be triggered.
    • Set a special alert threshold for a specified instance in the rule. For example: $Average > ($instanceId == 'i-io8kfvcpp7x5****' ? 80 : 50) means that an alert is triggered only when the Average metric of instance i-io8kfvcpp7x5**** exceeds 80, while for other instances, an alert is triggered when their Average exceeds 50.
    • Limit the number of instances exceeding the threshold in the rule. For example: count($Average > 20) > 3 means that an alert is triggered only when more than three instances in the alert rule have an Average metric greater than 20.
    Level string
    The alert severity level. Valid values:

    • CRITICAL: Critical.
    • WARN: Warning.
    • INFO: Information.
    Times int
    Number of consecutive times the alert condition must be met before an alert notification is sent.
    expression_list_join string
    The logical relationship between multiple metric-based alert conditions. Valid values:

    • &&: An alert is triggered only when all metrics meet their respective alert conditions. That is, an alert is triggered only when every expression in ExpressionList evaluates to true.
    • ||: An alert is triggered as soon as any one metric meets its alert condition.
    expression_lists list(object)
    A list of alert conditions created using standard expressions. See expressionList below.
    expression_raw string
    The alert condition created by an expression. This includes, but is not limited to, the following scenarios:

    • Configure an alert blacklist for specific resources. For example: $instanceId != 'i-io8kfvcpp7x5****' && $Average > 50 means that even if the Average metric of instance i-io8kfvcpp7x5**** in the alert rule exceeds 50, no alert will be triggered.
    • Set a special alert threshold for a specified instance in the rule. For example: $Average > ($instanceId == 'i-io8kfvcpp7x5****' ? 80 : 50) means that an alert is triggered only when the Average metric of instance i-io8kfvcpp7x5**** exceeds 80, while for other instances, an alert is triggered when their Average exceeds 50.
    • Limit the number of instances exceeding the threshold in the rule. For example: count($Average > 20) > 3 means that an alert is triggered only when more than three instances in the alert rule have an Average metric greater than 20.
    level string
    The alert severity level. Valid values:

    • CRITICAL: Critical.
    • WARN: Warning.
    • INFO: Information.
    times number
    Number of consecutive times the alert condition must be met before an alert notification is sent.
    expressionListJoin String
    The logical relationship between multiple metric-based alert conditions. Valid values:

    • &&: An alert is triggered only when all metrics meet their respective alert conditions. That is, an alert is triggered only when every expression in ExpressionList evaluates to true.
    • ||: An alert is triggered as soon as any one metric meets its alert condition.
    expressionLists List<ServiceMetricAlarmRuleCompositeExpressionExpressionList>
    A list of alert conditions created using standard expressions. See expressionList below.
    expressionRaw String
    The alert condition created by an expression. This includes, but is not limited to, the following scenarios:

    • Configure an alert blacklist for specific resources. For example: $instanceId != 'i-io8kfvcpp7x5****' && $Average > 50 means that even if the Average metric of instance i-io8kfvcpp7x5**** in the alert rule exceeds 50, no alert will be triggered.
    • Set a special alert threshold for a specified instance in the rule. For example: $Average > ($instanceId == 'i-io8kfvcpp7x5****' ? 80 : 50) means that an alert is triggered only when the Average metric of instance i-io8kfvcpp7x5**** exceeds 80, while for other instances, an alert is triggered when their Average exceeds 50.
    • Limit the number of instances exceeding the threshold in the rule. For example: count($Average > 20) > 3 means that an alert is triggered only when more than three instances in the alert rule have an Average metric greater than 20.
    level String
    The alert severity level. Valid values:

    • CRITICAL: Critical.
    • WARN: Warning.
    • INFO: Information.
    times Integer
    Number of consecutive times the alert condition must be met before an alert notification is sent.
    expressionListJoin string
    The logical relationship between multiple metric-based alert conditions. Valid values:

    • &&: An alert is triggered only when all metrics meet their respective alert conditions. That is, an alert is triggered only when every expression in ExpressionList evaluates to true.
    • ||: An alert is triggered as soon as any one metric meets its alert condition.
    expressionLists ServiceMetricAlarmRuleCompositeExpressionExpressionList[]
    A list of alert conditions created using standard expressions. See expressionList below.
    expressionRaw string
    The alert condition created by an expression. This includes, but is not limited to, the following scenarios:

    • Configure an alert blacklist for specific resources. For example: $instanceId != 'i-io8kfvcpp7x5****' && $Average > 50 means that even if the Average metric of instance i-io8kfvcpp7x5**** in the alert rule exceeds 50, no alert will be triggered.
    • Set a special alert threshold for a specified instance in the rule. For example: $Average > ($instanceId == 'i-io8kfvcpp7x5****' ? 80 : 50) means that an alert is triggered only when the Average metric of instance i-io8kfvcpp7x5**** exceeds 80, while for other instances, an alert is triggered when their Average exceeds 50.
    • Limit the number of instances exceeding the threshold in the rule. For example: count($Average > 20) > 3 means that an alert is triggered only when more than three instances in the alert rule have an Average metric greater than 20.
    level string
    The alert severity level. Valid values:

    • CRITICAL: Critical.
    • WARN: Warning.
    • INFO: Information.
    times number
    Number of consecutive times the alert condition must be met before an alert notification is sent.
    expression_list_join str
    The logical relationship between multiple metric-based alert conditions. Valid values:

    • &&: An alert is triggered only when all metrics meet their respective alert conditions. That is, an alert is triggered only when every expression in ExpressionList evaluates to true.
    • ||: An alert is triggered as soon as any one metric meets its alert condition.
    expression_lists Sequence[ServiceMetricAlarmRuleCompositeExpressionExpressionList]
    A list of alert conditions created using standard expressions. See expressionList below.
    expression_raw str
    The alert condition created by an expression. This includes, but is not limited to, the following scenarios:

    • Configure an alert blacklist for specific resources. For example: $instanceId != 'i-io8kfvcpp7x5****' && $Average > 50 means that even if the Average metric of instance i-io8kfvcpp7x5**** in the alert rule exceeds 50, no alert will be triggered.
    • Set a special alert threshold for a specified instance in the rule. For example: $Average > ($instanceId == 'i-io8kfvcpp7x5****' ? 80 : 50) means that an alert is triggered only when the Average metric of instance i-io8kfvcpp7x5**** exceeds 80, while for other instances, an alert is triggered when their Average exceeds 50.
    • Limit the number of instances exceeding the threshold in the rule. For example: count($Average > 20) > 3 means that an alert is triggered only when more than three instances in the alert rule have an Average metric greater than 20.
    level str
    The alert severity level. Valid values:

    • CRITICAL: Critical.
    • WARN: Warning.
    • INFO: Information.
    times int
    Number of consecutive times the alert condition must be met before an alert notification is sent.
    expressionListJoin String
    The logical relationship between multiple metric-based alert conditions. Valid values:

    • &&: An alert is triggered only when all metrics meet their respective alert conditions. That is, an alert is triggered only when every expression in ExpressionList evaluates to true.
    • ||: An alert is triggered as soon as any one metric meets its alert condition.
    expressionLists List<Property Map>
    A list of alert conditions created using standard expressions. See expressionList below.
    expressionRaw String
    The alert condition created by an expression. This includes, but is not limited to, the following scenarios:

    • Configure an alert blacklist for specific resources. For example: $instanceId != 'i-io8kfvcpp7x5****' && $Average > 50 means that even if the Average metric of instance i-io8kfvcpp7x5**** in the alert rule exceeds 50, no alert will be triggered.
    • Set a special alert threshold for a specified instance in the rule. For example: $Average > ($instanceId == 'i-io8kfvcpp7x5****' ? 80 : 50) means that an alert is triggered only when the Average metric of instance i-io8kfvcpp7x5**** exceeds 80, while for other instances, an alert is triggered when their Average exceeds 50.
    • Limit the number of instances exceeding the threshold in the rule. For example: count($Average > 20) > 3 means that an alert is triggered only when more than three instances in the alert rule have an Average metric greater than 20.
    level String
    The alert severity level. Valid values:

    • CRITICAL: Critical.
    • WARN: Warning.
    • INFO: Information.
    times Number
    Number of consecutive times the alert condition must be met before an alert notification is sent.

    ServiceMetricAlarmRuleCompositeExpressionExpressionList, ServiceMetricAlarmRuleCompositeExpressionExpressionListArgs

    ComparisonOperator string
    MetricName string

    The name of the metric. For information about how to query metric names, see Cloud Service Metrics.

    NOTE: When you create a Prometheus alert rule for Enterprise Cloud Monitoring, this parameter specifies the metric store name. For information about how to obtain the metric store name, see DescribeHybridMonitorNamespaceList.

    Period int

    The statistical period of the metric. Unit: seconds. By default, this is the original reporting period of the metric.

    NOTE: For information about how to query the statistical period of a metric, see Cloud Service Metrics.

    Statistics string
    Threshold string
    ComparisonOperator string
    MetricName string

    The name of the metric. For information about how to query metric names, see Cloud Service Metrics.

    NOTE: When you create a Prometheus alert rule for Enterprise Cloud Monitoring, this parameter specifies the metric store name. For information about how to obtain the metric store name, see DescribeHybridMonitorNamespaceList.

    Period int

    The statistical period of the metric. Unit: seconds. By default, this is the original reporting period of the metric.

    NOTE: For information about how to query the statistical period of a metric, see Cloud Service Metrics.

    Statistics string
    Threshold string
    comparison_operator string
    metric_name string

    The name of the metric. For information about how to query metric names, see Cloud Service Metrics.

    NOTE: When you create a Prometheus alert rule for Enterprise Cloud Monitoring, this parameter specifies the metric store name. For information about how to obtain the metric store name, see DescribeHybridMonitorNamespaceList.

    period number

    The statistical period of the metric. Unit: seconds. By default, this is the original reporting period of the metric.

    NOTE: For information about how to query the statistical period of a metric, see Cloud Service Metrics.

    statistics string
    threshold string
    comparisonOperator String
    metricName String

    The name of the metric. For information about how to query metric names, see Cloud Service Metrics.

    NOTE: When you create a Prometheus alert rule for Enterprise Cloud Monitoring, this parameter specifies the metric store name. For information about how to obtain the metric store name, see DescribeHybridMonitorNamespaceList.

    period Integer

    The statistical period of the metric. Unit: seconds. By default, this is the original reporting period of the metric.

    NOTE: For information about how to query the statistical period of a metric, see Cloud Service Metrics.

    statistics String
    threshold String
    comparisonOperator string
    metricName string

    The name of the metric. For information about how to query metric names, see Cloud Service Metrics.

    NOTE: When you create a Prometheus alert rule for Enterprise Cloud Monitoring, this parameter specifies the metric store name. For information about how to obtain the metric store name, see DescribeHybridMonitorNamespaceList.

    period number

    The statistical period of the metric. Unit: seconds. By default, this is the original reporting period of the metric.

    NOTE: For information about how to query the statistical period of a metric, see Cloud Service Metrics.

    statistics string
    threshold string
    comparison_operator str
    metric_name str

    The name of the metric. For information about how to query metric names, see Cloud Service Metrics.

    NOTE: When you create a Prometheus alert rule for Enterprise Cloud Monitoring, this parameter specifies the metric store name. For information about how to obtain the metric store name, see DescribeHybridMonitorNamespaceList.

    period int

    The statistical period of the metric. Unit: seconds. By default, this is the original reporting period of the metric.

    NOTE: For information about how to query the statistical period of a metric, see Cloud Service Metrics.

    statistics str
    threshold str
    comparisonOperator String
    metricName String

    The name of the metric. For information about how to query metric names, see Cloud Service Metrics.

    NOTE: When you create a Prometheus alert rule for Enterprise Cloud Monitoring, this parameter specifies the metric store name. For information about how to obtain the metric store name, see DescribeHybridMonitorNamespaceList.

    period Number

    The statistical period of the metric. Unit: seconds. By default, this is the original reporting period of the metric.

    NOTE: For information about how to query the statistical period of a metric, see Cloud Service Metrics.

    statistics String
    threshold String

    ServiceMetricAlarmRuleEscalations, ServiceMetricAlarmRuleEscalationsArgs

    Critical Pulumi.AliCloud.CloudMonitor.Inputs.ServiceMetricAlarmRuleEscalationsCritical
    The trigger condition for Critical-level alerts. See critical below.
    Info Pulumi.AliCloud.CloudMonitor.Inputs.ServiceMetricAlarmRuleEscalationsInfo
    Trigger conditions for Info-level alerts. See info below.
    Warn Pulumi.AliCloud.CloudMonitor.Inputs.ServiceMetricAlarmRuleEscalationsWarn
    Trigger condition for Warn-level alerts. See warn below.
    Critical ServiceMetricAlarmRuleEscalationsCritical
    The trigger condition for Critical-level alerts. See critical below.
    Info ServiceMetricAlarmRuleEscalationsInfo
    Trigger conditions for Info-level alerts. See info below.
    Warn ServiceMetricAlarmRuleEscalationsWarn
    Trigger condition for Warn-level alerts. See warn below.
    critical object
    The trigger condition for Critical-level alerts. See critical below.
    info object
    Trigger conditions for Info-level alerts. See info below.
    warn object
    Trigger condition for Warn-level alerts. See warn below.
    critical ServiceMetricAlarmRuleEscalationsCritical
    The trigger condition for Critical-level alerts. See critical below.
    info ServiceMetricAlarmRuleEscalationsInfo
    Trigger conditions for Info-level alerts. See info below.
    warn ServiceMetricAlarmRuleEscalationsWarn
    Trigger condition for Warn-level alerts. See warn below.
    critical ServiceMetricAlarmRuleEscalationsCritical
    The trigger condition for Critical-level alerts. See critical below.
    info ServiceMetricAlarmRuleEscalationsInfo
    Trigger conditions for Info-level alerts. See info below.
    warn ServiceMetricAlarmRuleEscalationsWarn
    Trigger condition for Warn-level alerts. See warn below.
    critical ServiceMetricAlarmRuleEscalationsCritical
    The trigger condition for Critical-level alerts. See critical below.
    info ServiceMetricAlarmRuleEscalationsInfo
    Trigger conditions for Info-level alerts. See info below.
    warn ServiceMetricAlarmRuleEscalationsWarn
    Trigger condition for Warn-level alerts. See warn below.
    critical Property Map
    The trigger condition for Critical-level alerts. See critical below.
    info Property Map
    Trigger conditions for Info-level alerts. See info below.
    warn Property Map
    Trigger condition for Warn-level alerts. See warn below.

    ServiceMetricAlarmRuleEscalationsCritical, ServiceMetricAlarmRuleEscalationsCriticalArgs

    ComparisonOperator string
    PreCondition string
    Precondition for triggering a Warn-level alert.
    Statistics string
    Threshold string
    Times int
    ComparisonOperator string
    PreCondition string
    Precondition for triggering a Warn-level alert.
    Statistics string
    Threshold string
    Times int
    comparison_operator string
    pre_condition string
    Precondition for triggering a Warn-level alert.
    statistics string
    threshold string
    times number
    comparisonOperator String
    preCondition String
    Precondition for triggering a Warn-level alert.
    statistics String
    threshold String
    times Integer
    comparisonOperator string
    preCondition string
    Precondition for triggering a Warn-level alert.
    statistics string
    threshold string
    times number
    comparison_operator str
    pre_condition str
    Precondition for triggering a Warn-level alert.
    statistics str
    threshold str
    times int
    comparisonOperator String
    preCondition String
    Precondition for triggering a Warn-level alert.
    statistics String
    threshold String
    times Number

    ServiceMetricAlarmRuleEscalationsInfo, ServiceMetricAlarmRuleEscalationsInfoArgs

    ComparisonOperator string
    PreCondition string
    Precondition for triggering a Warn-level alert.
    Statistics string
    Threshold string
    Times int
    ComparisonOperator string
    PreCondition string
    Precondition for triggering a Warn-level alert.
    Statistics string
    Threshold string
    Times int
    comparison_operator string
    pre_condition string
    Precondition for triggering a Warn-level alert.
    statistics string
    threshold string
    times number
    comparisonOperator String
    preCondition String
    Precondition for triggering a Warn-level alert.
    statistics String
    threshold String
    times Integer
    comparisonOperator string
    preCondition string
    Precondition for triggering a Warn-level alert.
    statistics string
    threshold string
    times number
    comparison_operator str
    pre_condition str
    Precondition for triggering a Warn-level alert.
    statistics str
    threshold str
    times int
    comparisonOperator String
    preCondition String
    Precondition for triggering a Warn-level alert.
    statistics String
    threshold String
    times Number

    ServiceMetricAlarmRuleEscalationsWarn, ServiceMetricAlarmRuleEscalationsWarnArgs

    ComparisonOperator string
    PreCondition string
    Precondition for triggering a Warn-level alert.
    Statistics string
    Threshold string
    Times int
    ComparisonOperator string
    PreCondition string
    Precondition for triggering a Warn-level alert.
    Statistics string
    Threshold string
    Times int
    comparison_operator string
    pre_condition string
    Precondition for triggering a Warn-level alert.
    statistics string
    threshold string
    times number
    comparisonOperator String
    preCondition String
    Precondition for triggering a Warn-level alert.
    statistics String
    threshold String
    times Integer
    comparisonOperator string
    preCondition string
    Precondition for triggering a Warn-level alert.
    statistics string
    threshold string
    times number
    comparison_operator str
    pre_condition str
    Precondition for triggering a Warn-level alert.
    statistics str
    threshold str
    times int
    comparisonOperator String
    preCondition String
    Precondition for triggering a Warn-level alert.
    statistics String
    threshold String
    times Number

    ServiceMetricAlarmRuleLabel, ServiceMetricAlarmRuleLabelArgs

    Key string
    The tag key.
    Value string

    Label value.

    NOTE: The label value supports template parameters, which are replaced with actual label values.

    Key string
    The tag key.
    Value string

    Label value.

    NOTE: The label value supports template parameters, which are replaced with actual label values.

    key string
    The tag key.
    value string

    Label value.

    NOTE: The label value supports template parameters, which are replaced with actual label values.

    key String
    The tag key.
    value String

    Label value.

    NOTE: The label value supports template parameters, which are replaced with actual label values.

    key string
    The tag key.
    value string

    Label value.

    NOTE: The label value supports template parameters, which are replaced with actual label values.

    key str
    The tag key.
    value str

    Label value.

    NOTE: The label value supports template parameters, which are replaced with actual label values.

    key String
    The tag key.
    value String

    Label value.

    NOTE: The label value supports template parameters, which are replaced with actual label values.

    ServiceMetricAlarmRulePrometheus, ServiceMetricAlarmRulePrometheusArgs

    Annotations List<Pulumi.AliCloud.CloudMonitor.Inputs.ServiceMetricAlarmRulePrometheusAnnotation>

    When a Prometheus alert is triggered, the key-value pairs of annotations are rendered to help you better understand the metric or alert rule.

    NOTE: This feature is equivalent to Annotations in Prometheus. See annotations below.

    Level string
    Alert severity level. Valid values:

    • CRITICAL: Critical
    • WARN: Warning
    • INFO: Information
    PromQl string

    The PromQL query statement.

    NOTE: The data retrieved by the PromQL query statement is used as alert data. Include the alert threshold in this statement.

    Times int
    The number of times the alert condition must be met before an alert notification is sent.
    Annotations []ServiceMetricAlarmRulePrometheusAnnotation

    When a Prometheus alert is triggered, the key-value pairs of annotations are rendered to help you better understand the metric or alert rule.

    NOTE: This feature is equivalent to Annotations in Prometheus. See annotations below.

    Level string
    Alert severity level. Valid values:

    • CRITICAL: Critical
    • WARN: Warning
    • INFO: Information
    PromQl string

    The PromQL query statement.

    NOTE: The data retrieved by the PromQL query statement is used as alert data. Include the alert threshold in this statement.

    Times int
    The number of times the alert condition must be met before an alert notification is sent.
    annotations list(object)

    When a Prometheus alert is triggered, the key-value pairs of annotations are rendered to help you better understand the metric or alert rule.

    NOTE: This feature is equivalent to Annotations in Prometheus. See annotations below.

    level string
    Alert severity level. Valid values:

    • CRITICAL: Critical
    • WARN: Warning
    • INFO: Information
    prom_ql string

    The PromQL query statement.

    NOTE: The data retrieved by the PromQL query statement is used as alert data. Include the alert threshold in this statement.

    times number
    The number of times the alert condition must be met before an alert notification is sent.
    annotations List<ServiceMetricAlarmRulePrometheusAnnotation>

    When a Prometheus alert is triggered, the key-value pairs of annotations are rendered to help you better understand the metric or alert rule.

    NOTE: This feature is equivalent to Annotations in Prometheus. See annotations below.

    level String
    Alert severity level. Valid values:

    • CRITICAL: Critical
    • WARN: Warning
    • INFO: Information
    promQl String

    The PromQL query statement.

    NOTE: The data retrieved by the PromQL query statement is used as alert data. Include the alert threshold in this statement.

    times Integer
    The number of times the alert condition must be met before an alert notification is sent.
    annotations ServiceMetricAlarmRulePrometheusAnnotation[]

    When a Prometheus alert is triggered, the key-value pairs of annotations are rendered to help you better understand the metric or alert rule.

    NOTE: This feature is equivalent to Annotations in Prometheus. See annotations below.

    level string
    Alert severity level. Valid values:

    • CRITICAL: Critical
    • WARN: Warning
    • INFO: Information
    promQl string

    The PromQL query statement.

    NOTE: The data retrieved by the PromQL query statement is used as alert data. Include the alert threshold in this statement.

    times number
    The number of times the alert condition must be met before an alert notification is sent.
    annotations Sequence[ServiceMetricAlarmRulePrometheusAnnotation]

    When a Prometheus alert is triggered, the key-value pairs of annotations are rendered to help you better understand the metric or alert rule.

    NOTE: This feature is equivalent to Annotations in Prometheus. See annotations below.

    level str
    Alert severity level. Valid values:

    • CRITICAL: Critical
    • WARN: Warning
    • INFO: Information
    prom_ql str

    The PromQL query statement.

    NOTE: The data retrieved by the PromQL query statement is used as alert data. Include the alert threshold in this statement.

    times int
    The number of times the alert condition must be met before an alert notification is sent.
    annotations List<Property Map>

    When a Prometheus alert is triggered, the key-value pairs of annotations are rendered to help you better understand the metric or alert rule.

    NOTE: This feature is equivalent to Annotations in Prometheus. See annotations below.

    level String
    Alert severity level. Valid values:

    • CRITICAL: Critical
    • WARN: Warning
    • INFO: Information
    promQl String

    The PromQL query statement.

    NOTE: The data retrieved by the PromQL query statement is used as alert data. Include the alert threshold in this statement.

    times Number
    The number of times the alert condition must be met before an alert notification is sent.

    ServiceMetricAlarmRulePrometheusAnnotation, ServiceMetricAlarmRulePrometheusAnnotationArgs

    Key string
    Value string
    Key string
    Value string
    key string
    value string
    key String
    value String
    key string
    value string
    key str
    value str
    key String
    value String

    Import

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

    $ pulumi import alicloud:cloudmonitor/serviceMetricAlarmRule:ServiceMetricAlarmRule example <metric_alarm_rule_id>
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo alicloud logo
    Viewing docs for Alibaba Cloud v3.105.0
    published on Thursday, Jul 16, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial