1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. cms
  5. GroupMetricRule
Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi

alicloud.cms.GroupMetricRule

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi

    Provides a Cloud Monitor Service Group Metric Rule resource.

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

    NOTE: Available since v1.104.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") || "tf-example";
    const _default = new alicloud.cms.AlarmContactGroup("default", {
        alarmContactGroupName: name,
        describe: name,
    });
    const defaultMonitorGroup = new alicloud.cms.MonitorGroup("default", {
        monitorGroupName: name,
        contactGroups: [_default.id],
    });
    const _this = new alicloud.cms.GroupMetricRule("this", {
        groupId: defaultMonitorGroup.id,
        groupMetricRuleName: name,
        category: "ecs",
        metricName: "cpu_total",
        namespace: "acs_ecs_dashboard",
        ruleId: name,
        period: 60,
        interval: "3600",
        silenceTime: 85800,
        noEffectiveInterval: "00:00-05:30",
        webhook: "http://www.aliyun.com",
        escalations: {
            warn: {
                comparisonOperator: "GreaterThanOrEqualToThreshold",
                statistics: "Average",
                threshold: "90",
                times: 3,
            },
            info: {
                comparisonOperator: "LessThanLastWeek",
                statistics: "Average",
                threshold: "90",
                times: 5,
            },
        },
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "tf-example"
    default = alicloud.cms.AlarmContactGroup("default",
        alarm_contact_group_name=name,
        describe=name)
    default_monitor_group = alicloud.cms.MonitorGroup("default",
        monitor_group_name=name,
        contact_groups=[default.id])
    this = alicloud.cms.GroupMetricRule("this",
        group_id=default_monitor_group.id,
        group_metric_rule_name=name,
        category="ecs",
        metric_name="cpu_total",
        namespace="acs_ecs_dashboard",
        rule_id=name,
        period=60,
        interval="3600",
        silence_time=85800,
        no_effective_interval="00:00-05:30",
        webhook="http://www.aliyun.com",
        escalations={
            "warn": {
                "comparison_operator": "GreaterThanOrEqualToThreshold",
                "statistics": "Average",
                "threshold": "90",
                "times": 3,
            },
            "info": {
                "comparison_operator": "LessThanLastWeek",
                "statistics": "Average",
                "threshold": "90",
                "times": 5,
            },
        })
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/cms"
    	"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 := "tf-example"
    		if param := cfg.Get("name"); param != "" {
    			name = param
    		}
    		_, err := cms.NewAlarmContactGroup(ctx, "default", &cms.AlarmContactGroupArgs{
    			AlarmContactGroupName: pulumi.String(name),
    			Describe:              pulumi.String(name),
    		})
    		if err != nil {
    			return err
    		}
    		defaultMonitorGroup, err := cms.NewMonitorGroup(ctx, "default", &cms.MonitorGroupArgs{
    			MonitorGroupName: pulumi.String(name),
    			ContactGroups: pulumi.StringArray{
    				_default.ID(),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = cms.NewGroupMetricRule(ctx, "this", &cms.GroupMetricRuleArgs{
    			GroupId:             defaultMonitorGroup.ID(),
    			GroupMetricRuleName: pulumi.String(name),
    			Category:            pulumi.String("ecs"),
    			MetricName:          pulumi.String("cpu_total"),
    			Namespace:           pulumi.String("acs_ecs_dashboard"),
    			RuleId:              pulumi.String(name),
    			Period:              pulumi.Int(60),
    			Interval:            pulumi.String("3600"),
    			SilenceTime:         pulumi.Int(85800),
    			NoEffectiveInterval: pulumi.String("00:00-05:30"),
    			Webhook:             pulumi.String("http://www.aliyun.com"),
    			Escalations: &cms.GroupMetricRuleEscalationsArgs{
    				Warn: &cms.GroupMetricRuleEscalationsWarnArgs{
    					ComparisonOperator: pulumi.String("GreaterThanOrEqualToThreshold"),
    					Statistics:         pulumi.String("Average"),
    					Threshold:          pulumi.String("90"),
    					Times:              pulumi.Int(3),
    				},
    				Info: &cms.GroupMetricRuleEscalationsInfoArgs{
    					ComparisonOperator: pulumi.String("LessThanLastWeek"),
    					Statistics:         pulumi.String("Average"),
    					Threshold:          pulumi.String("90"),
    					Times:              pulumi.Int(5),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		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") ?? "tf-example";
        var @default = new AliCloud.Cms.AlarmContactGroup("default", new()
        {
            AlarmContactGroupName = name,
            Describe = name,
        });
    
        var defaultMonitorGroup = new AliCloud.Cms.MonitorGroup("default", new()
        {
            MonitorGroupName = name,
            ContactGroups = new[]
            {
                @default.Id,
            },
        });
    
        var @this = new AliCloud.Cms.GroupMetricRule("this", new()
        {
            GroupId = defaultMonitorGroup.Id,
            GroupMetricRuleName = name,
            Category = "ecs",
            MetricName = "cpu_total",
            Namespace = "acs_ecs_dashboard",
            RuleId = name,
            Period = 60,
            Interval = "3600",
            SilenceTime = 85800,
            NoEffectiveInterval = "00:00-05:30",
            Webhook = "http://www.aliyun.com",
            Escalations = new AliCloud.Cms.Inputs.GroupMetricRuleEscalationsArgs
            {
                Warn = new AliCloud.Cms.Inputs.GroupMetricRuleEscalationsWarnArgs
                {
                    ComparisonOperator = "GreaterThanOrEqualToThreshold",
                    Statistics = "Average",
                    Threshold = "90",
                    Times = 3,
                },
                Info = new AliCloud.Cms.Inputs.GroupMetricRuleEscalationsInfoArgs
                {
                    ComparisonOperator = "LessThanLastWeek",
                    Statistics = "Average",
                    Threshold = "90",
                    Times = 5,
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.cms.AlarmContactGroup;
    import com.pulumi.alicloud.cms.AlarmContactGroupArgs;
    import com.pulumi.alicloud.cms.MonitorGroup;
    import com.pulumi.alicloud.cms.MonitorGroupArgs;
    import com.pulumi.alicloud.cms.GroupMetricRule;
    import com.pulumi.alicloud.cms.GroupMetricRuleArgs;
    import com.pulumi.alicloud.cms.inputs.GroupMetricRuleEscalationsArgs;
    import com.pulumi.alicloud.cms.inputs.GroupMetricRuleEscalationsWarnArgs;
    import com.pulumi.alicloud.cms.inputs.GroupMetricRuleEscalationsInfoArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            final var config = ctx.config();
            final var name = config.get("name").orElse("tf-example");
            var default_ = new AlarmContactGroup("default", AlarmContactGroupArgs.builder()
                .alarmContactGroupName(name)
                .describe(name)
                .build());
    
            var defaultMonitorGroup = new MonitorGroup("defaultMonitorGroup", MonitorGroupArgs.builder()
                .monitorGroupName(name)
                .contactGroups(default_.id())
                .build());
    
            var this_ = new GroupMetricRule("this", GroupMetricRuleArgs.builder()
                .groupId(defaultMonitorGroup.id())
                .groupMetricRuleName(name)
                .category("ecs")
                .metricName("cpu_total")
                .namespace("acs_ecs_dashboard")
                .ruleId(name)
                .period("60")
                .interval("3600")
                .silenceTime(85800)
                .noEffectiveInterval("00:00-05:30")
                .webhook("http://www.aliyun.com")
                .escalations(GroupMetricRuleEscalationsArgs.builder()
                    .warn(GroupMetricRuleEscalationsWarnArgs.builder()
                        .comparisonOperator("GreaterThanOrEqualToThreshold")
                        .statistics("Average")
                        .threshold("90")
                        .times(3)
                        .build())
                    .info(GroupMetricRuleEscalationsInfoArgs.builder()
                        .comparisonOperator("LessThanLastWeek")
                        .statistics("Average")
                        .threshold("90")
                        .times(5)
                        .build())
                    .build())
                .build());
    
        }
    }
    
    configuration:
      name:
        type: string
        default: tf-example
    resources:
      default:
        type: alicloud:cms:AlarmContactGroup
        properties:
          alarmContactGroupName: ${name}
          describe: ${name}
      defaultMonitorGroup:
        type: alicloud:cms:MonitorGroup
        name: default
        properties:
          monitorGroupName: ${name}
          contactGroups:
            - ${default.id}
      this:
        type: alicloud:cms:GroupMetricRule
        properties:
          groupId: ${defaultMonitorGroup.id}
          groupMetricRuleName: ${name}
          category: ecs
          metricName: cpu_total
          namespace: acs_ecs_dashboard
          ruleId: ${name}
          period: '60'
          interval: '3600'
          silenceTime: 85800
          noEffectiveInterval: 00:00-05:30
          webhook: http://www.aliyun.com
          escalations:
            warn:
              comparisonOperator: GreaterThanOrEqualToThreshold
              statistics: Average
              threshold: '90'
              times: 3
            info:
              comparisonOperator: LessThanLastWeek
              statistics: Average
              threshold: '90'
              times: 5
    

    Create GroupMetricRule Resource

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

    Constructor syntax

    new GroupMetricRule(name: string, args: GroupMetricRuleArgs, opts?: CustomResourceOptions);
    @overload
    def GroupMetricRule(resource_name: str,
                        args: GroupMetricRuleArgs,
                        opts: Optional[ResourceOptions] = None)
    
    @overload
    def GroupMetricRule(resource_name: str,
                        opts: Optional[ResourceOptions] = None,
                        group_id: Optional[str] = None,
                        rule_id: Optional[str] = None,
                        namespace: Optional[str] = None,
                        metric_name: Optional[str] = None,
                        group_metric_rule_name: Optional[str] = None,
                        escalations: Optional[GroupMetricRuleEscalationsArgs] = None,
                        interval: Optional[str] = None,
                        email_subject: Optional[str] = None,
                        category: Optional[str] = None,
                        effective_interval: Optional[str] = None,
                        dimensions: Optional[str] = None,
                        no_effective_interval: Optional[str] = None,
                        period: Optional[int] = None,
                        contact_groups: Optional[str] = None,
                        silence_time: Optional[int] = None,
                        targets: Optional[Sequence[GroupMetricRuleTargetArgs]] = None,
                        webhook: Optional[str] = None)
    func NewGroupMetricRule(ctx *Context, name string, args GroupMetricRuleArgs, opts ...ResourceOption) (*GroupMetricRule, error)
    public GroupMetricRule(string name, GroupMetricRuleArgs args, CustomResourceOptions? opts = null)
    public GroupMetricRule(String name, GroupMetricRuleArgs args)
    public GroupMetricRule(String name, GroupMetricRuleArgs args, CustomResourceOptions options)
    
    type: alicloud:cms:GroupMetricRule
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

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

    Constructor example

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

    var groupMetricRuleResource = new AliCloud.Cms.GroupMetricRule("groupMetricRuleResource", new()
    {
        GroupId = "string",
        RuleId = "string",
        Namespace = "string",
        MetricName = "string",
        GroupMetricRuleName = "string",
        Escalations = new AliCloud.Cms.Inputs.GroupMetricRuleEscalationsArgs
        {
            Critical = new AliCloud.Cms.Inputs.GroupMetricRuleEscalationsCriticalArgs
            {
                ComparisonOperator = "string",
                Statistics = "string",
                Threshold = "string",
                Times = 0,
            },
            Info = new AliCloud.Cms.Inputs.GroupMetricRuleEscalationsInfoArgs
            {
                ComparisonOperator = "string",
                Statistics = "string",
                Threshold = "string",
                Times = 0,
            },
            Warn = new AliCloud.Cms.Inputs.GroupMetricRuleEscalationsWarnArgs
            {
                ComparisonOperator = "string",
                Statistics = "string",
                Threshold = "string",
                Times = 0,
            },
        },
        Interval = "string",
        EmailSubject = "string",
        Category = "string",
        EffectiveInterval = "string",
        Dimensions = "string",
        NoEffectiveInterval = "string",
        Period = 0,
        ContactGroups = "string",
        SilenceTime = 0,
        Targets = new[]
        {
            new AliCloud.Cms.Inputs.GroupMetricRuleTargetArgs
            {
                Arn = "string",
                Id = "string",
                JsonParams = "string",
                Level = "string",
            },
        },
        Webhook = "string",
    });
    
    example, err := cms.NewGroupMetricRule(ctx, "groupMetricRuleResource", &cms.GroupMetricRuleArgs{
    	GroupId:             pulumi.String("string"),
    	RuleId:              pulumi.String("string"),
    	Namespace:           pulumi.String("string"),
    	MetricName:          pulumi.String("string"),
    	GroupMetricRuleName: pulumi.String("string"),
    	Escalations: &cms.GroupMetricRuleEscalationsArgs{
    		Critical: &cms.GroupMetricRuleEscalationsCriticalArgs{
    			ComparisonOperator: pulumi.String("string"),
    			Statistics:         pulumi.String("string"),
    			Threshold:          pulumi.String("string"),
    			Times:              pulumi.Int(0),
    		},
    		Info: &cms.GroupMetricRuleEscalationsInfoArgs{
    			ComparisonOperator: pulumi.String("string"),
    			Statistics:         pulumi.String("string"),
    			Threshold:          pulumi.String("string"),
    			Times:              pulumi.Int(0),
    		},
    		Warn: &cms.GroupMetricRuleEscalationsWarnArgs{
    			ComparisonOperator: pulumi.String("string"),
    			Statistics:         pulumi.String("string"),
    			Threshold:          pulumi.String("string"),
    			Times:              pulumi.Int(0),
    		},
    	},
    	Interval:            pulumi.String("string"),
    	EmailSubject:        pulumi.String("string"),
    	Category:            pulumi.String("string"),
    	EffectiveInterval:   pulumi.String("string"),
    	Dimensions:          pulumi.String("string"),
    	NoEffectiveInterval: pulumi.String("string"),
    	Period:              pulumi.Int(0),
    	ContactGroups:       pulumi.String("string"),
    	SilenceTime:         pulumi.Int(0),
    	Targets: cms.GroupMetricRuleTargetArray{
    		&cms.GroupMetricRuleTargetArgs{
    			Arn:        pulumi.String("string"),
    			Id:         pulumi.String("string"),
    			JsonParams: pulumi.String("string"),
    			Level:      pulumi.String("string"),
    		},
    	},
    	Webhook: pulumi.String("string"),
    })
    
    var groupMetricRuleResource = new GroupMetricRule("groupMetricRuleResource", GroupMetricRuleArgs.builder()
        .groupId("string")
        .ruleId("string")
        .namespace("string")
        .metricName("string")
        .groupMetricRuleName("string")
        .escalations(GroupMetricRuleEscalationsArgs.builder()
            .critical(GroupMetricRuleEscalationsCriticalArgs.builder()
                .comparisonOperator("string")
                .statistics("string")
                .threshold("string")
                .times(0)
                .build())
            .info(GroupMetricRuleEscalationsInfoArgs.builder()
                .comparisonOperator("string")
                .statistics("string")
                .threshold("string")
                .times(0)
                .build())
            .warn(GroupMetricRuleEscalationsWarnArgs.builder()
                .comparisonOperator("string")
                .statistics("string")
                .threshold("string")
                .times(0)
                .build())
            .build())
        .interval("string")
        .emailSubject("string")
        .category("string")
        .effectiveInterval("string")
        .dimensions("string")
        .noEffectiveInterval("string")
        .period(0)
        .contactGroups("string")
        .silenceTime(0)
        .targets(GroupMetricRuleTargetArgs.builder()
            .arn("string")
            .id("string")
            .jsonParams("string")
            .level("string")
            .build())
        .webhook("string")
        .build());
    
    group_metric_rule_resource = alicloud.cms.GroupMetricRule("groupMetricRuleResource",
        group_id="string",
        rule_id="string",
        namespace="string",
        metric_name="string",
        group_metric_rule_name="string",
        escalations={
            "critical": {
                "comparison_operator": "string",
                "statistics": "string",
                "threshold": "string",
                "times": 0,
            },
            "info": {
                "comparison_operator": "string",
                "statistics": "string",
                "threshold": "string",
                "times": 0,
            },
            "warn": {
                "comparison_operator": "string",
                "statistics": "string",
                "threshold": "string",
                "times": 0,
            },
        },
        interval="string",
        email_subject="string",
        category="string",
        effective_interval="string",
        dimensions="string",
        no_effective_interval="string",
        period=0,
        contact_groups="string",
        silence_time=0,
        targets=[{
            "arn": "string",
            "id": "string",
            "json_params": "string",
            "level": "string",
        }],
        webhook="string")
    
    const groupMetricRuleResource = new alicloud.cms.GroupMetricRule("groupMetricRuleResource", {
        groupId: "string",
        ruleId: "string",
        namespace: "string",
        metricName: "string",
        groupMetricRuleName: "string",
        escalations: {
            critical: {
                comparisonOperator: "string",
                statistics: "string",
                threshold: "string",
                times: 0,
            },
            info: {
                comparisonOperator: "string",
                statistics: "string",
                threshold: "string",
                times: 0,
            },
            warn: {
                comparisonOperator: "string",
                statistics: "string",
                threshold: "string",
                times: 0,
            },
        },
        interval: "string",
        emailSubject: "string",
        category: "string",
        effectiveInterval: "string",
        dimensions: "string",
        noEffectiveInterval: "string",
        period: 0,
        contactGroups: "string",
        silenceTime: 0,
        targets: [{
            arn: "string",
            id: "string",
            jsonParams: "string",
            level: "string",
        }],
        webhook: "string",
    });
    
    type: alicloud:cms:GroupMetricRule
    properties:
        category: string
        contactGroups: string
        dimensions: string
        effectiveInterval: string
        emailSubject: string
        escalations:
            critical:
                comparisonOperator: string
                statistics: string
                threshold: string
                times: 0
            info:
                comparisonOperator: string
                statistics: string
                threshold: string
                times: 0
            warn:
                comparisonOperator: string
                statistics: string
                threshold: string
                times: 0
        groupId: string
        groupMetricRuleName: string
        interval: string
        metricName: string
        namespace: string
        noEffectiveInterval: string
        period: 0
        ruleId: string
        silenceTime: 0
        targets:
            - arn: string
              id: string
              jsonParams: string
              level: string
        webhook: string
    

    GroupMetricRule Resource Properties

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

    Inputs

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

    The GroupMetricRule resource accepts the following input properties:

    Escalations Pulumi.AliCloud.Cms.Inputs.GroupMetricRuleEscalations
    Alarm level. See escalations below.
    GroupId string
    The ID of the application group.
    GroupMetricRuleName string
    The name of the alert rule.
    MetricName string
    The name of the metric.
    Namespace string
    The namespace of the service.
    RuleId string
    The ID of the alert rule.
    Category string
    The abbreviation of the service name.
    ContactGroups string
    Alarm contact group.
    Dimensions string
    The dimensions that specify the resources to be associated with the alert rule.
    EffectiveInterval string
    The time period during which the alert rule is effective.
    EmailSubject string
    The subject of the alert notification email.
    Interval string
    The interval at which Cloud Monitor checks whether the alert rule is triggered. Unit: seconds.
    NoEffectiveInterval string
    The time period during which the alert rule is ineffective.
    Period int
    The aggregation period of the monitoring data. Unit: seconds. The value is an integral multiple of 60. Default value: 300.
    SilenceTime int
    The mute period during which new alerts are not reported even if the alert trigger conditions are met. Unit: seconds. Default value: 86400, which is equivalent to one day.
    Targets List<Pulumi.AliCloud.Cms.Inputs.GroupMetricRuleTarget>
    The information about the resource for which alerts are triggered. See targets below.
    Webhook string
    The callback URL.
    Escalations GroupMetricRuleEscalationsArgs
    Alarm level. See escalations below.
    GroupId string
    The ID of the application group.
    GroupMetricRuleName string
    The name of the alert rule.
    MetricName string
    The name of the metric.
    Namespace string
    The namespace of the service.
    RuleId string
    The ID of the alert rule.
    Category string
    The abbreviation of the service name.
    ContactGroups string
    Alarm contact group.
    Dimensions string
    The dimensions that specify the resources to be associated with the alert rule.
    EffectiveInterval string
    The time period during which the alert rule is effective.
    EmailSubject string
    The subject of the alert notification email.
    Interval string
    The interval at which Cloud Monitor checks whether the alert rule is triggered. Unit: seconds.
    NoEffectiveInterval string
    The time period during which the alert rule is ineffective.
    Period int
    The aggregation period of the monitoring data. Unit: seconds. The value is an integral multiple of 60. Default value: 300.
    SilenceTime int
    The mute period during which new alerts are not reported even if the alert trigger conditions are met. Unit: seconds. Default value: 86400, which is equivalent to one day.
    Targets []GroupMetricRuleTargetArgs
    The information about the resource for which alerts are triggered. See targets below.
    Webhook string
    The callback URL.
    escalations GroupMetricRuleEscalations
    Alarm level. See escalations below.
    groupId String
    The ID of the application group.
    groupMetricRuleName String
    The name of the alert rule.
    metricName String
    The name of the metric.
    namespace String
    The namespace of the service.
    ruleId String
    The ID of the alert rule.
    category String
    The abbreviation of the service name.
    contactGroups String
    Alarm contact group.
    dimensions String
    The dimensions that specify the resources to be associated with the alert rule.
    effectiveInterval String
    The time period during which the alert rule is effective.
    emailSubject String
    The subject of the alert notification email.
    interval String
    The interval at which Cloud Monitor checks whether the alert rule is triggered. Unit: seconds.
    noEffectiveInterval String
    The time period during which the alert rule is ineffective.
    period Integer
    The aggregation period of the monitoring data. Unit: seconds. The value is an integral multiple of 60. Default value: 300.
    silenceTime Integer
    The mute period during which new alerts are not reported even if the alert trigger conditions are met. Unit: seconds. Default value: 86400, which is equivalent to one day.
    targets List<GroupMetricRuleTarget>
    The information about the resource for which alerts are triggered. See targets below.
    webhook String
    The callback URL.
    escalations GroupMetricRuleEscalations
    Alarm level. See escalations below.
    groupId string
    The ID of the application group.
    groupMetricRuleName string
    The name of the alert rule.
    metricName string
    The name of the metric.
    namespace string
    The namespace of the service.
    ruleId string
    The ID of the alert rule.
    category string
    The abbreviation of the service name.
    contactGroups string
    Alarm contact group.
    dimensions string
    The dimensions that specify the resources to be associated with the alert rule.
    effectiveInterval string
    The time period during which the alert rule is effective.
    emailSubject string
    The subject of the alert notification email.
    interval string
    The interval at which Cloud Monitor checks whether the alert rule is triggered. Unit: seconds.
    noEffectiveInterval string
    The time period during which the alert rule is ineffective.
    period number
    The aggregation period of the monitoring data. Unit: seconds. The value is an integral multiple of 60. Default value: 300.
    silenceTime number
    The mute period during which new alerts are not reported even if the alert trigger conditions are met. Unit: seconds. Default value: 86400, which is equivalent to one day.
    targets GroupMetricRuleTarget[]
    The information about the resource for which alerts are triggered. See targets below.
    webhook string
    The callback URL.
    escalations GroupMetricRuleEscalationsArgs
    Alarm level. See escalations below.
    group_id str
    The ID of the application group.
    group_metric_rule_name str
    The name of the alert rule.
    metric_name str
    The name of the metric.
    namespace str
    The namespace of the service.
    rule_id str
    The ID of the alert rule.
    category str
    The abbreviation of the service name.
    contact_groups str
    Alarm contact group.
    dimensions str
    The dimensions that specify the resources to be associated with the alert rule.
    effective_interval str
    The time period during which the alert rule is effective.
    email_subject str
    The subject of the alert notification email.
    interval str
    The interval at which Cloud Monitor checks whether the alert rule is triggered. Unit: seconds.
    no_effective_interval str
    The time period during which the alert rule is ineffective.
    period int
    The aggregation period of the monitoring data. Unit: seconds. The value is an integral multiple of 60. Default value: 300.
    silence_time int
    The mute period during which new alerts are not reported even if the alert trigger conditions are met. Unit: seconds. Default value: 86400, which is equivalent to one day.
    targets Sequence[GroupMetricRuleTargetArgs]
    The information about the resource for which alerts are triggered. See targets below.
    webhook str
    The callback URL.
    escalations Property Map
    Alarm level. See escalations below.
    groupId String
    The ID of the application group.
    groupMetricRuleName String
    The name of the alert rule.
    metricName String
    The name of the metric.
    namespace String
    The namespace of the service.
    ruleId String
    The ID of the alert rule.
    category String
    The abbreviation of the service name.
    contactGroups String
    Alarm contact group.
    dimensions String
    The dimensions that specify the resources to be associated with the alert rule.
    effectiveInterval String
    The time period during which the alert rule is effective.
    emailSubject String
    The subject of the alert notification email.
    interval String
    The interval at which Cloud Monitor checks whether the alert rule is triggered. Unit: seconds.
    noEffectiveInterval String
    The time period during which the alert rule is ineffective.
    period Number
    The aggregation period of the monitoring data. Unit: seconds. The value is an integral multiple of 60. Default value: 300.
    silenceTime Number
    The mute period during which new alerts are not reported even if the alert trigger conditions are met. Unit: seconds. Default value: 86400, which is equivalent to one day.
    targets List<Property Map>
    The information about the resource for which alerts are triggered. See targets below.
    webhook String
    The callback URL.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    The status of Group Metric Rule.
    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    The status of Group Metric Rule.
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    The status of Group Metric Rule.
    id string
    The provider-assigned unique ID for this managed resource.
    status string
    The status of Group Metric Rule.
    id str
    The provider-assigned unique ID for this managed resource.
    status str
    The status of Group Metric Rule.
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    The status of Group Metric Rule.

    Look up Existing GroupMetricRule Resource

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

    public static get(name: string, id: Input<ID>, state?: GroupMetricRuleState, opts?: CustomResourceOptions): GroupMetricRule
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            category: Optional[str] = None,
            contact_groups: Optional[str] = None,
            dimensions: Optional[str] = None,
            effective_interval: Optional[str] = None,
            email_subject: Optional[str] = None,
            escalations: Optional[GroupMetricRuleEscalationsArgs] = None,
            group_id: Optional[str] = None,
            group_metric_rule_name: Optional[str] = None,
            interval: Optional[str] = None,
            metric_name: Optional[str] = None,
            namespace: Optional[str] = None,
            no_effective_interval: Optional[str] = None,
            period: Optional[int] = None,
            rule_id: Optional[str] = None,
            silence_time: Optional[int] = None,
            status: Optional[str] = None,
            targets: Optional[Sequence[GroupMetricRuleTargetArgs]] = None,
            webhook: Optional[str] = None) -> GroupMetricRule
    func GetGroupMetricRule(ctx *Context, name string, id IDInput, state *GroupMetricRuleState, opts ...ResourceOption) (*GroupMetricRule, error)
    public static GroupMetricRule Get(string name, Input<string> id, GroupMetricRuleState? state, CustomResourceOptions? opts = null)
    public static GroupMetricRule get(String name, Output<String> id, GroupMetricRuleState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    Category string
    The abbreviation of the service name.
    ContactGroups string
    Alarm contact group.
    Dimensions string
    The dimensions that specify the resources to be associated with the alert rule.
    EffectiveInterval string
    The time period during which the alert rule is effective.
    EmailSubject string
    The subject of the alert notification email.
    Escalations Pulumi.AliCloud.Cms.Inputs.GroupMetricRuleEscalations
    Alarm level. See escalations below.
    GroupId string
    The ID of the application group.
    GroupMetricRuleName string
    The name of the alert rule.
    Interval string
    The interval at which Cloud Monitor checks whether the alert rule is triggered. Unit: seconds.
    MetricName string
    The name of the metric.
    Namespace string
    The namespace of the service.
    NoEffectiveInterval string
    The time period during which the alert rule is ineffective.
    Period int
    The aggregation period of the monitoring data. Unit: seconds. The value is an integral multiple of 60. Default value: 300.
    RuleId string
    The ID of the alert rule.
    SilenceTime int
    The mute period during which new alerts are not reported even if the alert trigger conditions are met. Unit: seconds. Default value: 86400, which is equivalent to one day.
    Status string
    The status of Group Metric Rule.
    Targets List<Pulumi.AliCloud.Cms.Inputs.GroupMetricRuleTarget>
    The information about the resource for which alerts are triggered. See targets below.
    Webhook string
    The callback URL.
    Category string
    The abbreviation of the service name.
    ContactGroups string
    Alarm contact group.
    Dimensions string
    The dimensions that specify the resources to be associated with the alert rule.
    EffectiveInterval string
    The time period during which the alert rule is effective.
    EmailSubject string
    The subject of the alert notification email.
    Escalations GroupMetricRuleEscalationsArgs
    Alarm level. See escalations below.
    GroupId string
    The ID of the application group.
    GroupMetricRuleName string
    The name of the alert rule.
    Interval string
    The interval at which Cloud Monitor checks whether the alert rule is triggered. Unit: seconds.
    MetricName string
    The name of the metric.
    Namespace string
    The namespace of the service.
    NoEffectiveInterval string
    The time period during which the alert rule is ineffective.
    Period int
    The aggregation period of the monitoring data. Unit: seconds. The value is an integral multiple of 60. Default value: 300.
    RuleId string
    The ID of the alert rule.
    SilenceTime int
    The mute period during which new alerts are not reported even if the alert trigger conditions are met. Unit: seconds. Default value: 86400, which is equivalent to one day.
    Status string
    The status of Group Metric Rule.
    Targets []GroupMetricRuleTargetArgs
    The information about the resource for which alerts are triggered. See targets below.
    Webhook string
    The callback URL.
    category String
    The abbreviation of the service name.
    contactGroups String
    Alarm contact group.
    dimensions String
    The dimensions that specify the resources to be associated with the alert rule.
    effectiveInterval String
    The time period during which the alert rule is effective.
    emailSubject String
    The subject of the alert notification email.
    escalations GroupMetricRuleEscalations
    Alarm level. See escalations below.
    groupId String
    The ID of the application group.
    groupMetricRuleName String
    The name of the alert rule.
    interval String
    The interval at which Cloud Monitor checks whether the alert rule is triggered. Unit: seconds.
    metricName String
    The name of the metric.
    namespace String
    The namespace of the service.
    noEffectiveInterval String
    The time period during which the alert rule is ineffective.
    period Integer
    The aggregation period of the monitoring data. Unit: seconds. The value is an integral multiple of 60. Default value: 300.
    ruleId String
    The ID of the alert rule.
    silenceTime Integer
    The mute period during which new alerts are not reported even if the alert trigger conditions are met. Unit: seconds. Default value: 86400, which is equivalent to one day.
    status String
    The status of Group Metric Rule.
    targets List<GroupMetricRuleTarget>
    The information about the resource for which alerts are triggered. See targets below.
    webhook String
    The callback URL.
    category string
    The abbreviation of the service name.
    contactGroups string
    Alarm contact group.
    dimensions string
    The dimensions that specify the resources to be associated with the alert rule.
    effectiveInterval string
    The time period during which the alert rule is effective.
    emailSubject string
    The subject of the alert notification email.
    escalations GroupMetricRuleEscalations
    Alarm level. See escalations below.
    groupId string
    The ID of the application group.
    groupMetricRuleName string
    The name of the alert rule.
    interval string
    The interval at which Cloud Monitor checks whether the alert rule is triggered. Unit: seconds.
    metricName string
    The name of the metric.
    namespace string
    The namespace of the service.
    noEffectiveInterval string
    The time period during which the alert rule is ineffective.
    period number
    The aggregation period of the monitoring data. Unit: seconds. The value is an integral multiple of 60. Default value: 300.
    ruleId string
    The ID of the alert rule.
    silenceTime number
    The mute period during which new alerts are not reported even if the alert trigger conditions are met. Unit: seconds. Default value: 86400, which is equivalent to one day.
    status string
    The status of Group Metric Rule.
    targets GroupMetricRuleTarget[]
    The information about the resource for which alerts are triggered. See targets below.
    webhook string
    The callback URL.
    category str
    The abbreviation of the service name.
    contact_groups str
    Alarm contact group.
    dimensions str
    The dimensions that specify the resources to be associated with the alert rule.
    effective_interval str
    The time period during which the alert rule is effective.
    email_subject str
    The subject of the alert notification email.
    escalations GroupMetricRuleEscalationsArgs
    Alarm level. See escalations below.
    group_id str
    The ID of the application group.
    group_metric_rule_name str
    The name of the alert rule.
    interval str
    The interval at which Cloud Monitor checks whether the alert rule is triggered. Unit: seconds.
    metric_name str
    The name of the metric.
    namespace str
    The namespace of the service.
    no_effective_interval str
    The time period during which the alert rule is ineffective.
    period int
    The aggregation period of the monitoring data. Unit: seconds. The value is an integral multiple of 60. Default value: 300.
    rule_id str
    The ID of the alert rule.
    silence_time int
    The mute period during which new alerts are not reported even if the alert trigger conditions are met. Unit: seconds. Default value: 86400, which is equivalent to one day.
    status str
    The status of Group Metric Rule.
    targets Sequence[GroupMetricRuleTargetArgs]
    The information about the resource for which alerts are triggered. See targets below.
    webhook str
    The callback URL.
    category String
    The abbreviation of the service name.
    contactGroups String
    Alarm contact group.
    dimensions String
    The dimensions that specify the resources to be associated with the alert rule.
    effectiveInterval String
    The time period during which the alert rule is effective.
    emailSubject String
    The subject of the alert notification email.
    escalations Property Map
    Alarm level. See escalations below.
    groupId String
    The ID of the application group.
    groupMetricRuleName String
    The name of the alert rule.
    interval String
    The interval at which Cloud Monitor checks whether the alert rule is triggered. Unit: seconds.
    metricName String
    The name of the metric.
    namespace String
    The namespace of the service.
    noEffectiveInterval String
    The time period during which the alert rule is ineffective.
    period Number
    The aggregation period of the monitoring data. Unit: seconds. The value is an integral multiple of 60. Default value: 300.
    ruleId String
    The ID of the alert rule.
    silenceTime Number
    The mute period during which new alerts are not reported even if the alert trigger conditions are met. Unit: seconds. Default value: 86400, which is equivalent to one day.
    status String
    The status of Group Metric Rule.
    targets List<Property Map>
    The information about the resource for which alerts are triggered. See targets below.
    webhook String
    The callback URL.

    Supporting Types

    GroupMetricRuleEscalations, GroupMetricRuleEscalationsArgs

    Critical GroupMetricRuleEscalationsCritical
    The critical level. See critical below.
    Info GroupMetricRuleEscalationsInfo
    The info level. See info below.
    Warn GroupMetricRuleEscalationsWarn
    The warn level. See warn below.
    critical GroupMetricRuleEscalationsCritical
    The critical level. See critical below.
    info GroupMetricRuleEscalationsInfo
    The info level. See info below.
    warn GroupMetricRuleEscalationsWarn
    The warn level. See warn below.
    critical GroupMetricRuleEscalationsCritical
    The critical level. See critical below.
    info GroupMetricRuleEscalationsInfo
    The info level. See info below.
    warn GroupMetricRuleEscalationsWarn
    The warn level. See warn below.
    critical GroupMetricRuleEscalationsCritical
    The critical level. See critical below.
    info GroupMetricRuleEscalationsInfo
    The info level. See info below.
    warn GroupMetricRuleEscalationsWarn
    The warn level. See warn below.
    critical Property Map
    The critical level. See critical below.
    info Property Map
    The info level. See info below.
    warn Property Map
    The warn level. See warn below.

    GroupMetricRuleEscalationsCritical, GroupMetricRuleEscalationsCriticalArgs

    ComparisonOperator string
    The comparison operator of the threshold for warn-level alerts.
    Statistics string
    The statistical aggregation method for warn-level alerts.
    Threshold string
    The threshold for warn-level alerts.
    Times int
    The consecutive number of times for which the metric value is measured before a warn-level alert is triggered.
    ComparisonOperator string
    The comparison operator of the threshold for warn-level alerts.
    Statistics string
    The statistical aggregation method for warn-level alerts.
    Threshold string
    The threshold for warn-level alerts.
    Times int
    The consecutive number of times for which the metric value is measured before a warn-level alert is triggered.
    comparisonOperator String
    The comparison operator of the threshold for warn-level alerts.
    statistics String
    The statistical aggregation method for warn-level alerts.
    threshold String
    The threshold for warn-level alerts.
    times Integer
    The consecutive number of times for which the metric value is measured before a warn-level alert is triggered.
    comparisonOperator string
    The comparison operator of the threshold for warn-level alerts.
    statistics string
    The statistical aggregation method for warn-level alerts.
    threshold string
    The threshold for warn-level alerts.
    times number
    The consecutive number of times for which the metric value is measured before a warn-level alert is triggered.
    comparison_operator str
    The comparison operator of the threshold for warn-level alerts.
    statistics str
    The statistical aggregation method for warn-level alerts.
    threshold str
    The threshold for warn-level alerts.
    times int
    The consecutive number of times for which the metric value is measured before a warn-level alert is triggered.
    comparisonOperator String
    The comparison operator of the threshold for warn-level alerts.
    statistics String
    The statistical aggregation method for warn-level alerts.
    threshold String
    The threshold for warn-level alerts.
    times Number
    The consecutive number of times for which the metric value is measured before a warn-level alert is triggered.

    GroupMetricRuleEscalationsInfo, GroupMetricRuleEscalationsInfoArgs

    ComparisonOperator string
    The comparison operator of the threshold for warn-level alerts.
    Statistics string
    The statistical aggregation method for warn-level alerts.
    Threshold string
    The threshold for warn-level alerts.
    Times int
    The consecutive number of times for which the metric value is measured before a warn-level alert is triggered.
    ComparisonOperator string
    The comparison operator of the threshold for warn-level alerts.
    Statistics string
    The statistical aggregation method for warn-level alerts.
    Threshold string
    The threshold for warn-level alerts.
    Times int
    The consecutive number of times for which the metric value is measured before a warn-level alert is triggered.
    comparisonOperator String
    The comparison operator of the threshold for warn-level alerts.
    statistics String
    The statistical aggregation method for warn-level alerts.
    threshold String
    The threshold for warn-level alerts.
    times Integer
    The consecutive number of times for which the metric value is measured before a warn-level alert is triggered.
    comparisonOperator string
    The comparison operator of the threshold for warn-level alerts.
    statistics string
    The statistical aggregation method for warn-level alerts.
    threshold string
    The threshold for warn-level alerts.
    times number
    The consecutive number of times for which the metric value is measured before a warn-level alert is triggered.
    comparison_operator str
    The comparison operator of the threshold for warn-level alerts.
    statistics str
    The statistical aggregation method for warn-level alerts.
    threshold str
    The threshold for warn-level alerts.
    times int
    The consecutive number of times for which the metric value is measured before a warn-level alert is triggered.
    comparisonOperator String
    The comparison operator of the threshold for warn-level alerts.
    statistics String
    The statistical aggregation method for warn-level alerts.
    threshold String
    The threshold for warn-level alerts.
    times Number
    The consecutive number of times for which the metric value is measured before a warn-level alert is triggered.

    GroupMetricRuleEscalationsWarn, GroupMetricRuleEscalationsWarnArgs

    ComparisonOperator string
    The comparison operator of the threshold for warn-level alerts.
    Statistics string
    The statistical aggregation method for warn-level alerts.
    Threshold string
    The threshold for warn-level alerts.
    Times int
    The consecutive number of times for which the metric value is measured before a warn-level alert is triggered.
    ComparisonOperator string
    The comparison operator of the threshold for warn-level alerts.
    Statistics string
    The statistical aggregation method for warn-level alerts.
    Threshold string
    The threshold for warn-level alerts.
    Times int
    The consecutive number of times for which the metric value is measured before a warn-level alert is triggered.
    comparisonOperator String
    The comparison operator of the threshold for warn-level alerts.
    statistics String
    The statistical aggregation method for warn-level alerts.
    threshold String
    The threshold for warn-level alerts.
    times Integer
    The consecutive number of times for which the metric value is measured before a warn-level alert is triggered.
    comparisonOperator string
    The comparison operator of the threshold for warn-level alerts.
    statistics string
    The statistical aggregation method for warn-level alerts.
    threshold string
    The threshold for warn-level alerts.
    times number
    The consecutive number of times for which the metric value is measured before a warn-level alert is triggered.
    comparison_operator str
    The comparison operator of the threshold for warn-level alerts.
    statistics str
    The statistical aggregation method for warn-level alerts.
    threshold str
    The threshold for warn-level alerts.
    times int
    The consecutive number of times for which the metric value is measured before a warn-level alert is triggered.
    comparisonOperator String
    The comparison operator of the threshold for warn-level alerts.
    statistics String
    The statistical aggregation method for warn-level alerts.
    threshold String
    The threshold for warn-level alerts.
    times Number
    The consecutive number of times for which the metric value is measured before a warn-level alert is triggered.

    GroupMetricRuleTarget, GroupMetricRuleTargetArgs

    Arn string

    The Alibaba Cloud Resource Name (ARN) of the resource.

    NOTE: Currently, the Alibaba Cloud Resource Name (ARN) of the resource. To use, please submit an application.

    Id string
    The ID of the resource for which alerts are triggered.
    JsonParams string
    The parameters of the alert callback. The parameters are in the JSON format.
    Level string
    The level of the alert. Valid values: Critical, Warn, Info.
    Arn string

    The Alibaba Cloud Resource Name (ARN) of the resource.

    NOTE: Currently, the Alibaba Cloud Resource Name (ARN) of the resource. To use, please submit an application.

    Id string
    The ID of the resource for which alerts are triggered.
    JsonParams string
    The parameters of the alert callback. The parameters are in the JSON format.
    Level string
    The level of the alert. Valid values: Critical, Warn, Info.
    arn String

    The Alibaba Cloud Resource Name (ARN) of the resource.

    NOTE: Currently, the Alibaba Cloud Resource Name (ARN) of the resource. To use, please submit an application.

    id String
    The ID of the resource for which alerts are triggered.
    jsonParams String
    The parameters of the alert callback. The parameters are in the JSON format.
    level String
    The level of the alert. Valid values: Critical, Warn, Info.
    arn string

    The Alibaba Cloud Resource Name (ARN) of the resource.

    NOTE: Currently, the Alibaba Cloud Resource Name (ARN) of the resource. To use, please submit an application.

    id string
    The ID of the resource for which alerts are triggered.
    jsonParams string
    The parameters of the alert callback. The parameters are in the JSON format.
    level string
    The level of the alert. Valid values: Critical, Warn, Info.
    arn str

    The Alibaba Cloud Resource Name (ARN) of the resource.

    NOTE: Currently, the Alibaba Cloud Resource Name (ARN) of the resource. To use, please submit an application.

    id str
    The ID of the resource for which alerts are triggered.
    json_params str
    The parameters of the alert callback. The parameters are in the JSON format.
    level str
    The level of the alert. Valid values: Critical, Warn, Info.
    arn String

    The Alibaba Cloud Resource Name (ARN) of the resource.

    NOTE: Currently, the Alibaba Cloud Resource Name (ARN) of the resource. To use, please submit an application.

    id String
    The ID of the resource for which alerts are triggered.
    jsonParams String
    The parameters of the alert callback. The parameters are in the JSON format.
    level String
    The level of the alert. Valid values: Critical, Warn, Info.

    Import

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

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

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

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi