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

    This data source provides Cloud Monitor Service Metric Alarm Rule available to the user.What is Metric Alarm Rule

    NOTE: Available since v1.256.0.

    Example 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 = alicloud.ecs.getInstances({
        status: "Running",
    });
    const defaultAlarmContactGroup = new alicloud.cms.AlarmContactGroup("default", {alarmContactGroupName: name});
    const defaultAlarm = new alicloud.cms.Alarm("default", {
        name: name,
        project: "acs_ecs_dashboard",
        metric: "disk_writebytes",
        period: 900,
        silenceTime: 300,
        webhook: "https://www.aliyun.com",
        enabled: true,
        contactGroups: [defaultAlarmContactGroup.alarmContactGroupName],
        effectiveInterval: "06:00-20:00",
        metricDimensions: _default.then(_default => `  [
        {
          \"instanceId\": \"${_default.ids?.[0]}\",
          \"device\": \"/dev/vda1\"
        }
      ]
    `),
        escalationsCritical: {
            statistics: "Average",
            comparisonOperator: "<=",
            threshold: "90",
            times: 1,
        },
        escalationsInfo: {
            statistics: "Minimum",
            comparisonOperator: "!=",
            threshold: "20",
            times: 3,
        },
        escalationsWarn: {
            statistics: "Average",
            comparisonOperator: "==",
            threshold: "30",
            times: 5,
        },
    });
    const ids = alicloud.cloudmonitor.getServiceMetricAlarmRulesOutput({
        ids: [defaultAlarm.id],
    });
    export const cloudMonitorServiceMetricAlarmRulesId0 = ids.apply(ids => ids.rules?.[0]?.id);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "terraform-example"
    default = alicloud.ecs.get_instances(status="Running")
    default_alarm_contact_group = alicloud.cms.AlarmContactGroup("default", alarm_contact_group_name=name)
    default_alarm = alicloud.cms.Alarm("default",
        name=name,
        project="acs_ecs_dashboard",
        metric="disk_writebytes",
        period=900,
        silence_time=300,
        webhook="https://www.aliyun.com",
        enabled=True,
        contact_groups=[default_alarm_contact_group.alarm_contact_group_name],
        effective_interval="06:00-20:00",
        metric_dimensions=f"""  [
        {{
          \"instanceId\": \"{default.ids[0]}\",
          \"device\": \"/dev/vda1\"
        }}
      ]
    """,
        escalations_critical={
            "statistics": "Average",
            "comparison_operator": "<=",
            "threshold": "90",
            "times": 1,
        },
        escalations_info={
            "statistics": "Minimum",
            "comparison_operator": "!=",
            "threshold": "20",
            "times": 3,
        },
        escalations_warn={
            "statistics": "Average",
            "comparison_operator": "==",
            "threshold": "30",
            "times": 5,
        })
    ids = alicloud.cloudmonitor.get_service_metric_alarm_rules_output(ids=[default_alarm.id])
    pulumi.export("cloudMonitorServiceMetricAlarmRulesId0", ids.rules[0].id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/cloudmonitor"
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/cms"
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ecs"
    	"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
    		}
    		_default, err := ecs.GetInstances(ctx, &ecs.GetInstancesArgs{
    			Status: pulumi.StringRef("Running"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		defaultAlarmContactGroup, err := cms.NewAlarmContactGroup(ctx, "default", &cms.AlarmContactGroupArgs{
    			AlarmContactGroupName: pulumi.String(name),
    		})
    		if err != nil {
    			return err
    		}
    		defaultAlarm, err := cms.NewAlarm(ctx, "default", &cms.AlarmArgs{
    			Name:        pulumi.String(name),
    			Project:     pulumi.String("acs_ecs_dashboard"),
    			Metric:      pulumi.String("disk_writebytes"),
    			Period:      pulumi.Int(900),
    			SilenceTime: pulumi.Int(300),
    			Webhook:     pulumi.String("https://www.aliyun.com"),
    			Enabled:     pulumi.Bool(true),
    			ContactGroups: pulumi.StringArray{
    				defaultAlarmContactGroup.AlarmContactGroupName,
    			},
    			EffectiveInterval: pulumi.String("06:00-20:00"),
    			MetricDimensions: pulumi.Sprintf(`  [
        {
          \"instanceId\": \"%v\",
          \"device\": \"/dev/vda1\"
        }
      ]
    `, _default.Ids[0]),
    			EscalationsCritical: &cms.AlarmEscalationsCriticalArgs{
    				Statistics:         pulumi.String("Average"),
    				ComparisonOperator: pulumi.String("<="),
    				Threshold:          pulumi.String("90"),
    				Times:              pulumi.Int(1),
    			},
    			EscalationsInfo: &cms.AlarmEscalationsInfoArgs{
    				Statistics:         pulumi.String("Minimum"),
    				ComparisonOperator: pulumi.String("!="),
    				Threshold:          pulumi.String("20"),
    				Times:              pulumi.Int(3),
    			},
    			EscalationsWarn: &cms.AlarmEscalationsWarnArgs{
    				Statistics:         pulumi.String("Average"),
    				ComparisonOperator: pulumi.String("=="),
    				Threshold:          pulumi.String("30"),
    				Times:              pulumi.Int(5),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		ids := cloudmonitor.GetServiceMetricAlarmRulesOutput(ctx, cloudmonitor.GetServiceMetricAlarmRulesOutputArgs{
    			Ids: pulumi.StringArray{
    				defaultAlarm.ID(),
    			},
    		}, nil)
    		ctx.Export("cloudMonitorServiceMetricAlarmRulesId0", ids.ApplyT(func(ids cloudmonitor.GetServiceMetricAlarmRulesResult) (*string, error) {
    			return ids.Rules[0].Id, nil
    		}).(pulumi.StringPtrOutput))
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var config = new Config();
        var name = config.Get("name") ?? "terraform-example";
        var @default = AliCloud.Ecs.GetInstances.Invoke(new()
        {
            Status = "Running",
        });
    
        var defaultAlarmContactGroup = new AliCloud.Cms.AlarmContactGroup("default", new()
        {
            AlarmContactGroupName = name,
        });
    
        var defaultAlarm = new AliCloud.Cms.Alarm("default", new()
        {
            Name = name,
            Project = "acs_ecs_dashboard",
            Metric = "disk_writebytes",
            Period = 900,
            SilenceTime = 300,
            Webhook = "https://www.aliyun.com",
            Enabled = true,
            ContactGroups = new[]
            {
                defaultAlarmContactGroup.AlarmContactGroupName,
            },
            EffectiveInterval = "06:00-20:00",
            MetricDimensions = @default.Apply(@default => @$"  [
        {{
          \""instanceId\"": \""{@default.Apply(getInstancesResult => getInstancesResult.Ids[0])}\"",
          \""device\"": \""/dev/vda1\""
        }}
      ]
    "),
            EscalationsCritical = new AliCloud.Cms.Inputs.AlarmEscalationsCriticalArgs
            {
                Statistics = "Average",
                ComparisonOperator = "<=",
                Threshold = "90",
                Times = 1,
            },
            EscalationsInfo = new AliCloud.Cms.Inputs.AlarmEscalationsInfoArgs
            {
                Statistics = "Minimum",
                ComparisonOperator = "!=",
                Threshold = "20",
                Times = 3,
            },
            EscalationsWarn = new AliCloud.Cms.Inputs.AlarmEscalationsWarnArgs
            {
                Statistics = "Average",
                ComparisonOperator = "==",
                Threshold = "30",
                Times = 5,
            },
        });
    
        var ids = AliCloud.CloudMonitor.GetServiceMetricAlarmRules.Invoke(new()
        {
            Ids = new[]
            {
                defaultAlarm.Id,
            },
        });
    
        return new Dictionary<string, object?>
        {
            ["cloudMonitorServiceMetricAlarmRulesId0"] = ids.Apply(getServiceMetricAlarmRulesResult => getServiceMetricAlarmRulesResult.Rules[0]?.Id),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.ecs.EcsFunctions;
    import com.pulumi.alicloud.ecs.inputs.GetInstancesArgs;
    import com.pulumi.alicloud.cms.AlarmContactGroup;
    import com.pulumi.alicloud.cms.AlarmContactGroupArgs;
    import com.pulumi.alicloud.cms.Alarm;
    import com.pulumi.alicloud.cms.AlarmArgs;
    import com.pulumi.alicloud.cms.inputs.AlarmEscalationsCriticalArgs;
    import com.pulumi.alicloud.cms.inputs.AlarmEscalationsInfoArgs;
    import com.pulumi.alicloud.cms.inputs.AlarmEscalationsWarnArgs;
    import com.pulumi.alicloud.cloudmonitor.CloudmonitorFunctions;
    import com.pulumi.alicloud.cloudmonitor.inputs.GetServiceMetricAlarmRulesArgs;
    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");
            final var default = EcsFunctions.getInstances(GetInstancesArgs.builder()
                .status("Running")
                .build());
    
            var defaultAlarmContactGroup = new AlarmContactGroup("defaultAlarmContactGroup", AlarmContactGroupArgs.builder()
                .alarmContactGroupName(name)
                .build());
    
            var defaultAlarm = new Alarm("defaultAlarm", AlarmArgs.builder()
                .name(name)
                .project("acs_ecs_dashboard")
                .metric("disk_writebytes")
                .period(900)
                .silenceTime(300)
                .webhook("https://www.aliyun.com")
                .enabled(true)
                .contactGroups(defaultAlarmContactGroup.alarmContactGroupName())
                .effectiveInterval("06:00-20:00")
                .metricDimensions("""
      [
        {
          \"instanceId\": \"%s\",
          \"device\": \"/dev/vda1\"
        }
      ]
    ", default_.ids()[0]))
                .escalationsCritical(AlarmEscalationsCriticalArgs.builder()
                    .statistics("Average")
                    .comparisonOperator("<=")
                    .threshold("90")
                    .times(1)
                    .build())
                .escalationsInfo(AlarmEscalationsInfoArgs.builder()
                    .statistics("Minimum")
                    .comparisonOperator("!=")
                    .threshold("20")
                    .times(3)
                    .build())
                .escalationsWarn(AlarmEscalationsWarnArgs.builder()
                    .statistics("Average")
                    .comparisonOperator("==")
                    .threshold("30")
                    .times(5)
                    .build())
                .build());
    
            final var ids = CloudmonitorFunctions.getServiceMetricAlarmRules(GetServiceMetricAlarmRulesArgs.builder()
                .ids(defaultAlarm.id())
                .build());
    
            ctx.export("cloudMonitorServiceMetricAlarmRulesId0", ids.applyValue(_ids -> _ids.rules()[0].id()));
        }
    }
    
    configuration:
      name:
        type: string
        default: terraform-example
    resources:
      defaultAlarmContactGroup:
        type: alicloud:cms:AlarmContactGroup
        name: default
        properties:
          alarmContactGroupName: ${name}
      defaultAlarm:
        type: alicloud:cms:Alarm
        name: default
        properties:
          name: ${name}
          project: acs_ecs_dashboard
          metric: disk_writebytes
          period: 900
          silenceTime: 300
          webhook: https://www.aliyun.com
          enabled: true
          contactGroups:
            - ${defaultAlarmContactGroup.alarmContactGroupName}
          effectiveInterval: 06:00-20:00
          metricDimensions: |2
              [
                {
                  \"instanceId\": \"${default.ids[0]}\",
                  \"device\": \"/dev/vda1\"
                }
              ]
          escalationsCritical:
            statistics: Average
            comparisonOperator: <=
            threshold: 90
            times: 1
          escalationsInfo:
            statistics: Minimum
            comparisonOperator: '!='
            threshold: 20
            times: 3
          escalationsWarn:
            statistics: Average
            comparisonOperator: ==
            threshold: 30
            times: 5
    variables:
      default:
        fn::invoke:
          function: alicloud:ecs:getInstances
          arguments:
            status: Running
      ids:
        fn::invoke:
          function: alicloud:cloudmonitor:getServiceMetricAlarmRules
          arguments:
            ids:
              - ${defaultAlarm.id}
    outputs:
      cloudMonitorServiceMetricAlarmRulesId0: ${ids.rules[0].id}
    
    pulumi {
      required_providers {
        alicloud = {
          source = "pulumi/alicloud"
        }
      }
    }
    
    data "alicloud_ecs_getinstances" "default" {
      status = "Running"
    }
    data "alicloud_cloudmonitor_getservicemetricalarmrules" "ids" {
      ids = [alicloud_cms_alarm.default.id]
    }
    
    resource "alicloud_cms_alarmcontactgroup" "default" {
      alarm_contact_group_name = var.name
    }
    resource "alicloud_cms_alarm" "default" {
      name               = var.name
      project            = "acs_ecs_dashboard"
      metric             = "disk_writebytes"
      period             = 900
      silence_time       = 300
      webhook            = "https://www.aliyun.com"
      enabled            = true
      contact_groups     = [alicloud_cms_alarmcontactgroup.default.alarm_contact_group_name]
      effective_interval = "06:00-20:00"
      metric_dimensions  ="  [
        {
          \"instanceId\": \"${data.alicloud_ecs_getinstances.default.ids[0]}\",
          \"device\": \"/dev/vda1\"
        }
      ]
    "
      escalations_critical = {
        statistics          = "Average"
        comparison_operator = "<="
        threshold           = 90
        times               = 1
      }
      escalations_info = {
        statistics          = "Minimum"
        comparison_operator = "!="
        threshold           = 20
        times               = 3
      }
      escalations_warn = {
        statistics          = "Average"
        comparison_operator = "=="
        threshold           = 30
        times               = 5
      }
    }
    variable "name" {
      type    = string
      default = "terraform-example"
    }
    output "cloudMonitorServiceMetricAlarmRulesId0" {
      value = data.alicloud_cloudmonitor_getservicemetricalarmrules.ids.rules[0].id
    }
    

    Using getServiceMetricAlarmRules

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getServiceMetricAlarmRules(args: GetServiceMetricAlarmRulesArgs, opts?: InvokeOptions): Promise<GetServiceMetricAlarmRulesResult>
    function getServiceMetricAlarmRulesOutput(args: GetServiceMetricAlarmRulesOutputArgs, opts?: InvokeOptions): Output<GetServiceMetricAlarmRulesResult>
    def get_service_metric_alarm_rules(dimensions: Optional[str] = None,
                                       enable_details: Optional[bool] = None,
                                       ids: Optional[Sequence[str]] = None,
                                       metric_alarm_rule_id: Optional[str] = None,
                                       metric_name: Optional[str] = None,
                                       namespace: Optional[str] = None,
                                       output_file: Optional[str] = None,
                                       rule_name: Optional[str] = None,
                                       status: Optional[bool] = None,
                                       opts: Optional[InvokeOptions] = None) -> GetServiceMetricAlarmRulesResult
    def get_service_metric_alarm_rules_output(dimensions: pulumi.Input[Optional[str]] = None,
                                       enable_details: pulumi.Input[Optional[bool]] = None,
                                       ids: pulumi.Input[Optional[Sequence[pulumi.Input[str]]]] = None,
                                       metric_alarm_rule_id: pulumi.Input[Optional[str]] = None,
                                       metric_name: pulumi.Input[Optional[str]] = None,
                                       namespace: pulumi.Input[Optional[str]] = None,
                                       output_file: pulumi.Input[Optional[str]] = None,
                                       rule_name: pulumi.Input[Optional[str]] = None,
                                       status: pulumi.Input[Optional[bool]] = None,
                                       opts: Optional[InvokeOptions] = None) -> Output[GetServiceMetricAlarmRulesResult]
    func GetServiceMetricAlarmRules(ctx *Context, args *GetServiceMetricAlarmRulesArgs, opts ...InvokeOption) (*GetServiceMetricAlarmRulesResult, error)
    func GetServiceMetricAlarmRulesOutput(ctx *Context, args *GetServiceMetricAlarmRulesOutputArgs, opts ...InvokeOption) GetServiceMetricAlarmRulesResultOutput

    > Note: This function is named GetServiceMetricAlarmRules in the Go SDK.

    public static class GetServiceMetricAlarmRules 
    {
        public static Task<GetServiceMetricAlarmRulesResult> InvokeAsync(GetServiceMetricAlarmRulesArgs args, InvokeOptions? opts = null)
        public static Output<GetServiceMetricAlarmRulesResult> Invoke(GetServiceMetricAlarmRulesInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetServiceMetricAlarmRulesResult> getServiceMetricAlarmRules(GetServiceMetricAlarmRulesArgs args, InvokeOptions options)
    public static Output<GetServiceMetricAlarmRulesResult> getServiceMetricAlarmRules(GetServiceMetricAlarmRulesArgs args, InvokeOptions options)
    
    fn::invoke:
      function: alicloud:cloudmonitor/getServiceMetricAlarmRules:getServiceMetricAlarmRules
      arguments:
        # arguments dictionary
    data "alicloud_cloudmonitor_getservicemetricalarmrules" "name" {
        # arguments
    }

    The following arguments are supported:

    Dimensions string
    The monitoring dimensions for the specified resource. Format: a set of key:value pairs, for example: {"userId":"120886317861****"} and {"instanceId":"i-2ze2d6j5uhg20x47****"}.
    EnableDetails bool
    Default to false. Set it to true can output more details about resource attributes.
    Ids List<string>
    A list of Metric Alarm Rule IDs.
    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.

    OutputFile string
    File name where to save data source results (after running pulumi preview).
    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.

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

    • true: enabled.
    • false: disabled.
    Dimensions string
    The monitoring dimensions for the specified resource. Format: a set of key:value pairs, for example: {"userId":"120886317861****"} and {"instanceId":"i-2ze2d6j5uhg20x47****"}.
    EnableDetails bool
    Default to false. Set it to true can output more details about resource attributes.
    Ids []string
    A list of Metric Alarm Rule IDs.
    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.

    OutputFile string
    File name where to save data source results (after running pulumi preview).
    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.

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

    • true: enabled.
    • false: disabled.
    dimensions string
    The monitoring dimensions for the specified resource. Format: a set of key:value pairs, for example: {"userId":"120886317861****"} and {"instanceId":"i-2ze2d6j5uhg20x47****"}.
    enable_details bool
    Default to false. Set it to true can output more details about resource attributes.
    ids list(string)
    A list of Metric Alarm Rule IDs.
    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.

    output_file string
    File name where to save data source results (after running pulumi preview).
    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.

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

    • true: enabled.
    • false: disabled.
    dimensions String
    The monitoring dimensions for the specified resource. Format: a set of key:value pairs, for example: {"userId":"120886317861****"} and {"instanceId":"i-2ze2d6j5uhg20x47****"}.
    enableDetails Boolean
    Default to false. Set it to true can output more details about resource attributes.
    ids List<String>
    A list of Metric Alarm Rule IDs.
    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.

    outputFile String
    File name where to save data source results (after running pulumi preview).
    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.

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

    • true: enabled.
    • false: disabled.
    dimensions string
    The monitoring dimensions for the specified resource. Format: a set of key:value pairs, for example: {"userId":"120886317861****"} and {"instanceId":"i-2ze2d6j5uhg20x47****"}.
    enableDetails boolean
    Default to false. Set it to true can output more details about resource attributes.
    ids string[]
    A list of Metric Alarm Rule IDs.
    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.

    outputFile string
    File name where to save data source results (after running pulumi preview).
    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.

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

    • true: enabled.
    • false: disabled.
    dimensions str
    The monitoring dimensions for the specified resource. Format: a set of key:value pairs, for example: {"userId":"120886317861****"} and {"instanceId":"i-2ze2d6j5uhg20x47****"}.
    enable_details bool
    Default to false. Set it to true can output more details about resource attributes.
    ids Sequence[str]
    A list of Metric Alarm Rule IDs.
    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.

    output_file str
    File name where to save data source results (after running pulumi preview).
    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.

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

    • true: enabled.
    • false: disabled.
    dimensions String
    The monitoring dimensions for the specified resource. Format: a set of key:value pairs, for example: {"userId":"120886317861****"} and {"instanceId":"i-2ze2d6j5uhg20x47****"}.
    enableDetails Boolean
    Default to false. Set it to true can output more details about resource attributes.
    ids List<String>
    A list of Metric Alarm Rule IDs.
    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.

    outputFile String
    File name where to save data source results (after running pulumi preview).
    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.

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

    • true: enabled.
    • false: disabled.

    getServiceMetricAlarmRules Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    A list of Metric Alarm Rule IDs.
    Rules List<Pulumi.AliCloud.CloudMonitor.Outputs.GetServiceMetricAlarmRulesRule>
    A list of Metric Alarm Rule Entries. Each element contains the following attributes:
    Dimensions string
    The monitoring dimensions for the specified resource.
    EnableDetails bool
    MetricAlarmRuleId string
    The ID of the alarm rule.
    MetricName string
    The name of the metric.
    Namespace string
    The namespace of the cloud service metric data.
    OutputFile string
    RuleName string
    Alert rule name.
    Status bool
    The enabled status of the alarm rule.
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    A list of Metric Alarm Rule IDs.
    Rules []GetServiceMetricAlarmRulesRule
    A list of Metric Alarm Rule Entries. Each element contains the following attributes:
    Dimensions string
    The monitoring dimensions for the specified resource.
    EnableDetails bool
    MetricAlarmRuleId string
    The ID of the alarm rule.
    MetricName string
    The name of the metric.
    Namespace string
    The namespace of the cloud service metric data.
    OutputFile string
    RuleName string
    Alert rule name.
    Status bool
    The enabled status of the alarm rule.
    id string
    The provider-assigned unique ID for this managed resource.
    ids list(string)
    A list of Metric Alarm Rule IDs.
    rules list(object)
    A list of Metric Alarm Rule Entries. Each element contains the following attributes:
    dimensions string
    The monitoring dimensions for the specified resource.
    enable_details bool
    metric_alarm_rule_id string
    The ID of the alarm rule.
    metric_name string
    The name of the metric.
    namespace string
    The namespace of the cloud service metric data.
    output_file string
    rule_name string
    Alert rule name.
    status bool
    The enabled status of the alarm rule.
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    A list of Metric Alarm Rule IDs.
    rules List<GetServiceMetricAlarmRulesRule>
    A list of Metric Alarm Rule Entries. Each element contains the following attributes:
    dimensions String
    The monitoring dimensions for the specified resource.
    enableDetails Boolean
    metricAlarmRuleId String
    The ID of the alarm rule.
    metricName String
    The name of the metric.
    namespace String
    The namespace of the cloud service metric data.
    outputFile String
    ruleName String
    Alert rule name.
    status Boolean
    The enabled status of the alarm rule.
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    A list of Metric Alarm Rule IDs.
    rules GetServiceMetricAlarmRulesRule[]
    A list of Metric Alarm Rule Entries. Each element contains the following attributes:
    dimensions string
    The monitoring dimensions for the specified resource.
    enableDetails boolean
    metricAlarmRuleId string
    The ID of the alarm rule.
    metricName string
    The name of the metric.
    namespace string
    The namespace of the cloud service metric data.
    outputFile string
    ruleName string
    Alert rule name.
    status boolean
    The enabled status of the alarm rule.
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    A list of Metric Alarm Rule IDs.
    rules Sequence[GetServiceMetricAlarmRulesRule]
    A list of Metric Alarm Rule Entries. Each element contains the following attributes:
    dimensions str
    The monitoring dimensions for the specified resource.
    enable_details bool
    metric_alarm_rule_id str
    The ID of the alarm rule.
    metric_name str
    The name of the metric.
    namespace str
    The namespace of the cloud service metric data.
    output_file str
    rule_name str
    Alert rule name.
    status bool
    The enabled status of the alarm rule.
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    A list of Metric Alarm Rule IDs.
    rules List<Property Map>
    A list of Metric Alarm Rule Entries. Each element contains the following attributes:
    dimensions String
    The monitoring dimensions for the specified resource.
    enableDetails Boolean
    metricAlarmRuleId String
    The ID of the alarm rule.
    metricName String
    The name of the metric.
    namespace String
    The namespace of the cloud service metric data.
    outputFile String
    ruleName String
    Alert rule name.
    status Boolean
    The enabled status of the alarm rule.

    Supporting Types

    GetServiceMetricAlarmRulesRule

    CompositeExpression Pulumi.AliCloud.CloudMonitor.Inputs.GetServiceMetricAlarmRulesRuleCompositeExpression
    Alert condition for multiple metrics.
    ContactGroups string
    Alarm contact groups.
    Dimensions string
    The monitoring dimensions for the specified resource. Format: a set of key:value pairs, for example: {"userId":"120886317861****"} and {"instanceId":"i-2ze2d6j5uhg20x47****"}.
    EffectiveInterval string
    The time range during which the alert rule is effective.
    EmailSubject string
    Subject of alert emails.
    Escalations Pulumi.AliCloud.CloudMonitor.Inputs.GetServiceMetricAlarmRulesRuleEscalations
    The trigger conditions for alert levels.
    Id string
    The ID of the resource supplied above.
    Labels List<Pulumi.AliCloud.CloudMonitor.Inputs.GetServiceMetricAlarmRulesRuleLabel>
    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.
    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.
    NoEffectiveInterval string
    The time range during which the alarm rule is inactive.
    Period string
    The statistical period of the metric.
    Prometheus Pulumi.AliCloud.CloudMonitor.Inputs.GetServiceMetricAlarmRulesRulePrometheus
    Prometheus alert.
    Resources string
    Resource information, for example: [{"instanceId":"i-uf6j91r34rnwawoo****"}], [{"userId":"100931896542****"}].
    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.
    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.
    CompositeExpression GetServiceMetricAlarmRulesRuleCompositeExpression
    Alert condition for multiple metrics.
    ContactGroups string
    Alarm contact groups.
    Dimensions string
    The monitoring dimensions for the specified resource. Format: a set of key:value pairs, for example: {"userId":"120886317861****"} and {"instanceId":"i-2ze2d6j5uhg20x47****"}.
    EffectiveInterval string
    The time range during which the alert rule is effective.
    EmailSubject string
    Subject of alert emails.
    Escalations GetServiceMetricAlarmRulesRuleEscalations
    The trigger conditions for alert levels.
    Id string
    The ID of the resource supplied above.
    Labels []GetServiceMetricAlarmRulesRuleLabel
    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.
    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.
    NoEffectiveInterval string
    The time range during which the alarm rule is inactive.
    Period string
    The statistical period of the metric.
    Prometheus GetServiceMetricAlarmRulesRulePrometheus
    Prometheus alert.
    Resources string
    Resource information, for example: [{"instanceId":"i-uf6j91r34rnwawoo****"}], [{"userId":"100931896542****"}].
    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.
    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.
    composite_expression object
    Alert condition for multiple metrics.
    contact_groups string
    Alarm contact groups.
    dimensions string
    The monitoring dimensions for the specified resource. Format: a set of key:value pairs, for example: {"userId":"120886317861****"} and {"instanceId":"i-2ze2d6j5uhg20x47****"}.
    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.
    id string
    The ID of the resource supplied above.
    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.
    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.
    no_effective_interval string
    The time range during which the alarm rule is inactive.
    period string
    The statistical period of the metric.
    prometheus object
    Prometheus alert.
    resources string
    Resource information, for example: [{"instanceId":"i-uf6j91r34rnwawoo****"}], [{"userId":"100931896542****"}].
    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.
    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.
    compositeExpression GetServiceMetricAlarmRulesRuleCompositeExpression
    Alert condition for multiple metrics.
    contactGroups String
    Alarm contact groups.
    dimensions String
    The monitoring dimensions for the specified resource. Format: a set of key:value pairs, for example: {"userId":"120886317861****"} and {"instanceId":"i-2ze2d6j5uhg20x47****"}.
    effectiveInterval String
    The time range during which the alert rule is effective.
    emailSubject String
    Subject of alert emails.
    escalations GetServiceMetricAlarmRulesRuleEscalations
    The trigger conditions for alert levels.
    id String
    The ID of the resource supplied above.
    labels List<GetServiceMetricAlarmRulesRuleLabel>
    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.
    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.
    noEffectiveInterval String
    The time range during which the alarm rule is inactive.
    period String
    The statistical period of the metric.
    prometheus GetServiceMetricAlarmRulesRulePrometheus
    Prometheus alert.
    resources String
    Resource information, for example: [{"instanceId":"i-uf6j91r34rnwawoo****"}], [{"userId":"100931896542****"}].
    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.
    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.
    compositeExpression GetServiceMetricAlarmRulesRuleCompositeExpression
    Alert condition for multiple metrics.
    contactGroups string
    Alarm contact groups.
    dimensions string
    The monitoring dimensions for the specified resource. Format: a set of key:value pairs, for example: {"userId":"120886317861****"} and {"instanceId":"i-2ze2d6j5uhg20x47****"}.
    effectiveInterval string
    The time range during which the alert rule is effective.
    emailSubject string
    Subject of alert emails.
    escalations GetServiceMetricAlarmRulesRuleEscalations
    The trigger conditions for alert levels.
    id string
    The ID of the resource supplied above.
    labels GetServiceMetricAlarmRulesRuleLabel[]
    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.
    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.
    noEffectiveInterval string
    The time range during which the alarm rule is inactive.
    period string
    The statistical period of the metric.
    prometheus GetServiceMetricAlarmRulesRulePrometheus
    Prometheus alert.
    resources string
    Resource information, for example: [{"instanceId":"i-uf6j91r34rnwawoo****"}], [{"userId":"100931896542****"}].
    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.
    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.
    composite_expression GetServiceMetricAlarmRulesRuleCompositeExpression
    Alert condition for multiple metrics.
    contact_groups str
    Alarm contact groups.
    dimensions str
    The monitoring dimensions for the specified resource. Format: a set of key:value pairs, for example: {"userId":"120886317861****"} and {"instanceId":"i-2ze2d6j5uhg20x47****"}.
    effective_interval str
    The time range during which the alert rule is effective.
    email_subject str
    Subject of alert emails.
    escalations GetServiceMetricAlarmRulesRuleEscalations
    The trigger conditions for alert levels.
    id str
    The ID of the resource supplied above.
    labels Sequence[GetServiceMetricAlarmRulesRuleLabel]
    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.
    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.
    no_effective_interval str
    The time range during which the alarm rule is inactive.
    period str
    The statistical period of the metric.
    prometheus GetServiceMetricAlarmRulesRulePrometheus
    Prometheus alert.
    resources str
    Resource information, for example: [{"instanceId":"i-uf6j91r34rnwawoo****"}], [{"userId":"100931896542****"}].
    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.
    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.
    compositeExpression Property Map
    Alert condition for multiple metrics.
    contactGroups String
    Alarm contact groups.
    dimensions String
    The monitoring dimensions for the specified resource. Format: a set of key:value pairs, for example: {"userId":"120886317861****"} and {"instanceId":"i-2ze2d6j5uhg20x47****"}.
    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.
    id String
    The ID of the resource supplied above.
    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.
    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.
    noEffectiveInterval String
    The time range during which the alarm rule is inactive.
    period String
    The statistical period of the metric.
    prometheus Property Map
    Prometheus alert.
    resources String
    Resource information, for example: [{"instanceId":"i-uf6j91r34rnwawoo****"}], [{"userId":"100931896542****"}].
    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.
    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.

    GetServiceMetricAlarmRulesRuleCompositeExpression

    ExpressionListJoin string
    The logical relationship between multiple metric-based alert conditions.
    ExpressionLists List<Pulumi.AliCloud.CloudMonitor.Inputs.GetServiceMetricAlarmRulesRuleCompositeExpressionExpressionList>
    A list of alert conditions created using standard expressions.
    ExpressionRaw string
    The alert condition created by an expression.
    Level string
    Alert severity level.
    Times int
    The number of times the alert condition must be met before an alert notification is sent.
    ExpressionListJoin string
    The logical relationship between multiple metric-based alert conditions.
    ExpressionLists []GetServiceMetricAlarmRulesRuleCompositeExpressionExpressionList
    A list of alert conditions created using standard expressions.
    ExpressionRaw string
    The alert condition created by an expression.
    Level string
    Alert severity level.
    Times int
    The number of 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.
    expression_lists list(object)
    A list of alert conditions created using standard expressions.
    expression_raw string
    The alert condition created by an expression.
    level string
    Alert severity level.
    times number
    The number of times the alert condition must be met before an alert notification is sent.
    expressionListJoin String
    The logical relationship between multiple metric-based alert conditions.
    expressionLists List<GetServiceMetricAlarmRulesRuleCompositeExpressionExpressionList>
    A list of alert conditions created using standard expressions.
    expressionRaw String
    The alert condition created by an expression.
    level String
    Alert severity level.
    times Integer
    The number of times the alert condition must be met before an alert notification is sent.
    expressionListJoin string
    The logical relationship between multiple metric-based alert conditions.
    expressionLists GetServiceMetricAlarmRulesRuleCompositeExpressionExpressionList[]
    A list of alert conditions created using standard expressions.
    expressionRaw string
    The alert condition created by an expression.
    level string
    Alert severity level.
    times number
    The number of 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.
    expression_lists Sequence[GetServiceMetricAlarmRulesRuleCompositeExpressionExpressionList]
    A list of alert conditions created using standard expressions.
    expression_raw str
    The alert condition created by an expression.
    level str
    Alert severity level.
    times int
    The number of times the alert condition must be met before an alert notification is sent.
    expressionListJoin String
    The logical relationship between multiple metric-based alert conditions.
    expressionLists List<Property Map>
    A list of alert conditions created using standard expressions.
    expressionRaw String
    The alert condition created by an expression.
    level String
    Alert severity level.
    times Number
    The number of times the alert condition must be met before an alert notification is sent.

    GetServiceMetricAlarmRulesRuleCompositeExpressionExpressionList

    ComparisonOperator string
    Comparison operator for the Warn-level threshold.
    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.
    Statistics string
    Statistical method for Warn-level alerts.
    Threshold string
    Threshold for Warn-level alerts.
    ComparisonOperator string
    Comparison operator for the Warn-level threshold.
    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.
    Statistics string
    Statistical method for Warn-level alerts.
    Threshold string
    Threshold for Warn-level alerts.
    comparison_operator string
    Comparison operator for the Warn-level threshold.
    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.
    statistics string
    Statistical method for Warn-level alerts.
    threshold string
    Threshold for Warn-level alerts.
    comparisonOperator String
    Comparison operator for the Warn-level threshold.
    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.
    statistics String
    Statistical method for Warn-level alerts.
    threshold String
    Threshold for Warn-level alerts.
    comparisonOperator string
    Comparison operator for the Warn-level threshold.
    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.
    statistics string
    Statistical method for Warn-level alerts.
    threshold string
    Threshold for Warn-level alerts.
    comparison_operator str
    Comparison operator for the Warn-level threshold.
    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.
    statistics str
    Statistical method for Warn-level alerts.
    threshold str
    Threshold for Warn-level alerts.
    comparisonOperator String
    Comparison operator for the Warn-level threshold.
    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.
    statistics String
    Statistical method for Warn-level alerts.
    threshold String
    Threshold for Warn-level alerts.

    GetServiceMetricAlarmRulesRuleEscalations

    Critical GetServiceMetricAlarmRulesRuleEscalationsCritical
    The trigger condition for Critical-level alerts.
    Info GetServiceMetricAlarmRulesRuleEscalationsInfo
    Trigger conditions for Info-level alerts.
    Warn GetServiceMetricAlarmRulesRuleEscalationsWarn
    Trigger condition for Warn-level alerts.
    critical object
    The trigger condition for Critical-level alerts.
    info object
    Trigger conditions for Info-level alerts.
    warn object
    Trigger condition for Warn-level alerts.
    critical GetServiceMetricAlarmRulesRuleEscalationsCritical
    The trigger condition for Critical-level alerts.
    info GetServiceMetricAlarmRulesRuleEscalationsInfo
    Trigger conditions for Info-level alerts.
    warn GetServiceMetricAlarmRulesRuleEscalationsWarn
    Trigger condition for Warn-level alerts.
    critical GetServiceMetricAlarmRulesRuleEscalationsCritical
    The trigger condition for Critical-level alerts.
    info GetServiceMetricAlarmRulesRuleEscalationsInfo
    Trigger conditions for Info-level alerts.
    warn GetServiceMetricAlarmRulesRuleEscalationsWarn
    Trigger condition for Warn-level alerts.
    critical GetServiceMetricAlarmRulesRuleEscalationsCritical
    The trigger condition for Critical-level alerts.
    info GetServiceMetricAlarmRulesRuleEscalationsInfo
    Trigger conditions for Info-level alerts.
    warn GetServiceMetricAlarmRulesRuleEscalationsWarn
    Trigger condition for Warn-level alerts.
    critical Property Map
    The trigger condition for Critical-level alerts.
    info Property Map
    Trigger conditions for Info-level alerts.
    warn Property Map
    Trigger condition for Warn-level alerts.

    GetServiceMetricAlarmRulesRuleEscalationsCritical

    ComparisonOperator string
    Comparison operator for the Warn-level threshold.
    PreCondition string
    Precondition for triggering a Warn-level alert.
    Statistics string
    Statistical method for Warn-level alerts.
    Threshold string
    Threshold for Warn-level alerts.
    Times int
    The number of times the alert condition must be met before an alert notification is sent.
    ComparisonOperator string
    Comparison operator for the Warn-level threshold.
    PreCondition string
    Precondition for triggering a Warn-level alert.
    Statistics string
    Statistical method for Warn-level alerts.
    Threshold string
    Threshold for Warn-level alerts.
    Times int
    The number of times the alert condition must be met before an alert notification is sent.
    comparison_operator string
    Comparison operator for the Warn-level threshold.
    pre_condition string
    Precondition for triggering a Warn-level alert.
    statistics string
    Statistical method for Warn-level alerts.
    threshold string
    Threshold for Warn-level alerts.
    times number
    The number of times the alert condition must be met before an alert notification is sent.
    comparisonOperator String
    Comparison operator for the Warn-level threshold.
    preCondition String
    Precondition for triggering a Warn-level alert.
    statistics String
    Statistical method for Warn-level alerts.
    threshold String
    Threshold for Warn-level alerts.
    times Integer
    The number of times the alert condition must be met before an alert notification is sent.
    comparisonOperator string
    Comparison operator for the Warn-level threshold.
    preCondition string
    Precondition for triggering a Warn-level alert.
    statistics string
    Statistical method for Warn-level alerts.
    threshold string
    Threshold for Warn-level alerts.
    times number
    The number of times the alert condition must be met before an alert notification is sent.
    comparison_operator str
    Comparison operator for the Warn-level threshold.
    pre_condition str
    Precondition for triggering a Warn-level alert.
    statistics str
    Statistical method for Warn-level alerts.
    threshold str
    Threshold for Warn-level alerts.
    times int
    The number of times the alert condition must be met before an alert notification is sent.
    comparisonOperator String
    Comparison operator for the Warn-level threshold.
    preCondition String
    Precondition for triggering a Warn-level alert.
    statistics String
    Statistical method for Warn-level alerts.
    threshold String
    Threshold for Warn-level alerts.
    times Number
    The number of times the alert condition must be met before an alert notification is sent.

    GetServiceMetricAlarmRulesRuleEscalationsInfo

    ComparisonOperator string
    Comparison operator for the Warn-level threshold.
    PreCondition string
    Precondition for triggering a Warn-level alert.
    Statistics string
    Statistical method for Warn-level alerts.
    Threshold string
    Threshold for Warn-level alerts.
    Times int
    The number of times the alert condition must be met before an alert notification is sent.
    ComparisonOperator string
    Comparison operator for the Warn-level threshold.
    PreCondition string
    Precondition for triggering a Warn-level alert.
    Statistics string
    Statistical method for Warn-level alerts.
    Threshold string
    Threshold for Warn-level alerts.
    Times int
    The number of times the alert condition must be met before an alert notification is sent.
    comparison_operator string
    Comparison operator for the Warn-level threshold.
    pre_condition string
    Precondition for triggering a Warn-level alert.
    statistics string
    Statistical method for Warn-level alerts.
    threshold string
    Threshold for Warn-level alerts.
    times number
    The number of times the alert condition must be met before an alert notification is sent.
    comparisonOperator String
    Comparison operator for the Warn-level threshold.
    preCondition String
    Precondition for triggering a Warn-level alert.
    statistics String
    Statistical method for Warn-level alerts.
    threshold String
    Threshold for Warn-level alerts.
    times Integer
    The number of times the alert condition must be met before an alert notification is sent.
    comparisonOperator string
    Comparison operator for the Warn-level threshold.
    preCondition string
    Precondition for triggering a Warn-level alert.
    statistics string
    Statistical method for Warn-level alerts.
    threshold string
    Threshold for Warn-level alerts.
    times number
    The number of times the alert condition must be met before an alert notification is sent.
    comparison_operator str
    Comparison operator for the Warn-level threshold.
    pre_condition str
    Precondition for triggering a Warn-level alert.
    statistics str
    Statistical method for Warn-level alerts.
    threshold str
    Threshold for Warn-level alerts.
    times int
    The number of times the alert condition must be met before an alert notification is sent.
    comparisonOperator String
    Comparison operator for the Warn-level threshold.
    preCondition String
    Precondition for triggering a Warn-level alert.
    statistics String
    Statistical method for Warn-level alerts.
    threshold String
    Threshold for Warn-level alerts.
    times Number
    The number of times the alert condition must be met before an alert notification is sent.

    GetServiceMetricAlarmRulesRuleEscalationsWarn

    ComparisonOperator string
    Comparison operator for the Warn-level threshold.
    PreCondition string
    Precondition for triggering a Warn-level alert.
    Statistics string
    Statistical method for Warn-level alerts.
    Threshold string
    Threshold for Warn-level alerts.
    Times int
    The number of times the alert condition must be met before an alert notification is sent.
    ComparisonOperator string
    Comparison operator for the Warn-level threshold.
    PreCondition string
    Precondition for triggering a Warn-level alert.
    Statistics string
    Statistical method for Warn-level alerts.
    Threshold string
    Threshold for Warn-level alerts.
    Times int
    The number of times the alert condition must be met before an alert notification is sent.
    comparison_operator string
    Comparison operator for the Warn-level threshold.
    pre_condition string
    Precondition for triggering a Warn-level alert.
    statistics string
    Statistical method for Warn-level alerts.
    threshold string
    Threshold for Warn-level alerts.
    times number
    The number of times the alert condition must be met before an alert notification is sent.
    comparisonOperator String
    Comparison operator for the Warn-level threshold.
    preCondition String
    Precondition for triggering a Warn-level alert.
    statistics String
    Statistical method for Warn-level alerts.
    threshold String
    Threshold for Warn-level alerts.
    times Integer
    The number of times the alert condition must be met before an alert notification is sent.
    comparisonOperator string
    Comparison operator for the Warn-level threshold.
    preCondition string
    Precondition for triggering a Warn-level alert.
    statistics string
    Statistical method for Warn-level alerts.
    threshold string
    Threshold for Warn-level alerts.
    times number
    The number of times the alert condition must be met before an alert notification is sent.
    comparison_operator str
    Comparison operator for the Warn-level threshold.
    pre_condition str
    Precondition for triggering a Warn-level alert.
    statistics str
    Statistical method for Warn-level alerts.
    threshold str
    Threshold for Warn-level alerts.
    times int
    The number of times the alert condition must be met before an alert notification is sent.
    comparisonOperator String
    Comparison operator for the Warn-level threshold.
    preCondition String
    Precondition for triggering a Warn-level alert.
    statistics String
    Statistical method for Warn-level alerts.
    threshold String
    Threshold for Warn-level alerts.
    times Number
    The number of times the alert condition must be met before an alert notification is sent.

    GetServiceMetricAlarmRulesRuleLabel

    Key string
    The key of the annotation.
    Value string
    The value of the annotation.
    Key string
    The key of the annotation.
    Value string
    The value of the annotation.
    key string
    The key of the annotation.
    value string
    The value of the annotation.
    key String
    The key of the annotation.
    value String
    The value of the annotation.
    key string
    The key of the annotation.
    value string
    The value of the annotation.
    key str
    The key of the annotation.
    value str
    The value of the annotation.
    key String
    The key of the annotation.
    value String
    The value of the annotation.

    GetServiceMetricAlarmRulesRulePrometheus

    Annotations List<Pulumi.AliCloud.CloudMonitor.Inputs.GetServiceMetricAlarmRulesRulePrometheusAnnotation>
    When a Prometheus alert is triggered, the key-value pairs of annotations are rendered to help you better understand the metric or alert rule.
    Level string
    Alert severity level.
    PromQl string
    The PromQL query statement.
    Times int
    The number of times the alert condition must be met before an alert notification is sent.
    Annotations []GetServiceMetricAlarmRulesRulePrometheusAnnotation
    When a Prometheus alert is triggered, the key-value pairs of annotations are rendered to help you better understand the metric or alert rule.
    Level string
    Alert severity level.
    PromQl string
    The PromQL query 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.
    level string
    Alert severity level.
    prom_ql string
    The PromQL query statement.
    times number
    The number of times the alert condition must be met before an alert notification is sent.
    annotations List<GetServiceMetricAlarmRulesRulePrometheusAnnotation>
    When a Prometheus alert is triggered, the key-value pairs of annotations are rendered to help you better understand the metric or alert rule.
    level String
    Alert severity level.
    promQl String
    The PromQL query statement.
    times Integer
    The number of times the alert condition must be met before an alert notification is sent.
    annotations GetServiceMetricAlarmRulesRulePrometheusAnnotation[]
    When a Prometheus alert is triggered, the key-value pairs of annotations are rendered to help you better understand the metric or alert rule.
    level string
    Alert severity level.
    promQl string
    The PromQL query statement.
    times number
    The number of times the alert condition must be met before an alert notification is sent.
    annotations Sequence[GetServiceMetricAlarmRulesRulePrometheusAnnotation]
    When a Prometheus alert is triggered, the key-value pairs of annotations are rendered to help you better understand the metric or alert rule.
    level str
    Alert severity level.
    prom_ql str
    The PromQL query 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.
    level String
    Alert severity level.
    promQl String
    The PromQL query statement.
    times Number
    The number of times the alert condition must be met before an alert notification is sent.

    GetServiceMetricAlarmRulesRulePrometheusAnnotation

    Key string
    The key of the annotation.
    Value string
    The value of the annotation.
    Key string
    The key of the annotation.
    Value string
    The value of the annotation.
    key string
    The key of the annotation.
    value string
    The value of the annotation.
    key String
    The key of the annotation.
    value String
    The value of the annotation.
    key string
    The key of the annotation.
    value string
    The value of the annotation.
    key str
    The key of the annotation.
    value str
    The value of the annotation.
    key String
    The key of the annotation.
    value String
    The value of the annotation.

    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
    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