1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. cloudmonitor
  5. getServiceMetricAlarmRules
Alibaba Cloud v3.85.0 published on Tuesday, Sep 9, 2025 by Pulumi

alicloud.cloudmonitor.getServiceMetricAlarmRules

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.85.0 published on Tuesday, Sep 9, 2025 by Pulumi

    This data source provides the Cloud Monitor Service Metric Alarm Rules of the current Alibaba Cloud user.

    NOTE: Available since v1.256.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 = 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 (
    	"fmt"
    
    	"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.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            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}
    

    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,
                                       ids: Optional[Sequence[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: Optional[pulumi.Input[str]] = None,
                                       ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                                       metric_name: Optional[pulumi.Input[str]] = None,
                                       namespace: Optional[pulumi.Input[str]] = None,
                                       output_file: Optional[pulumi.Input[str]] = None,
                                       rule_name: Optional[pulumi.Input[str]] = None,
                                       status: Optional[pulumi.Input[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

    The following arguments are supported:

    Dimensions string
    The monitoring dimensions of the specified resource.
    Ids List<string>
    A list of Metric Alarm Rule IDs.
    MetricName string
    The name of the metric.
    Namespace string
    The namespace of the cloud service.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    RuleName string
    The name of the alert rule.
    Status bool
    Specifies whether to query enabled or disabled alert rules. Valid values: true, false.
    Dimensions string
    The monitoring dimensions of the specified resource.
    Ids []string
    A list of Metric Alarm Rule IDs.
    MetricName string
    The name of the metric.
    Namespace string
    The namespace of the cloud service.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    RuleName string
    The name of the alert rule.
    Status bool
    Specifies whether to query enabled or disabled alert rules. Valid values: true, false.
    dimensions String
    The monitoring dimensions of the specified resource.
    ids List<String>
    A list of Metric Alarm Rule IDs.
    metricName String
    The name of the metric.
    namespace String
    The namespace of the cloud service.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    ruleName String
    The name of the alert rule.
    status Boolean
    Specifies whether to query enabled or disabled alert rules. Valid values: true, false.
    dimensions string
    The monitoring dimensions of the specified resource.
    ids string[]
    A list of Metric Alarm Rule IDs.
    metricName string
    The name of the metric.
    namespace string
    The namespace of the cloud service.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    ruleName string
    The name of the alert rule.
    status boolean
    Specifies whether to query enabled or disabled alert rules. Valid values: true, false.
    dimensions str
    The monitoring dimensions of the specified resource.
    ids Sequence[str]
    A list of Metric Alarm Rule IDs.
    metric_name str
    The name of the metric.
    namespace str
    The namespace of the cloud service.
    output_file str
    File name where to save data source results (after running pulumi preview).
    rule_name str
    The name of the alert rule.
    status bool
    Specifies whether to query enabled or disabled alert rules. Valid values: true, false.
    dimensions String
    The monitoring dimensions of the specified resource.
    ids List<String>
    A list of Metric Alarm Rule IDs.
    metricName String
    The name of the metric.
    namespace String
    The namespace of the cloud service.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    ruleName String
    The name of the alert rule.
    status Boolean
    Specifies whether to query enabled or disabled alert rules. Valid values: true, false.

    getServiceMetricAlarmRules Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    Rules List<Pulumi.AliCloud.CloudMonitor.Outputs.GetServiceMetricAlarmRulesRule>
    A list of Hybrid Double Writes. Each element contains the following attributes:
    Dimensions string
    The dimensions of the alert rule.
    MetricName string
    The metric that is used to monitor the cloud service.
    Namespace string
    The namespace of the cloud service.
    OutputFile string
    RuleName string
    The name of the alert rule.
    Status bool
    Indicates whether the alert rule is enabled.
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    Rules []GetServiceMetricAlarmRulesRule
    A list of Hybrid Double Writes. Each element contains the following attributes:
    Dimensions string
    The dimensions of the alert rule.
    MetricName string
    The metric that is used to monitor the cloud service.
    Namespace string
    The namespace of the cloud service.
    OutputFile string
    RuleName string
    The name of the alert rule.
    Status bool
    Indicates whether the alert rule is enabled.
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    rules List<GetServiceMetricAlarmRulesRule>
    A list of Hybrid Double Writes. Each element contains the following attributes:
    dimensions String
    The dimensions of the alert rule.
    metricName String
    The metric that is used to monitor the cloud service.
    namespace String
    The namespace of the cloud service.
    outputFile String
    ruleName String
    The name of the alert rule.
    status Boolean
    Indicates whether the alert rule is enabled.
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    rules GetServiceMetricAlarmRulesRule[]
    A list of Hybrid Double Writes. Each element contains the following attributes:
    dimensions string
    The dimensions of the alert rule.
    metricName string
    The metric that is used to monitor the cloud service.
    namespace string
    The namespace of the cloud service.
    outputFile string
    ruleName string
    The name of the alert rule.
    status boolean
    Indicates whether the alert rule is enabled.
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    rules Sequence[GetServiceMetricAlarmRulesRule]
    A list of Hybrid Double Writes. Each element contains the following attributes:
    dimensions str
    The dimensions of the alert rule.
    metric_name str
    The metric that is used to monitor the cloud service.
    namespace str
    The namespace of the cloud service.
    output_file str
    rule_name str
    The name of the alert rule.
    status bool
    Indicates whether the alert rule is enabled.
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    rules List<Property Map>
    A list of Hybrid Double Writes. Each element contains the following attributes:
    dimensions String
    The dimensions of the alert rule.
    metricName String
    The metric that is used to monitor the cloud service.
    namespace String
    The namespace of the cloud service.
    outputFile String
    ruleName String
    The name of the alert rule.
    status Boolean
    Indicates whether the alert rule is enabled.

    Supporting Types

    GetServiceMetricAlarmRulesRule

    CompositeExpression Pulumi.AliCloud.CloudMonitor.Inputs.GetServiceMetricAlarmRulesRuleCompositeExpression
    The trigger conditions for multiple metrics.
    ContactGroups string
    The alert contact group.
    Dimensions string
    The monitoring dimensions of the specified resource.
    EffectiveInterval string
    The time period during which the alert rule is effective.
    EmailSubject string
    The subject of the alert notification email.
    Escalations Pulumi.AliCloud.CloudMonitor.Inputs.GetServiceMetricAlarmRulesRuleEscalations
    The conditions for triggering different levels of alerts.
    Id string
    The ID of the alert rule.
    Labels List<Pulumi.AliCloud.CloudMonitor.Inputs.GetServiceMetricAlarmRulesRuleLabel>
    The tags of the alert rule.
    MetricName string
    The name of the metric.
    Namespace string
    The namespace of the cloud service.
    NoDataPolicy string
    The method that is used to handle alerts when no monitoring data is found.
    NoEffectiveInterval string
    The time period during which the alert rule is ineffective.
    Period string
    The aggregation period of the metric.
    Prometheus Pulumi.AliCloud.CloudMonitor.Inputs.GetServiceMetricAlarmRulesRulePrometheus
    The Prometheus alerts.
    Resources string
    The resources that are associated with the alert rule.
    RuleName string
    The name of the alert rule.
    SilenceTime string
    The mute period during which new alert notifications are not sent even if the trigger conditions are met.
    SourceType string
    The type of the alert rule.
    Status bool
    Specifies whether to query enabled or disabled alert rules. Valid values: true, false.
    Webhook string
    The callback URL.
    CompositeExpression GetServiceMetricAlarmRulesRuleCompositeExpression
    The trigger conditions for multiple metrics.
    ContactGroups string
    The alert contact group.
    Dimensions string
    The monitoring dimensions of the specified resource.
    EffectiveInterval string
    The time period during which the alert rule is effective.
    EmailSubject string
    The subject of the alert notification email.
    Escalations GetServiceMetricAlarmRulesRuleEscalations
    The conditions for triggering different levels of alerts.
    Id string
    The ID of the alert rule.
    Labels []GetServiceMetricAlarmRulesRuleLabel
    The tags of the alert rule.
    MetricName string
    The name of the metric.
    Namespace string
    The namespace of the cloud service.
    NoDataPolicy string
    The method that is used to handle alerts when no monitoring data is found.
    NoEffectiveInterval string
    The time period during which the alert rule is ineffective.
    Period string
    The aggregation period of the metric.
    Prometheus GetServiceMetricAlarmRulesRulePrometheus
    The Prometheus alerts.
    Resources string
    The resources that are associated with the alert rule.
    RuleName string
    The name of the alert rule.
    SilenceTime string
    The mute period during which new alert notifications are not sent even if the trigger conditions are met.
    SourceType string
    The type of the alert rule.
    Status bool
    Specifies whether to query enabled or disabled alert rules. Valid values: true, false.
    Webhook string
    The callback URL.
    compositeExpression GetServiceMetricAlarmRulesRuleCompositeExpression
    The trigger conditions for multiple metrics.
    contactGroups String
    The alert contact group.
    dimensions String
    The monitoring dimensions of the specified resource.
    effectiveInterval String
    The time period during which the alert rule is effective.
    emailSubject String
    The subject of the alert notification email.
    escalations GetServiceMetricAlarmRulesRuleEscalations
    The conditions for triggering different levels of alerts.
    id String
    The ID of the alert rule.
    labels List<GetServiceMetricAlarmRulesRuleLabel>
    The tags of the alert rule.
    metricName String
    The name of the metric.
    namespace String
    The namespace of the cloud service.
    noDataPolicy String
    The method that is used to handle alerts when no monitoring data is found.
    noEffectiveInterval String
    The time period during which the alert rule is ineffective.
    period String
    The aggregation period of the metric.
    prometheus GetServiceMetricAlarmRulesRulePrometheus
    The Prometheus alerts.
    resources String
    The resources that are associated with the alert rule.
    ruleName String
    The name of the alert rule.
    silenceTime String
    The mute period during which new alert notifications are not sent even if the trigger conditions are met.
    sourceType String
    The type of the alert rule.
    status Boolean
    Specifies whether to query enabled or disabled alert rules. Valid values: true, false.
    webhook String
    The callback URL.
    compositeExpression GetServiceMetricAlarmRulesRuleCompositeExpression
    The trigger conditions for multiple metrics.
    contactGroups string
    The alert contact group.
    dimensions string
    The monitoring dimensions of the specified resource.
    effectiveInterval string
    The time period during which the alert rule is effective.
    emailSubject string
    The subject of the alert notification email.
    escalations GetServiceMetricAlarmRulesRuleEscalations
    The conditions for triggering different levels of alerts.
    id string
    The ID of the alert rule.
    labels GetServiceMetricAlarmRulesRuleLabel[]
    The tags of the alert rule.
    metricName string
    The name of the metric.
    namespace string
    The namespace of the cloud service.
    noDataPolicy string
    The method that is used to handle alerts when no monitoring data is found.
    noEffectiveInterval string
    The time period during which the alert rule is ineffective.
    period string
    The aggregation period of the metric.
    prometheus GetServiceMetricAlarmRulesRulePrometheus
    The Prometheus alerts.
    resources string
    The resources that are associated with the alert rule.
    ruleName string
    The name of the alert rule.
    silenceTime string
    The mute period during which new alert notifications are not sent even if the trigger conditions are met.
    sourceType string
    The type of the alert rule.
    status boolean
    Specifies whether to query enabled or disabled alert rules. Valid values: true, false.
    webhook string
    The callback URL.
    composite_expression GetServiceMetricAlarmRulesRuleCompositeExpression
    The trigger conditions for multiple metrics.
    contact_groups str
    The alert contact group.
    dimensions str
    The monitoring dimensions of the specified resource.
    effective_interval str
    The time period during which the alert rule is effective.
    email_subject str
    The subject of the alert notification email.
    escalations GetServiceMetricAlarmRulesRuleEscalations
    The conditions for triggering different levels of alerts.
    id str
    The ID of the alert rule.
    labels Sequence[GetServiceMetricAlarmRulesRuleLabel]
    The tags of the alert rule.
    metric_name str
    The name of the metric.
    namespace str
    The namespace of the cloud service.
    no_data_policy str
    The method that is used to handle alerts when no monitoring data is found.
    no_effective_interval str
    The time period during which the alert rule is ineffective.
    period str
    The aggregation period of the metric.
    prometheus GetServiceMetricAlarmRulesRulePrometheus
    The Prometheus alerts.
    resources str
    The resources that are associated with the alert rule.
    rule_name str
    The name of the alert rule.
    silence_time str
    The mute period during which new alert notifications are not sent even if the trigger conditions are met.
    source_type str
    The type of the alert rule.
    status bool
    Specifies whether to query enabled or disabled alert rules. Valid values: true, false.
    webhook str
    The callback URL.
    compositeExpression Property Map
    The trigger conditions for multiple metrics.
    contactGroups String
    The alert contact group.
    dimensions String
    The monitoring dimensions of the specified resource.
    effectiveInterval String
    The time period during which the alert rule is effective.
    emailSubject String
    The subject of the alert notification email.
    escalations Property Map
    The conditions for triggering different levels of alerts.
    id String
    The ID of the alert rule.
    labels List<Property Map>
    The tags of the alert rule.
    metricName String
    The name of the metric.
    namespace String
    The namespace of the cloud service.
    noDataPolicy String
    The method that is used to handle alerts when no monitoring data is found.
    noEffectiveInterval String
    The time period during which the alert rule is ineffective.
    period String
    The aggregation period of the metric.
    prometheus Property Map
    The Prometheus alerts.
    resources String
    The resources that are associated with the alert rule.
    ruleName String
    The name of the alert rule.
    silenceTime String
    The mute period during which new alert notifications are not sent even if the trigger conditions are met.
    sourceType String
    The type of the alert rule.
    status Boolean
    Specifies whether to query enabled or disabled alert rules. Valid values: true, false.
    webhook String
    The callback URL.

    GetServiceMetricAlarmRulesRuleCompositeExpression

    ExpressionListJoin string
    The relationship between the trigger conditions for multiple metrics.
    ExpressionLists List<Pulumi.AliCloud.CloudMonitor.Inputs.GetServiceMetricAlarmRulesRuleCompositeExpressionExpressionList>
    The trigger conditions that are created in standard mode.
    ExpressionRaw string
    The trigger conditions that are created by using expressions.
    Level string
    The alert level.
    Times int
    The number of consecutive triggers.
    ExpressionListJoin string
    The relationship between the trigger conditions for multiple metrics.
    ExpressionLists []GetServiceMetricAlarmRulesRuleCompositeExpressionExpressionList
    The trigger conditions that are created in standard mode.
    ExpressionRaw string
    The trigger conditions that are created by using expressions.
    Level string
    The alert level.
    Times int
    The number of consecutive triggers.
    expressionListJoin String
    The relationship between the trigger conditions for multiple metrics.
    expressionLists List<GetServiceMetricAlarmRulesRuleCompositeExpressionExpressionList>
    The trigger conditions that are created in standard mode.
    expressionRaw String
    The trigger conditions that are created by using expressions.
    level String
    The alert level.
    times Integer
    The number of consecutive triggers.
    expressionListJoin string
    The relationship between the trigger conditions for multiple metrics.
    expressionLists GetServiceMetricAlarmRulesRuleCompositeExpressionExpressionList[]
    The trigger conditions that are created in standard mode.
    expressionRaw string
    The trigger conditions that are created by using expressions.
    level string
    The alert level.
    times number
    The number of consecutive triggers.
    expression_list_join str
    The relationship between the trigger conditions for multiple metrics.
    expression_lists Sequence[GetServiceMetricAlarmRulesRuleCompositeExpressionExpressionList]
    The trigger conditions that are created in standard mode.
    expression_raw str
    The trigger conditions that are created by using expressions.
    level str
    The alert level.
    times int
    The number of consecutive triggers.
    expressionListJoin String
    The relationship between the trigger conditions for multiple metrics.
    expressionLists List<Property Map>
    The trigger conditions that are created in standard mode.
    expressionRaw String
    The trigger conditions that are created by using expressions.
    level String
    The alert level.
    times Number
    The number of consecutive triggers.

    GetServiceMetricAlarmRulesRuleCompositeExpressionExpressionList

    ComparisonOperator string
    The comparison operator that is used to compare the metric value with the threshold.
    MetricName string
    The name of the metric.
    Period int
    The aggregation period of the metric.
    Statistics string
    The statistical methods for Warn-level alerts.
    Threshold string
    The threshold for Warn-level alerts.
    ComparisonOperator string
    The comparison operator that is used to compare the metric value with the threshold.
    MetricName string
    The name of the metric.
    Period int
    The aggregation period of the metric.
    Statistics string
    The statistical methods for Warn-level alerts.
    Threshold string
    The threshold for Warn-level alerts.
    comparisonOperator String
    The comparison operator that is used to compare the metric value with the threshold.
    metricName String
    The name of the metric.
    period Integer
    The aggregation period of the metric.
    statistics String
    The statistical methods for Warn-level alerts.
    threshold String
    The threshold for Warn-level alerts.
    comparisonOperator string
    The comparison operator that is used to compare the metric value with the threshold.
    metricName string
    The name of the metric.
    period number
    The aggregation period of the metric.
    statistics string
    The statistical methods for Warn-level alerts.
    threshold string
    The threshold for Warn-level alerts.
    comparison_operator str
    The comparison operator that is used to compare the metric value with the threshold.
    metric_name str
    The name of the metric.
    period int
    The aggregation period of the metric.
    statistics str
    The statistical methods for Warn-level alerts.
    threshold str
    The threshold for Warn-level alerts.
    comparisonOperator String
    The comparison operator that is used to compare the metric value with the threshold.
    metricName String
    The name of the metric.
    period Number
    The aggregation period of the metric.
    statistics String
    The statistical methods for Warn-level alerts.
    threshold String
    The threshold for Warn-level alerts.

    GetServiceMetricAlarmRulesRuleEscalations

    Critical GetServiceMetricAlarmRulesRuleEscalationsCritical
    The conditions for triggering Critical-level alerts.
    Info GetServiceMetricAlarmRulesRuleEscalationsInfo
    The conditions for triggering Info-level alerts.
    Warn GetServiceMetricAlarmRulesRuleEscalationsWarn
    The conditions for triggering Warn-level alerts.
    critical GetServiceMetricAlarmRulesRuleEscalationsCritical
    The conditions for triggering Critical-level alerts.
    info GetServiceMetricAlarmRulesRuleEscalationsInfo
    The conditions for triggering Info-level alerts.
    warn GetServiceMetricAlarmRulesRuleEscalationsWarn
    The conditions for triggering Warn-level alerts.
    critical GetServiceMetricAlarmRulesRuleEscalationsCritical
    The conditions for triggering Critical-level alerts.
    info GetServiceMetricAlarmRulesRuleEscalationsInfo
    The conditions for triggering Info-level alerts.
    warn GetServiceMetricAlarmRulesRuleEscalationsWarn
    The conditions for triggering Warn-level alerts.
    critical GetServiceMetricAlarmRulesRuleEscalationsCritical
    The conditions for triggering Critical-level alerts.
    info GetServiceMetricAlarmRulesRuleEscalationsInfo
    The conditions for triggering Info-level alerts.
    warn GetServiceMetricAlarmRulesRuleEscalationsWarn
    The conditions for triggering Warn-level alerts.
    critical Property Map
    The conditions for triggering Critical-level alerts.
    info Property Map
    The conditions for triggering Info-level alerts.
    warn Property Map
    The conditions for triggering Warn-level alerts.

    GetServiceMetricAlarmRulesRuleEscalationsCritical

    ComparisonOperator string
    The comparison operator that is used to compare the metric value with the threshold.
    PreCondition string
    The additional conditions for triggering Warn-level alerts.
    Statistics string
    The statistical methods for Warn-level alerts.
    Threshold string
    The threshold for Warn-level alerts.
    Times int
    The number of consecutive triggers.
    ComparisonOperator string
    The comparison operator that is used to compare the metric value with the threshold.
    PreCondition string
    The additional conditions for triggering Warn-level alerts.
    Statistics string
    The statistical methods for Warn-level alerts.
    Threshold string
    The threshold for Warn-level alerts.
    Times int
    The number of consecutive triggers.
    comparisonOperator String
    The comparison operator that is used to compare the metric value with the threshold.
    preCondition String
    The additional conditions for triggering Warn-level alerts.
    statistics String
    The statistical methods for Warn-level alerts.
    threshold String
    The threshold for Warn-level alerts.
    times Integer
    The number of consecutive triggers.
    comparisonOperator string
    The comparison operator that is used to compare the metric value with the threshold.
    preCondition string
    The additional conditions for triggering Warn-level alerts.
    statistics string
    The statistical methods for Warn-level alerts.
    threshold string
    The threshold for Warn-level alerts.
    times number
    The number of consecutive triggers.
    comparison_operator str
    The comparison operator that is used to compare the metric value with the threshold.
    pre_condition str
    The additional conditions for triggering Warn-level alerts.
    statistics str
    The statistical methods for Warn-level alerts.
    threshold str
    The threshold for Warn-level alerts.
    times int
    The number of consecutive triggers.
    comparisonOperator String
    The comparison operator that is used to compare the metric value with the threshold.
    preCondition String
    The additional conditions for triggering Warn-level alerts.
    statistics String
    The statistical methods for Warn-level alerts.
    threshold String
    The threshold for Warn-level alerts.
    times Number
    The number of consecutive triggers.

    GetServiceMetricAlarmRulesRuleEscalationsInfo

    ComparisonOperator string
    The comparison operator that is used to compare the metric value with the threshold.
    PreCondition string
    The additional conditions for triggering Warn-level alerts.
    Statistics string
    The statistical methods for Warn-level alerts.
    Threshold string
    The threshold for Warn-level alerts.
    Times int
    The number of consecutive triggers.
    ComparisonOperator string
    The comparison operator that is used to compare the metric value with the threshold.
    PreCondition string
    The additional conditions for triggering Warn-level alerts.
    Statistics string
    The statistical methods for Warn-level alerts.
    Threshold string
    The threshold for Warn-level alerts.
    Times int
    The number of consecutive triggers.
    comparisonOperator String
    The comparison operator that is used to compare the metric value with the threshold.
    preCondition String
    The additional conditions for triggering Warn-level alerts.
    statistics String
    The statistical methods for Warn-level alerts.
    threshold String
    The threshold for Warn-level alerts.
    times Integer
    The number of consecutive triggers.
    comparisonOperator string
    The comparison operator that is used to compare the metric value with the threshold.
    preCondition string
    The additional conditions for triggering Warn-level alerts.
    statistics string
    The statistical methods for Warn-level alerts.
    threshold string
    The threshold for Warn-level alerts.
    times number
    The number of consecutive triggers.
    comparison_operator str
    The comparison operator that is used to compare the metric value with the threshold.
    pre_condition str
    The additional conditions for triggering Warn-level alerts.
    statistics str
    The statistical methods for Warn-level alerts.
    threshold str
    The threshold for Warn-level alerts.
    times int
    The number of consecutive triggers.
    comparisonOperator String
    The comparison operator that is used to compare the metric value with the threshold.
    preCondition String
    The additional conditions for triggering Warn-level alerts.
    statistics String
    The statistical methods for Warn-level alerts.
    threshold String
    The threshold for Warn-level alerts.
    times Number
    The number of consecutive triggers.

    GetServiceMetricAlarmRulesRuleEscalationsWarn

    ComparisonOperator string
    The comparison operator that is used to compare the metric value with the threshold.
    PreCondition string
    The additional conditions for triggering Warn-level alerts.
    Statistics string
    The statistical methods for Warn-level alerts.
    Threshold string
    The threshold for Warn-level alerts.
    Times int
    The number of consecutive triggers.
    ComparisonOperator string
    The comparison operator that is used to compare the metric value with the threshold.
    PreCondition string
    The additional conditions for triggering Warn-level alerts.
    Statistics string
    The statistical methods for Warn-level alerts.
    Threshold string
    The threshold for Warn-level alerts.
    Times int
    The number of consecutive triggers.
    comparisonOperator String
    The comparison operator that is used to compare the metric value with the threshold.
    preCondition String
    The additional conditions for triggering Warn-level alerts.
    statistics String
    The statistical methods for Warn-level alerts.
    threshold String
    The threshold for Warn-level alerts.
    times Integer
    The number of consecutive triggers.
    comparisonOperator string
    The comparison operator that is used to compare the metric value with the threshold.
    preCondition string
    The additional conditions for triggering Warn-level alerts.
    statistics string
    The statistical methods for Warn-level alerts.
    threshold string
    The threshold for Warn-level alerts.
    times number
    The number of consecutive triggers.
    comparison_operator str
    The comparison operator that is used to compare the metric value with the threshold.
    pre_condition str
    The additional conditions for triggering Warn-level alerts.
    statistics str
    The statistical methods for Warn-level alerts.
    threshold str
    The threshold for Warn-level alerts.
    times int
    The number of consecutive triggers.
    comparisonOperator String
    The comparison operator that is used to compare the metric value with the threshold.
    preCondition String
    The additional conditions for triggering Warn-level alerts.
    statistics String
    The statistical methods for Warn-level alerts.
    threshold String
    The threshold for Warn-level alerts.
    times Number
    The number of consecutive triggers.

    GetServiceMetricAlarmRulesRuleLabel

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

    GetServiceMetricAlarmRulesRulePrometheus

    Annotations List<Pulumi.AliCloud.CloudMonitor.Inputs.GetServiceMetricAlarmRulesRulePrometheusAnnotation>
    The annotations of the Prometheus alert rule.
    Level string
    The alert level.
    PromQl string
    The PromQL query statement.
    Times int
    The number of consecutive triggers.
    Annotations []GetServiceMetricAlarmRulesRulePrometheusAnnotation
    The annotations of the Prometheus alert rule.
    Level string
    The alert level.
    PromQl string
    The PromQL query statement.
    Times int
    The number of consecutive triggers.
    annotations List<GetServiceMetricAlarmRulesRulePrometheusAnnotation>
    The annotations of the Prometheus alert rule.
    level String
    The alert level.
    promQl String
    The PromQL query statement.
    times Integer
    The number of consecutive triggers.
    annotations GetServiceMetricAlarmRulesRulePrometheusAnnotation[]
    The annotations of the Prometheus alert rule.
    level string
    The alert level.
    promQl string
    The PromQL query statement.
    times number
    The number of consecutive triggers.
    annotations Sequence[GetServiceMetricAlarmRulesRulePrometheusAnnotation]
    The annotations of the Prometheus alert rule.
    level str
    The alert level.
    prom_ql str
    The PromQL query statement.
    times int
    The number of consecutive triggers.
    annotations List<Property Map>
    The annotations of the Prometheus alert rule.
    level String
    The alert level.
    promQl String
    The PromQL query statement.
    times Number
    The number of consecutive triggers.

    GetServiceMetricAlarmRulesRulePrometheusAnnotation

    Key string
    The subject of the alert notificaThe key of the annotation.
    Value string
    The value of the annotation.
    Key string
    The subject of the alert notificaThe key of the annotation.
    Value string
    The value of the annotation.
    key String
    The subject of the alert notificaThe key of the annotation.
    value String
    The value of the annotation.
    key string
    The subject of the alert notificaThe key of the annotation.
    value string
    The value of the annotation.
    key str
    The subject of the alert notificaThe key of the annotation.
    value str
    The value of the annotation.
    key String
    The subject of the alert notificaThe 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
    Alibaba Cloud v3.85.0 published on Tuesday, Sep 9, 2025 by Pulumi