1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. cms
  5. Alarm
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

alicloud.cms.Alarm

Explore with Pulumi AI

Provides a Cloud Monitor Service Alarm resource.

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

NOTE: Available since v1.9.1.

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 = alicloud.getZones({
    availableDiskCategory: "cloud_efficiency",
    availableResourceCreation: "VSwitch",
});
const defaultGetImages = alicloud.ecs.getImages({
    mostRecent: true,
    owners: "system",
});
const defaultGetInstanceTypes = Promise.all([_default, defaultGetImages]).then(([_default, defaultGetImages]) => alicloud.ecs.getInstanceTypes({
    availabilityZone: _default.zones?.[0]?.id,
    imageId: defaultGetImages.images?.[0]?.id,
}));
const defaultNetwork = new alicloud.vpc.Network("default", {
    vpcName: name,
    cidrBlock: "10.4.0.0/16",
});
const defaultSwitch = new alicloud.vpc.Switch("default", {
    vswitchName: name,
    cidrBlock: "10.4.0.0/24",
    vpcId: defaultNetwork.id,
    zoneId: _default.then(_default => _default.zones?.[0]?.id),
});
const defaultSecurityGroup = new alicloud.ecs.SecurityGroup("default", {
    name: name,
    vpcId: defaultNetwork.id,
});
const defaultInstance = new alicloud.ecs.Instance("default", {
    availabilityZone: _default.then(_default => _default.zones?.[0]?.id),
    instanceName: name,
    imageId: defaultGetImages.then(defaultGetImages => defaultGetImages.images?.[0]?.id),
    instanceType: defaultGetInstanceTypes.then(defaultGetInstanceTypes => defaultGetInstanceTypes.instanceTypes?.[0]?.id),
    securityGroups: [defaultSecurityGroup.id],
    vswitchId: defaultSwitch.id,
});
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,
    contactGroups: [defaultAlarmContactGroup.alarmContactGroupName],
    effectiveInterval: "06:00-20:00",
    metricDimensions: pulumi.interpolate`  [
    {
      "instanceId": "${defaultInstance.id}",
      "device": "/dev/vda1"
    }
  ]
`,
    escalationsCritical: {
        statistics: "Average",
        comparisonOperator: "<=",
        threshold: "35",
        times: 2,
    },
});
Copy
import pulumi
import pulumi_alicloud as alicloud

config = pulumi.Config()
name = config.get("name")
if name is None:
    name = "tf-example"
default = alicloud.get_zones(available_disk_category="cloud_efficiency",
    available_resource_creation="VSwitch")
default_get_images = alicloud.ecs.get_images(most_recent=True,
    owners="system")
default_get_instance_types = alicloud.ecs.get_instance_types(availability_zone=default.zones[0].id,
    image_id=default_get_images.images[0].id)
default_network = alicloud.vpc.Network("default",
    vpc_name=name,
    cidr_block="10.4.0.0/16")
default_switch = alicloud.vpc.Switch("default",
    vswitch_name=name,
    cidr_block="10.4.0.0/24",
    vpc_id=default_network.id,
    zone_id=default.zones[0].id)
default_security_group = alicloud.ecs.SecurityGroup("default",
    name=name,
    vpc_id=default_network.id)
default_instance = alicloud.ecs.Instance("default",
    availability_zone=default.zones[0].id,
    instance_name=name,
    image_id=default_get_images.images[0].id,
    instance_type=default_get_instance_types.instance_types[0].id,
    security_groups=[default_security_group.id],
    vswitch_id=default_switch.id)
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,
    contact_groups=[default_alarm_contact_group.alarm_contact_group_name],
    effective_interval="06:00-20:00",
    metric_dimensions=default_instance.id.apply(lambda id: f"""  [
    {{
      "instanceId": "{id}",
      "device": "/dev/vda1"
    }}
  ]
"""),
    escalations_critical={
        "statistics": "Average",
        "comparison_operator": "<=",
        "threshold": "35",
        "times": 2,
    })
Copy
package main

import (
	"fmt"

	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud"
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/cms"
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ecs"
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vpc"
	"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
		}
		_default, err := alicloud.GetZones(ctx, &alicloud.GetZonesArgs{
			AvailableDiskCategory:     pulumi.StringRef("cloud_efficiency"),
			AvailableResourceCreation: pulumi.StringRef("VSwitch"),
		}, nil)
		if err != nil {
			return err
		}
		defaultGetImages, err := ecs.GetImages(ctx, &ecs.GetImagesArgs{
			MostRecent: pulumi.BoolRef(true),
			Owners:     pulumi.StringRef("system"),
		}, nil)
		if err != nil {
			return err
		}
		defaultGetInstanceTypes, err := ecs.GetInstanceTypes(ctx, &ecs.GetInstanceTypesArgs{
			AvailabilityZone: pulumi.StringRef(_default.Zones[0].Id),
			ImageId:          pulumi.StringRef(defaultGetImages.Images[0].Id),
		}, nil)
		if err != nil {
			return err
		}
		defaultNetwork, err := vpc.NewNetwork(ctx, "default", &vpc.NetworkArgs{
			VpcName:   pulumi.String(name),
			CidrBlock: pulumi.String("10.4.0.0/16"),
		})
		if err != nil {
			return err
		}
		defaultSwitch, err := vpc.NewSwitch(ctx, "default", &vpc.SwitchArgs{
			VswitchName: pulumi.String(name),
			CidrBlock:   pulumi.String("10.4.0.0/24"),
			VpcId:       defaultNetwork.ID(),
			ZoneId:      pulumi.String(_default.Zones[0].Id),
		})
		if err != nil {
			return err
		}
		defaultSecurityGroup, err := ecs.NewSecurityGroup(ctx, "default", &ecs.SecurityGroupArgs{
			Name:  pulumi.String(name),
			VpcId: defaultNetwork.ID(),
		})
		if err != nil {
			return err
		}
		defaultInstance, err := ecs.NewInstance(ctx, "default", &ecs.InstanceArgs{
			AvailabilityZone: pulumi.String(_default.Zones[0].Id),
			InstanceName:     pulumi.String(name),
			ImageId:          pulumi.String(defaultGetImages.Images[0].Id),
			InstanceType:     pulumi.String(defaultGetInstanceTypes.InstanceTypes[0].Id),
			SecurityGroups: pulumi.StringArray{
				defaultSecurityGroup.ID(),
			},
			VswitchId: defaultSwitch.ID(),
		})
		if err != nil {
			return err
		}
		defaultAlarmContactGroup, err := cms.NewAlarmContactGroup(ctx, "default", &cms.AlarmContactGroupArgs{
			AlarmContactGroupName: pulumi.String(name),
		})
		if err != nil {
			return err
		}
		_, 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),
			ContactGroups: pulumi.StringArray{
				defaultAlarmContactGroup.AlarmContactGroupName,
			},
			EffectiveInterval: pulumi.String("06:00-20:00"),
			MetricDimensions: defaultInstance.ID().ApplyT(func(id string) (string, error) {
				return fmt.Sprintf(`  [
    {
      "instanceId": "%v",
      "device": "/dev/vda1"
    }
  ]
`, id), nil
			}).(pulumi.StringOutput),
			EscalationsCritical: &cms.AlarmEscalationsCriticalArgs{
				Statistics:         pulumi.String("Average"),
				ComparisonOperator: pulumi.String("<="),
				Threshold:          pulumi.String("35"),
				Times:              pulumi.Int(2),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
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 = AliCloud.GetZones.Invoke(new()
    {
        AvailableDiskCategory = "cloud_efficiency",
        AvailableResourceCreation = "VSwitch",
    });

    var defaultGetImages = AliCloud.Ecs.GetImages.Invoke(new()
    {
        MostRecent = true,
        Owners = "system",
    });

    var defaultGetInstanceTypes = AliCloud.Ecs.GetInstanceTypes.Invoke(new()
    {
        AvailabilityZone = @default.Apply(getZonesResult => getZonesResult.Zones[0]?.Id),
        ImageId = defaultGetImages.Apply(getImagesResult => getImagesResult.Images[0]?.Id),
    });

    var defaultNetwork = new AliCloud.Vpc.Network("default", new()
    {
        VpcName = name,
        CidrBlock = "10.4.0.0/16",
    });

    var defaultSwitch = new AliCloud.Vpc.Switch("default", new()
    {
        VswitchName = name,
        CidrBlock = "10.4.0.0/24",
        VpcId = defaultNetwork.Id,
        ZoneId = @default.Apply(@default => @default.Apply(getZonesResult => getZonesResult.Zones[0]?.Id)),
    });

    var defaultSecurityGroup = new AliCloud.Ecs.SecurityGroup("default", new()
    {
        Name = name,
        VpcId = defaultNetwork.Id,
    });

    var defaultInstance = new AliCloud.Ecs.Instance("default", new()
    {
        AvailabilityZone = @default.Apply(@default => @default.Apply(getZonesResult => getZonesResult.Zones[0]?.Id)),
        InstanceName = name,
        ImageId = defaultGetImages.Apply(getImagesResult => getImagesResult.Images[0]?.Id),
        InstanceType = defaultGetInstanceTypes.Apply(getInstanceTypesResult => getInstanceTypesResult.InstanceTypes[0]?.Id),
        SecurityGroups = new[]
        {
            defaultSecurityGroup.Id,
        },
        VswitchId = defaultSwitch.Id,
    });

    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,
        ContactGroups = new[]
        {
            defaultAlarmContactGroup.AlarmContactGroupName,
        },
        EffectiveInterval = "06:00-20:00",
        MetricDimensions = defaultInstance.Id.Apply(id => @$"  [
    {{
      ""instanceId"": ""{id}"",
      ""device"": ""/dev/vda1""
    }}
  ]
"),
        EscalationsCritical = new AliCloud.Cms.Inputs.AlarmEscalationsCriticalArgs
        {
            Statistics = "Average",
            ComparisonOperator = "<=",
            Threshold = "35",
            Times = 2,
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.AlicloudFunctions;
import com.pulumi.alicloud.inputs.GetZonesArgs;
import com.pulumi.alicloud.ecs.EcsFunctions;
import com.pulumi.alicloud.ecs.inputs.GetImagesArgs;
import com.pulumi.alicloud.ecs.inputs.GetInstanceTypesArgs;
import com.pulumi.alicloud.vpc.Network;
import com.pulumi.alicloud.vpc.NetworkArgs;
import com.pulumi.alicloud.vpc.Switch;
import com.pulumi.alicloud.vpc.SwitchArgs;
import com.pulumi.alicloud.ecs.SecurityGroup;
import com.pulumi.alicloud.ecs.SecurityGroupArgs;
import com.pulumi.alicloud.ecs.Instance;
import com.pulumi.alicloud.ecs.InstanceArgs;
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 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");
        final var default = AlicloudFunctions.getZones(GetZonesArgs.builder()
            .availableDiskCategory("cloud_efficiency")
            .availableResourceCreation("VSwitch")
            .build());

        final var defaultGetImages = EcsFunctions.getImages(GetImagesArgs.builder()
            .mostRecent(true)
            .owners("system")
            .build());

        final var defaultGetInstanceTypes = EcsFunctions.getInstanceTypes(GetInstanceTypesArgs.builder()
            .availabilityZone(default_.zones()[0].id())
            .imageId(defaultGetImages.applyValue(getImagesResult -> getImagesResult.images()[0].id()))
            .build());

        var defaultNetwork = new Network("defaultNetwork", NetworkArgs.builder()
            .vpcName(name)
            .cidrBlock("10.4.0.0/16")
            .build());

        var defaultSwitch = new Switch("defaultSwitch", SwitchArgs.builder()
            .vswitchName(name)
            .cidrBlock("10.4.0.0/24")
            .vpcId(defaultNetwork.id())
            .zoneId(default_.zones()[0].id())
            .build());

        var defaultSecurityGroup = new SecurityGroup("defaultSecurityGroup", SecurityGroupArgs.builder()
            .name(name)
            .vpcId(defaultNetwork.id())
            .build());

        var defaultInstance = new Instance("defaultInstance", InstanceArgs.builder()
            .availabilityZone(default_.zones()[0].id())
            .instanceName(name)
            .imageId(defaultGetImages.applyValue(getImagesResult -> getImagesResult.images()[0].id()))
            .instanceType(defaultGetInstanceTypes.applyValue(getInstanceTypesResult -> getInstanceTypesResult.instanceTypes()[0].id()))
            .securityGroups(defaultSecurityGroup.id())
            .vswitchId(defaultSwitch.id())
            .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)
            .contactGroups(defaultAlarmContactGroup.alarmContactGroupName())
            .effectiveInterval("06:00-20:00")
            .metricDimensions(defaultInstance.id().applyValue(id -> """
  [
    {
      "instanceId": "%s",
      "device": "/dev/vda1"
    }
  ]
", id)))
            .escalationsCritical(AlarmEscalationsCriticalArgs.builder()
                .statistics("Average")
                .comparisonOperator("<=")
                .threshold(35)
                .times(2)
                .build())
            .build());

    }
}
Copy
configuration:
  name:
    type: string
    default: tf-example
resources:
  defaultNetwork:
    type: alicloud:vpc:Network
    name: default
    properties:
      vpcName: ${name}
      cidrBlock: 10.4.0.0/16
  defaultSwitch:
    type: alicloud:vpc:Switch
    name: default
    properties:
      vswitchName: ${name}
      cidrBlock: 10.4.0.0/24
      vpcId: ${defaultNetwork.id}
      zoneId: ${default.zones[0].id}
  defaultSecurityGroup:
    type: alicloud:ecs:SecurityGroup
    name: default
    properties:
      name: ${name}
      vpcId: ${defaultNetwork.id}
  defaultInstance:
    type: alicloud:ecs:Instance
    name: default
    properties:
      availabilityZone: ${default.zones[0].id}
      instanceName: ${name}
      imageId: ${defaultGetImages.images[0].id}
      instanceType: ${defaultGetInstanceTypes.instanceTypes[0].id}
      securityGroups:
        - ${defaultSecurityGroup.id}
      vswitchId: ${defaultSwitch.id}
  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
      contactGroups:
        - ${defaultAlarmContactGroup.alarmContactGroupName}
      effectiveInterval: 06:00-20:00
      metricDimensions: |2
          [
            {
              "instanceId": "${defaultInstance.id}",
              "device": "/dev/vda1"
            }
          ]
      escalationsCritical:
        statistics: Average
        comparisonOperator: <=
        threshold: 35
        times: 2
variables:
  default:
    fn::invoke:
      function: alicloud:getZones
      arguments:
        availableDiskCategory: cloud_efficiency
        availableResourceCreation: VSwitch
  defaultGetImages:
    fn::invoke:
      function: alicloud:ecs:getImages
      arguments:
        mostRecent: true
        owners: system
  defaultGetInstanceTypes:
    fn::invoke:
      function: alicloud:ecs:getInstanceTypes
      arguments:
        availabilityZone: ${default.zones[0].id}
        imageId: ${defaultGetImages.images[0].id}
Copy

Create Alarm Resource

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

Constructor syntax

new Alarm(name: string, args: AlarmArgs, opts?: CustomResourceOptions);
@overload
def Alarm(resource_name: str,
          args: AlarmArgs,
          opts: Optional[ResourceOptions] = None)

@overload
def Alarm(resource_name: str,
          opts: Optional[ResourceOptions] = None,
          metric: Optional[str] = None,
          contact_groups: Optional[Sequence[str]] = None,
          project: Optional[str] = None,
          metric_dimensions: Optional[str] = None,
          period: Optional[int] = None,
          end_time: Optional[int] = None,
          escalations_critical: Optional[AlarmEscalationsCriticalArgs] = None,
          escalations_info: Optional[AlarmEscalationsInfoArgs] = None,
          escalations_warn: Optional[AlarmEscalationsWarnArgs] = None,
          effective_interval: Optional[str] = None,
          composite_expression: Optional[AlarmCompositeExpressionArgs] = None,
          name: Optional[str] = None,
          enabled: Optional[bool] = None,
          dimensions: Optional[Mapping[str, str]] = None,
          prometheuses: Optional[Sequence[AlarmPrometheusArgs]] = None,
          silence_time: Optional[int] = None,
          start_time: Optional[int] = None,
          tags: Optional[Mapping[str, str]] = None,
          targets: Optional[Sequence[AlarmTargetArgs]] = None,
          webhook: Optional[str] = None)
func NewAlarm(ctx *Context, name string, args AlarmArgs, opts ...ResourceOption) (*Alarm, error)
public Alarm(string name, AlarmArgs args, CustomResourceOptions? opts = null)
public Alarm(String name, AlarmArgs args)
public Alarm(String name, AlarmArgs args, CustomResourceOptions options)
type: alicloud:cms:Alarm
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. AlarmArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. AlarmArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. AlarmArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. AlarmArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. AlarmArgs
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 alarmResource = new AliCloud.Cms.Alarm("alarmResource", new()
{
    Metric = "string",
    ContactGroups = new[]
    {
        "string",
    },
    Project = "string",
    MetricDimensions = "string",
    Period = 0,
    EscalationsCritical = new AliCloud.Cms.Inputs.AlarmEscalationsCriticalArgs
    {
        ComparisonOperator = "string",
        Statistics = "string",
        Threshold = "string",
        Times = 0,
    },
    EscalationsInfo = new AliCloud.Cms.Inputs.AlarmEscalationsInfoArgs
    {
        ComparisonOperator = "string",
        Statistics = "string",
        Threshold = "string",
        Times = 0,
    },
    EscalationsWarn = new AliCloud.Cms.Inputs.AlarmEscalationsWarnArgs
    {
        ComparisonOperator = "string",
        Statistics = "string",
        Threshold = "string",
        Times = 0,
    },
    EffectiveInterval = "string",
    CompositeExpression = new AliCloud.Cms.Inputs.AlarmCompositeExpressionArgs
    {
        ExpressionListJoin = "string",
        ExpressionLists = new[]
        {
            new AliCloud.Cms.Inputs.AlarmCompositeExpressionExpressionListArgs
            {
                ComparisonOperator = "string",
                MetricName = "string",
                Period = "string",
                Statistics = "string",
                Threshold = "string",
            },
        },
        ExpressionRaw = "string",
        Level = "string",
        Times = 0,
    },
    Name = "string",
    Enabled = false,
    Prometheuses = new[]
    {
        new AliCloud.Cms.Inputs.AlarmPrometheusArgs
        {
            Annotations = 
            {
                { "string", "string" },
            },
            Level = "string",
            PromQl = "string",
            Times = 0,
        },
    },
    SilenceTime = 0,
    Tags = 
    {
        { "string", "string" },
    },
    Targets = new[]
    {
        new AliCloud.Cms.Inputs.AlarmTargetArgs
        {
            Arn = "string",
            JsonParams = "string",
            Level = "string",
            TargetId = "string",
        },
    },
    Webhook = "string",
});
Copy
example, err := cms.NewAlarm(ctx, "alarmResource", &cms.AlarmArgs{
	Metric: pulumi.String("string"),
	ContactGroups: pulumi.StringArray{
		pulumi.String("string"),
	},
	Project:          pulumi.String("string"),
	MetricDimensions: pulumi.String("string"),
	Period:           pulumi.Int(0),
	EscalationsCritical: &cms.AlarmEscalationsCriticalArgs{
		ComparisonOperator: pulumi.String("string"),
		Statistics:         pulumi.String("string"),
		Threshold:          pulumi.String("string"),
		Times:              pulumi.Int(0),
	},
	EscalationsInfo: &cms.AlarmEscalationsInfoArgs{
		ComparisonOperator: pulumi.String("string"),
		Statistics:         pulumi.String("string"),
		Threshold:          pulumi.String("string"),
		Times:              pulumi.Int(0),
	},
	EscalationsWarn: &cms.AlarmEscalationsWarnArgs{
		ComparisonOperator: pulumi.String("string"),
		Statistics:         pulumi.String("string"),
		Threshold:          pulumi.String("string"),
		Times:              pulumi.Int(0),
	},
	EffectiveInterval: pulumi.String("string"),
	CompositeExpression: &cms.AlarmCompositeExpressionArgs{
		ExpressionListJoin: pulumi.String("string"),
		ExpressionLists: cms.AlarmCompositeExpressionExpressionListArray{
			&cms.AlarmCompositeExpressionExpressionListArgs{
				ComparisonOperator: pulumi.String("string"),
				MetricName:         pulumi.String("string"),
				Period:             pulumi.String("string"),
				Statistics:         pulumi.String("string"),
				Threshold:          pulumi.String("string"),
			},
		},
		ExpressionRaw: pulumi.String("string"),
		Level:         pulumi.String("string"),
		Times:         pulumi.Int(0),
	},
	Name:    pulumi.String("string"),
	Enabled: pulumi.Bool(false),
	Prometheuses: cms.AlarmPrometheusArray{
		&cms.AlarmPrometheusArgs{
			Annotations: pulumi.StringMap{
				"string": pulumi.String("string"),
			},
			Level:  pulumi.String("string"),
			PromQl: pulumi.String("string"),
			Times:  pulumi.Int(0),
		},
	},
	SilenceTime: pulumi.Int(0),
	Tags: pulumi.StringMap{
		"string": pulumi.String("string"),
	},
	Targets: cms.AlarmTargetArray{
		&cms.AlarmTargetArgs{
			Arn:        pulumi.String("string"),
			JsonParams: pulumi.String("string"),
			Level:      pulumi.String("string"),
			TargetId:   pulumi.String("string"),
		},
	},
	Webhook: pulumi.String("string"),
})
Copy
var alarmResource = new Alarm("alarmResource", AlarmArgs.builder()
    .metric("string")
    .contactGroups("string")
    .project("string")
    .metricDimensions("string")
    .period(0)
    .escalationsCritical(AlarmEscalationsCriticalArgs.builder()
        .comparisonOperator("string")
        .statistics("string")
        .threshold("string")
        .times(0)
        .build())
    .escalationsInfo(AlarmEscalationsInfoArgs.builder()
        .comparisonOperator("string")
        .statistics("string")
        .threshold("string")
        .times(0)
        .build())
    .escalationsWarn(AlarmEscalationsWarnArgs.builder()
        .comparisonOperator("string")
        .statistics("string")
        .threshold("string")
        .times(0)
        .build())
    .effectiveInterval("string")
    .compositeExpression(AlarmCompositeExpressionArgs.builder()
        .expressionListJoin("string")
        .expressionLists(AlarmCompositeExpressionExpressionListArgs.builder()
            .comparisonOperator("string")
            .metricName("string")
            .period("string")
            .statistics("string")
            .threshold("string")
            .build())
        .expressionRaw("string")
        .level("string")
        .times(0)
        .build())
    .name("string")
    .enabled(false)
    .prometheuses(AlarmPrometheusArgs.builder()
        .annotations(Map.of("string", "string"))
        .level("string")
        .promQl("string")
        .times(0)
        .build())
    .silenceTime(0)
    .tags(Map.of("string", "string"))
    .targets(AlarmTargetArgs.builder()
        .arn("string")
        .jsonParams("string")
        .level("string")
        .targetId("string")
        .build())
    .webhook("string")
    .build());
Copy
alarm_resource = alicloud.cms.Alarm("alarmResource",
    metric="string",
    contact_groups=["string"],
    project="string",
    metric_dimensions="string",
    period=0,
    escalations_critical={
        "comparison_operator": "string",
        "statistics": "string",
        "threshold": "string",
        "times": 0,
    },
    escalations_info={
        "comparison_operator": "string",
        "statistics": "string",
        "threshold": "string",
        "times": 0,
    },
    escalations_warn={
        "comparison_operator": "string",
        "statistics": "string",
        "threshold": "string",
        "times": 0,
    },
    effective_interval="string",
    composite_expression={
        "expression_list_join": "string",
        "expression_lists": [{
            "comparison_operator": "string",
            "metric_name": "string",
            "period": "string",
            "statistics": "string",
            "threshold": "string",
        }],
        "expression_raw": "string",
        "level": "string",
        "times": 0,
    },
    name="string",
    enabled=False,
    prometheuses=[{
        "annotations": {
            "string": "string",
        },
        "level": "string",
        "prom_ql": "string",
        "times": 0,
    }],
    silence_time=0,
    tags={
        "string": "string",
    },
    targets=[{
        "arn": "string",
        "json_params": "string",
        "level": "string",
        "target_id": "string",
    }],
    webhook="string")
Copy
const alarmResource = new alicloud.cms.Alarm("alarmResource", {
    metric: "string",
    contactGroups: ["string"],
    project: "string",
    metricDimensions: "string",
    period: 0,
    escalationsCritical: {
        comparisonOperator: "string",
        statistics: "string",
        threshold: "string",
        times: 0,
    },
    escalationsInfo: {
        comparisonOperator: "string",
        statistics: "string",
        threshold: "string",
        times: 0,
    },
    escalationsWarn: {
        comparisonOperator: "string",
        statistics: "string",
        threshold: "string",
        times: 0,
    },
    effectiveInterval: "string",
    compositeExpression: {
        expressionListJoin: "string",
        expressionLists: [{
            comparisonOperator: "string",
            metricName: "string",
            period: "string",
            statistics: "string",
            threshold: "string",
        }],
        expressionRaw: "string",
        level: "string",
        times: 0,
    },
    name: "string",
    enabled: false,
    prometheuses: [{
        annotations: {
            string: "string",
        },
        level: "string",
        promQl: "string",
        times: 0,
    }],
    silenceTime: 0,
    tags: {
        string: "string",
    },
    targets: [{
        arn: "string",
        jsonParams: "string",
        level: "string",
        targetId: "string",
    }],
    webhook: "string",
});
Copy
type: alicloud:cms:Alarm
properties:
    compositeExpression:
        expressionListJoin: string
        expressionLists:
            - comparisonOperator: string
              metricName: string
              period: string
              statistics: string
              threshold: string
        expressionRaw: string
        level: string
        times: 0
    contactGroups:
        - string
    effectiveInterval: string
    enabled: false
    escalationsCritical:
        comparisonOperator: string
        statistics: string
        threshold: string
        times: 0
    escalationsInfo:
        comparisonOperator: string
        statistics: string
        threshold: string
        times: 0
    escalationsWarn:
        comparisonOperator: string
        statistics: string
        threshold: string
        times: 0
    metric: string
    metricDimensions: string
    name: string
    period: 0
    project: string
    prometheuses:
        - annotations:
            string: string
          level: string
          promQl: string
          times: 0
    silenceTime: 0
    tags:
        string: string
    targets:
        - arn: string
          jsonParams: string
          level: string
          targetId: string
    webhook: string
Copy

Alarm 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 Alarm resource accepts the following input properties:

ContactGroups This property is required. List<string>
List contact groups of the alarm rule, which must have been created on the console.
Metric
This property is required.
Changes to this property will trigger replacement.
string
The name of the metric, such as CPUUtilization and networkin_rate. For more information, see Metrics Reference.
Project
This property is required.
Changes to this property will trigger replacement.
string
The namespace of the cloud service, such as acs_ecs_dashboard and acs_rds_dashboard. For more information, see Metrics Reference. NOTE: The dimensions and metric_dimensions must be empty when project is acs_prometheus, otherwise, one of them must be set.
CompositeExpression Pulumi.AliCloud.Cms.Inputs.AlarmCompositeExpression
The trigger conditions for multiple metrics. See composite_expression below.
Dimensions Dictionary<string, string>
Field dimensions has been deprecated from provider version 1.173.0. New field metric_dimensions instead.

Deprecated: Field dimensions has been deprecated from provider version 1.173.0. New field metric_dimensions instead.

EffectiveInterval string
The interval of effecting alarm rule. It format as "hh:mm-hh:mm", like "0:00-4:00". Default value: 00:00-23:59.
Enabled bool
Whether to enable alarm rule. Default value: true.
EndTime int
Field end_time has been deprecated from provider version 1.50.0. New field effective_interval instead.

Deprecated: Field end_time has been deprecated from provider version 1.50.0. New field effective_interval instead.

EscalationsCritical Pulumi.AliCloud.Cms.Inputs.AlarmEscalationsCritical
A configuration of critical alarm. See escalations_critical below.
EscalationsInfo Pulumi.AliCloud.Cms.Inputs.AlarmEscalationsInfo
A configuration of critical info. See escalations_info below.
EscalationsWarn Pulumi.AliCloud.Cms.Inputs.AlarmEscalationsWarn
A configuration of critical warn. See escalations_warn below.
MetricDimensions string
Map of the resources associated with the alarm rule, such as "instanceId", "device" and "port". Each key's value is a string, and it uses comma to split multiple items. For more information, see Metrics Reference.
Name string
The name of the alert rule.
Period int
The statistical period of the metric. Unit: seconds. Default value: 300.
Prometheuses List<Pulumi.AliCloud.Cms.Inputs.AlarmPrometheus>
The Prometheus alert rule. See prometheus below. Note: This parameter is required only when you create a Prometheus alert rule for Hybrid Cloud Monitoring.
SilenceTime int
Notification silence period in the alarm state, in seconds. Default value: 86400. Valid value range: [300, 86400].
StartTime int
Field start_time has been deprecated from provider version 1.50.0. New field effective_interval instead.

Deprecated: Field start_time has been deprecated from provider version 1.50.0. New field effective_interval instead.

Tags Dictionary<string, string>
A mapping of tags to assign to the resource.
Targets List<Pulumi.AliCloud.Cms.Inputs.AlarmTarget>
Adds or modifies the push channels of an alert rule. See targets below.
Webhook string
The webhook that should be called when the alarm is triggered. Currently, only http protocol is supported. Default is empty string.
ContactGroups This property is required. []string
List contact groups of the alarm rule, which must have been created on the console.
Metric
This property is required.
Changes to this property will trigger replacement.
string
The name of the metric, such as CPUUtilization and networkin_rate. For more information, see Metrics Reference.
Project
This property is required.
Changes to this property will trigger replacement.
string
The namespace of the cloud service, such as acs_ecs_dashboard and acs_rds_dashboard. For more information, see Metrics Reference. NOTE: The dimensions and metric_dimensions must be empty when project is acs_prometheus, otherwise, one of them must be set.
CompositeExpression AlarmCompositeExpressionArgs
The trigger conditions for multiple metrics. See composite_expression below.
Dimensions map[string]string
Field dimensions has been deprecated from provider version 1.173.0. New field metric_dimensions instead.

Deprecated: Field dimensions has been deprecated from provider version 1.173.0. New field metric_dimensions instead.

EffectiveInterval string
The interval of effecting alarm rule. It format as "hh:mm-hh:mm", like "0:00-4:00". Default value: 00:00-23:59.
Enabled bool
Whether to enable alarm rule. Default value: true.
EndTime int
Field end_time has been deprecated from provider version 1.50.0. New field effective_interval instead.

Deprecated: Field end_time has been deprecated from provider version 1.50.0. New field effective_interval instead.

EscalationsCritical AlarmEscalationsCriticalArgs
A configuration of critical alarm. See escalations_critical below.
EscalationsInfo AlarmEscalationsInfoArgs
A configuration of critical info. See escalations_info below.
EscalationsWarn AlarmEscalationsWarnArgs
A configuration of critical warn. See escalations_warn below.
MetricDimensions string
Map of the resources associated with the alarm rule, such as "instanceId", "device" and "port". Each key's value is a string, and it uses comma to split multiple items. For more information, see Metrics Reference.
Name string
The name of the alert rule.
Period int
The statistical period of the metric. Unit: seconds. Default value: 300.
Prometheuses []AlarmPrometheusArgs
The Prometheus alert rule. See prometheus below. Note: This parameter is required only when you create a Prometheus alert rule for Hybrid Cloud Monitoring.
SilenceTime int
Notification silence period in the alarm state, in seconds. Default value: 86400. Valid value range: [300, 86400].
StartTime int
Field start_time has been deprecated from provider version 1.50.0. New field effective_interval instead.

Deprecated: Field start_time has been deprecated from provider version 1.50.0. New field effective_interval instead.

Tags map[string]string
A mapping of tags to assign to the resource.
Targets []AlarmTargetArgs
Adds or modifies the push channels of an alert rule. See targets below.
Webhook string
The webhook that should be called when the alarm is triggered. Currently, only http protocol is supported. Default is empty string.
contactGroups This property is required. List<String>
List contact groups of the alarm rule, which must have been created on the console.
metric
This property is required.
Changes to this property will trigger replacement.
String
The name of the metric, such as CPUUtilization and networkin_rate. For more information, see Metrics Reference.
project
This property is required.
Changes to this property will trigger replacement.
String
The namespace of the cloud service, such as acs_ecs_dashboard and acs_rds_dashboard. For more information, see Metrics Reference. NOTE: The dimensions and metric_dimensions must be empty when project is acs_prometheus, otherwise, one of them must be set.
compositeExpression AlarmCompositeExpression
The trigger conditions for multiple metrics. See composite_expression below.
dimensions Map<String,String>
Field dimensions has been deprecated from provider version 1.173.0. New field metric_dimensions instead.

Deprecated: Field dimensions has been deprecated from provider version 1.173.0. New field metric_dimensions instead.

effectiveInterval String
The interval of effecting alarm rule. It format as "hh:mm-hh:mm", like "0:00-4:00". Default value: 00:00-23:59.
enabled Boolean
Whether to enable alarm rule. Default value: true.
endTime Integer
Field end_time has been deprecated from provider version 1.50.0. New field effective_interval instead.

Deprecated: Field end_time has been deprecated from provider version 1.50.0. New field effective_interval instead.

escalationsCritical AlarmEscalationsCritical
A configuration of critical alarm. See escalations_critical below.
escalationsInfo AlarmEscalationsInfo
A configuration of critical info. See escalations_info below.
escalationsWarn AlarmEscalationsWarn
A configuration of critical warn. See escalations_warn below.
metricDimensions String
Map of the resources associated with the alarm rule, such as "instanceId", "device" and "port". Each key's value is a string, and it uses comma to split multiple items. For more information, see Metrics Reference.
name String
The name of the alert rule.
period Integer
The statistical period of the metric. Unit: seconds. Default value: 300.
prometheuses List<AlarmPrometheus>
The Prometheus alert rule. See prometheus below. Note: This parameter is required only when you create a Prometheus alert rule for Hybrid Cloud Monitoring.
silenceTime Integer
Notification silence period in the alarm state, in seconds. Default value: 86400. Valid value range: [300, 86400].
startTime Integer
Field start_time has been deprecated from provider version 1.50.0. New field effective_interval instead.

Deprecated: Field start_time has been deprecated from provider version 1.50.0. New field effective_interval instead.

tags Map<String,String>
A mapping of tags to assign to the resource.
targets List<AlarmTarget>
Adds or modifies the push channels of an alert rule. See targets below.
webhook String
The webhook that should be called when the alarm is triggered. Currently, only http protocol is supported. Default is empty string.
contactGroups This property is required. string[]
List contact groups of the alarm rule, which must have been created on the console.
metric
This property is required.
Changes to this property will trigger replacement.
string
The name of the metric, such as CPUUtilization and networkin_rate. For more information, see Metrics Reference.
project
This property is required.
Changes to this property will trigger replacement.
string
The namespace of the cloud service, such as acs_ecs_dashboard and acs_rds_dashboard. For more information, see Metrics Reference. NOTE: The dimensions and metric_dimensions must be empty when project is acs_prometheus, otherwise, one of them must be set.
compositeExpression AlarmCompositeExpression
The trigger conditions for multiple metrics. See composite_expression below.
dimensions {[key: string]: string}
Field dimensions has been deprecated from provider version 1.173.0. New field metric_dimensions instead.

Deprecated: Field dimensions has been deprecated from provider version 1.173.0. New field metric_dimensions instead.

effectiveInterval string
The interval of effecting alarm rule. It format as "hh:mm-hh:mm", like "0:00-4:00". Default value: 00:00-23:59.
enabled boolean
Whether to enable alarm rule. Default value: true.
endTime number
Field end_time has been deprecated from provider version 1.50.0. New field effective_interval instead.

Deprecated: Field end_time has been deprecated from provider version 1.50.0. New field effective_interval instead.

escalationsCritical AlarmEscalationsCritical
A configuration of critical alarm. See escalations_critical below.
escalationsInfo AlarmEscalationsInfo
A configuration of critical info. See escalations_info below.
escalationsWarn AlarmEscalationsWarn
A configuration of critical warn. See escalations_warn below.
metricDimensions string
Map of the resources associated with the alarm rule, such as "instanceId", "device" and "port". Each key's value is a string, and it uses comma to split multiple items. For more information, see Metrics Reference.
name string
The name of the alert rule.
period number
The statistical period of the metric. Unit: seconds. Default value: 300.
prometheuses AlarmPrometheus[]
The Prometheus alert rule. See prometheus below. Note: This parameter is required only when you create a Prometheus alert rule for Hybrid Cloud Monitoring.
silenceTime number
Notification silence period in the alarm state, in seconds. Default value: 86400. Valid value range: [300, 86400].
startTime number
Field start_time has been deprecated from provider version 1.50.0. New field effective_interval instead.

Deprecated: Field start_time has been deprecated from provider version 1.50.0. New field effective_interval instead.

tags {[key: string]: string}
A mapping of tags to assign to the resource.
targets AlarmTarget[]
Adds or modifies the push channels of an alert rule. See targets below.
webhook string
The webhook that should be called when the alarm is triggered. Currently, only http protocol is supported. Default is empty string.
contact_groups This property is required. Sequence[str]
List contact groups of the alarm rule, which must have been created on the console.
metric
This property is required.
Changes to this property will trigger replacement.
str
The name of the metric, such as CPUUtilization and networkin_rate. For more information, see Metrics Reference.
project
This property is required.
Changes to this property will trigger replacement.
str
The namespace of the cloud service, such as acs_ecs_dashboard and acs_rds_dashboard. For more information, see Metrics Reference. NOTE: The dimensions and metric_dimensions must be empty when project is acs_prometheus, otherwise, one of them must be set.
composite_expression AlarmCompositeExpressionArgs
The trigger conditions for multiple metrics. See composite_expression below.
dimensions Mapping[str, str]
Field dimensions has been deprecated from provider version 1.173.0. New field metric_dimensions instead.

Deprecated: Field dimensions has been deprecated from provider version 1.173.0. New field metric_dimensions instead.

effective_interval str
The interval of effecting alarm rule. It format as "hh:mm-hh:mm", like "0:00-4:00". Default value: 00:00-23:59.
enabled bool
Whether to enable alarm rule. Default value: true.
end_time int
Field end_time has been deprecated from provider version 1.50.0. New field effective_interval instead.

Deprecated: Field end_time has been deprecated from provider version 1.50.0. New field effective_interval instead.

escalations_critical AlarmEscalationsCriticalArgs
A configuration of critical alarm. See escalations_critical below.
escalations_info AlarmEscalationsInfoArgs
A configuration of critical info. See escalations_info below.
escalations_warn AlarmEscalationsWarnArgs
A configuration of critical warn. See escalations_warn below.
metric_dimensions str
Map of the resources associated with the alarm rule, such as "instanceId", "device" and "port". Each key's value is a string, and it uses comma to split multiple items. For more information, see Metrics Reference.
name str
The name of the alert rule.
period int
The statistical period of the metric. Unit: seconds. Default value: 300.
prometheuses Sequence[AlarmPrometheusArgs]
The Prometheus alert rule. See prometheus below. Note: This parameter is required only when you create a Prometheus alert rule for Hybrid Cloud Monitoring.
silence_time int
Notification silence period in the alarm state, in seconds. Default value: 86400. Valid value range: [300, 86400].
start_time int
Field start_time has been deprecated from provider version 1.50.0. New field effective_interval instead.

Deprecated: Field start_time has been deprecated from provider version 1.50.0. New field effective_interval instead.

tags Mapping[str, str]
A mapping of tags to assign to the resource.
targets Sequence[AlarmTargetArgs]
Adds or modifies the push channels of an alert rule. See targets below.
webhook str
The webhook that should be called when the alarm is triggered. Currently, only http protocol is supported. Default is empty string.
contactGroups This property is required. List<String>
List contact groups of the alarm rule, which must have been created on the console.
metric
This property is required.
Changes to this property will trigger replacement.
String
The name of the metric, such as CPUUtilization and networkin_rate. For more information, see Metrics Reference.
project
This property is required.
Changes to this property will trigger replacement.
String
The namespace of the cloud service, such as acs_ecs_dashboard and acs_rds_dashboard. For more information, see Metrics Reference. NOTE: The dimensions and metric_dimensions must be empty when project is acs_prometheus, otherwise, one of them must be set.
compositeExpression Property Map
The trigger conditions for multiple metrics. See composite_expression below.
dimensions Map<String>
Field dimensions has been deprecated from provider version 1.173.0. New field metric_dimensions instead.

Deprecated: Field dimensions has been deprecated from provider version 1.173.0. New field metric_dimensions instead.

effectiveInterval String
The interval of effecting alarm rule. It format as "hh:mm-hh:mm", like "0:00-4:00". Default value: 00:00-23:59.
enabled Boolean
Whether to enable alarm rule. Default value: true.
endTime Number
Field end_time has been deprecated from provider version 1.50.0. New field effective_interval instead.

Deprecated: Field end_time has been deprecated from provider version 1.50.0. New field effective_interval instead.

escalationsCritical Property Map
A configuration of critical alarm. See escalations_critical below.
escalationsInfo Property Map
A configuration of critical info. See escalations_info below.
escalationsWarn Property Map
A configuration of critical warn. See escalations_warn below.
metricDimensions String
Map of the resources associated with the alarm rule, such as "instanceId", "device" and "port". Each key's value is a string, and it uses comma to split multiple items. For more information, see Metrics Reference.
name String
The name of the alert rule.
period Number
The statistical period of the metric. Unit: seconds. Default value: 300.
prometheuses List<Property Map>
The Prometheus alert rule. See prometheus below. Note: This parameter is required only when you create a Prometheus alert rule for Hybrid Cloud Monitoring.
silenceTime Number
Notification silence period in the alarm state, in seconds. Default value: 86400. Valid value range: [300, 86400].
startTime Number
Field start_time has been deprecated from provider version 1.50.0. New field effective_interval instead.

Deprecated: Field start_time has been deprecated from provider version 1.50.0. New field effective_interval instead.

tags Map<String>
A mapping of tags to assign to the resource.
targets List<Property Map>
Adds or modifies the push channels of an alert rule. See targets below.
webhook String
The webhook that should be called when the alarm is triggered. Currently, only http protocol is supported. Default is empty string.

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
Status string
The status of the Alarm.
Id string
The provider-assigned unique ID for this managed resource.
Status string
The status of the Alarm.
id String
The provider-assigned unique ID for this managed resource.
status String
The status of the Alarm.
id string
The provider-assigned unique ID for this managed resource.
status string
The status of the Alarm.
id str
The provider-assigned unique ID for this managed resource.
status str
The status of the Alarm.
id String
The provider-assigned unique ID for this managed resource.
status String
The status of the Alarm.

Look up Existing Alarm Resource

Get an existing Alarm 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?: AlarmState, opts?: CustomResourceOptions): Alarm
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        composite_expression: Optional[AlarmCompositeExpressionArgs] = None,
        contact_groups: Optional[Sequence[str]] = None,
        dimensions: Optional[Mapping[str, str]] = None,
        effective_interval: Optional[str] = None,
        enabled: Optional[bool] = None,
        end_time: Optional[int] = None,
        escalations_critical: Optional[AlarmEscalationsCriticalArgs] = None,
        escalations_info: Optional[AlarmEscalationsInfoArgs] = None,
        escalations_warn: Optional[AlarmEscalationsWarnArgs] = None,
        metric: Optional[str] = None,
        metric_dimensions: Optional[str] = None,
        name: Optional[str] = None,
        period: Optional[int] = None,
        project: Optional[str] = None,
        prometheuses: Optional[Sequence[AlarmPrometheusArgs]] = None,
        silence_time: Optional[int] = None,
        start_time: Optional[int] = None,
        status: Optional[str] = None,
        tags: Optional[Mapping[str, str]] = None,
        targets: Optional[Sequence[AlarmTargetArgs]] = None,
        webhook: Optional[str] = None) -> Alarm
func GetAlarm(ctx *Context, name string, id IDInput, state *AlarmState, opts ...ResourceOption) (*Alarm, error)
public static Alarm Get(string name, Input<string> id, AlarmState? state, CustomResourceOptions? opts = null)
public static Alarm get(String name, Output<String> id, AlarmState state, CustomResourceOptions options)
resources:  _:    type: alicloud:cms:Alarm    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
CompositeExpression Pulumi.AliCloud.Cms.Inputs.AlarmCompositeExpression
The trigger conditions for multiple metrics. See composite_expression below.
ContactGroups List<string>
List contact groups of the alarm rule, which must have been created on the console.
Dimensions Dictionary<string, string>
Field dimensions has been deprecated from provider version 1.173.0. New field metric_dimensions instead.

Deprecated: Field dimensions has been deprecated from provider version 1.173.0. New field metric_dimensions instead.

EffectiveInterval string
The interval of effecting alarm rule. It format as "hh:mm-hh:mm", like "0:00-4:00". Default value: 00:00-23:59.
Enabled bool
Whether to enable alarm rule. Default value: true.
EndTime int
Field end_time has been deprecated from provider version 1.50.0. New field effective_interval instead.

Deprecated: Field end_time has been deprecated from provider version 1.50.0. New field effective_interval instead.

EscalationsCritical Pulumi.AliCloud.Cms.Inputs.AlarmEscalationsCritical
A configuration of critical alarm. See escalations_critical below.
EscalationsInfo Pulumi.AliCloud.Cms.Inputs.AlarmEscalationsInfo
A configuration of critical info. See escalations_info below.
EscalationsWarn Pulumi.AliCloud.Cms.Inputs.AlarmEscalationsWarn
A configuration of critical warn. See escalations_warn below.
Metric Changes to this property will trigger replacement. string
The name of the metric, such as CPUUtilization and networkin_rate. For more information, see Metrics Reference.
MetricDimensions string
Map of the resources associated with the alarm rule, such as "instanceId", "device" and "port". Each key's value is a string, and it uses comma to split multiple items. For more information, see Metrics Reference.
Name string
The name of the alert rule.
Period int
The statistical period of the metric. Unit: seconds. Default value: 300.
Project Changes to this property will trigger replacement. string
The namespace of the cloud service, such as acs_ecs_dashboard and acs_rds_dashboard. For more information, see Metrics Reference. NOTE: The dimensions and metric_dimensions must be empty when project is acs_prometheus, otherwise, one of them must be set.
Prometheuses List<Pulumi.AliCloud.Cms.Inputs.AlarmPrometheus>
The Prometheus alert rule. See prometheus below. Note: This parameter is required only when you create a Prometheus alert rule for Hybrid Cloud Monitoring.
SilenceTime int
Notification silence period in the alarm state, in seconds. Default value: 86400. Valid value range: [300, 86400].
StartTime int
Field start_time has been deprecated from provider version 1.50.0. New field effective_interval instead.

Deprecated: Field start_time has been deprecated from provider version 1.50.0. New field effective_interval instead.

Status string
The status of the Alarm.
Tags Dictionary<string, string>
A mapping of tags to assign to the resource.
Targets List<Pulumi.AliCloud.Cms.Inputs.AlarmTarget>
Adds or modifies the push channels of an alert rule. See targets below.
Webhook string
The webhook that should be called when the alarm is triggered. Currently, only http protocol is supported. Default is empty string.
CompositeExpression AlarmCompositeExpressionArgs
The trigger conditions for multiple metrics. See composite_expression below.
ContactGroups []string
List contact groups of the alarm rule, which must have been created on the console.
Dimensions map[string]string
Field dimensions has been deprecated from provider version 1.173.0. New field metric_dimensions instead.

Deprecated: Field dimensions has been deprecated from provider version 1.173.0. New field metric_dimensions instead.

EffectiveInterval string
The interval of effecting alarm rule. It format as "hh:mm-hh:mm", like "0:00-4:00". Default value: 00:00-23:59.
Enabled bool
Whether to enable alarm rule. Default value: true.
EndTime int
Field end_time has been deprecated from provider version 1.50.0. New field effective_interval instead.

Deprecated: Field end_time has been deprecated from provider version 1.50.0. New field effective_interval instead.

EscalationsCritical AlarmEscalationsCriticalArgs
A configuration of critical alarm. See escalations_critical below.
EscalationsInfo AlarmEscalationsInfoArgs
A configuration of critical info. See escalations_info below.
EscalationsWarn AlarmEscalationsWarnArgs
A configuration of critical warn. See escalations_warn below.
Metric Changes to this property will trigger replacement. string
The name of the metric, such as CPUUtilization and networkin_rate. For more information, see Metrics Reference.
MetricDimensions string
Map of the resources associated with the alarm rule, such as "instanceId", "device" and "port". Each key's value is a string, and it uses comma to split multiple items. For more information, see Metrics Reference.
Name string
The name of the alert rule.
Period int
The statistical period of the metric. Unit: seconds. Default value: 300.
Project Changes to this property will trigger replacement. string
The namespace of the cloud service, such as acs_ecs_dashboard and acs_rds_dashboard. For more information, see Metrics Reference. NOTE: The dimensions and metric_dimensions must be empty when project is acs_prometheus, otherwise, one of them must be set.
Prometheuses []AlarmPrometheusArgs
The Prometheus alert rule. See prometheus below. Note: This parameter is required only when you create a Prometheus alert rule for Hybrid Cloud Monitoring.
SilenceTime int
Notification silence period in the alarm state, in seconds. Default value: 86400. Valid value range: [300, 86400].
StartTime int
Field start_time has been deprecated from provider version 1.50.0. New field effective_interval instead.

Deprecated: Field start_time has been deprecated from provider version 1.50.0. New field effective_interval instead.

Status string
The status of the Alarm.
Tags map[string]string
A mapping of tags to assign to the resource.
Targets []AlarmTargetArgs
Adds or modifies the push channels of an alert rule. See targets below.
Webhook string
The webhook that should be called when the alarm is triggered. Currently, only http protocol is supported. Default is empty string.
compositeExpression AlarmCompositeExpression
The trigger conditions for multiple metrics. See composite_expression below.
contactGroups List<String>
List contact groups of the alarm rule, which must have been created on the console.
dimensions Map<String,String>
Field dimensions has been deprecated from provider version 1.173.0. New field metric_dimensions instead.

Deprecated: Field dimensions has been deprecated from provider version 1.173.0. New field metric_dimensions instead.

effectiveInterval String
The interval of effecting alarm rule. It format as "hh:mm-hh:mm", like "0:00-4:00". Default value: 00:00-23:59.
enabled Boolean
Whether to enable alarm rule. Default value: true.
endTime Integer
Field end_time has been deprecated from provider version 1.50.0. New field effective_interval instead.

Deprecated: Field end_time has been deprecated from provider version 1.50.0. New field effective_interval instead.

escalationsCritical AlarmEscalationsCritical
A configuration of critical alarm. See escalations_critical below.
escalationsInfo AlarmEscalationsInfo
A configuration of critical info. See escalations_info below.
escalationsWarn AlarmEscalationsWarn
A configuration of critical warn. See escalations_warn below.
metric Changes to this property will trigger replacement. String
The name of the metric, such as CPUUtilization and networkin_rate. For more information, see Metrics Reference.
metricDimensions String
Map of the resources associated with the alarm rule, such as "instanceId", "device" and "port". Each key's value is a string, and it uses comma to split multiple items. For more information, see Metrics Reference.
name String
The name of the alert rule.
period Integer
The statistical period of the metric. Unit: seconds. Default value: 300.
project Changes to this property will trigger replacement. String
The namespace of the cloud service, such as acs_ecs_dashboard and acs_rds_dashboard. For more information, see Metrics Reference. NOTE: The dimensions and metric_dimensions must be empty when project is acs_prometheus, otherwise, one of them must be set.
prometheuses List<AlarmPrometheus>
The Prometheus alert rule. See prometheus below. Note: This parameter is required only when you create a Prometheus alert rule for Hybrid Cloud Monitoring.
silenceTime Integer
Notification silence period in the alarm state, in seconds. Default value: 86400. Valid value range: [300, 86400].
startTime Integer
Field start_time has been deprecated from provider version 1.50.0. New field effective_interval instead.

Deprecated: Field start_time has been deprecated from provider version 1.50.0. New field effective_interval instead.

status String
The status of the Alarm.
tags Map<String,String>
A mapping of tags to assign to the resource.
targets List<AlarmTarget>
Adds or modifies the push channels of an alert rule. See targets below.
webhook String
The webhook that should be called when the alarm is triggered. Currently, only http protocol is supported. Default is empty string.
compositeExpression AlarmCompositeExpression
The trigger conditions for multiple metrics. See composite_expression below.
contactGroups string[]
List contact groups of the alarm rule, which must have been created on the console.
dimensions {[key: string]: string}
Field dimensions has been deprecated from provider version 1.173.0. New field metric_dimensions instead.

Deprecated: Field dimensions has been deprecated from provider version 1.173.0. New field metric_dimensions instead.

effectiveInterval string
The interval of effecting alarm rule. It format as "hh:mm-hh:mm", like "0:00-4:00". Default value: 00:00-23:59.
enabled boolean
Whether to enable alarm rule. Default value: true.
endTime number
Field end_time has been deprecated from provider version 1.50.0. New field effective_interval instead.

Deprecated: Field end_time has been deprecated from provider version 1.50.0. New field effective_interval instead.

escalationsCritical AlarmEscalationsCritical
A configuration of critical alarm. See escalations_critical below.
escalationsInfo AlarmEscalationsInfo
A configuration of critical info. See escalations_info below.
escalationsWarn AlarmEscalationsWarn
A configuration of critical warn. See escalations_warn below.
metric Changes to this property will trigger replacement. string
The name of the metric, such as CPUUtilization and networkin_rate. For more information, see Metrics Reference.
metricDimensions string
Map of the resources associated with the alarm rule, such as "instanceId", "device" and "port". Each key's value is a string, and it uses comma to split multiple items. For more information, see Metrics Reference.
name string
The name of the alert rule.
period number
The statistical period of the metric. Unit: seconds. Default value: 300.
project Changes to this property will trigger replacement. string
The namespace of the cloud service, such as acs_ecs_dashboard and acs_rds_dashboard. For more information, see Metrics Reference. NOTE: The dimensions and metric_dimensions must be empty when project is acs_prometheus, otherwise, one of them must be set.
prometheuses AlarmPrometheus[]
The Prometheus alert rule. See prometheus below. Note: This parameter is required only when you create a Prometheus alert rule for Hybrid Cloud Monitoring.
silenceTime number
Notification silence period in the alarm state, in seconds. Default value: 86400. Valid value range: [300, 86400].
startTime number
Field start_time has been deprecated from provider version 1.50.0. New field effective_interval instead.

Deprecated: Field start_time has been deprecated from provider version 1.50.0. New field effective_interval instead.

status string
The status of the Alarm.
tags {[key: string]: string}
A mapping of tags to assign to the resource.
targets AlarmTarget[]
Adds or modifies the push channels of an alert rule. See targets below.
webhook string
The webhook that should be called when the alarm is triggered. Currently, only http protocol is supported. Default is empty string.
composite_expression AlarmCompositeExpressionArgs
The trigger conditions for multiple metrics. See composite_expression below.
contact_groups Sequence[str]
List contact groups of the alarm rule, which must have been created on the console.
dimensions Mapping[str, str]
Field dimensions has been deprecated from provider version 1.173.0. New field metric_dimensions instead.

Deprecated: Field dimensions has been deprecated from provider version 1.173.0. New field metric_dimensions instead.

effective_interval str
The interval of effecting alarm rule. It format as "hh:mm-hh:mm", like "0:00-4:00". Default value: 00:00-23:59.
enabled bool
Whether to enable alarm rule. Default value: true.
end_time int
Field end_time has been deprecated from provider version 1.50.0. New field effective_interval instead.

Deprecated: Field end_time has been deprecated from provider version 1.50.0. New field effective_interval instead.

escalations_critical AlarmEscalationsCriticalArgs
A configuration of critical alarm. See escalations_critical below.
escalations_info AlarmEscalationsInfoArgs
A configuration of critical info. See escalations_info below.
escalations_warn AlarmEscalationsWarnArgs
A configuration of critical warn. See escalations_warn below.
metric Changes to this property will trigger replacement. str
The name of the metric, such as CPUUtilization and networkin_rate. For more information, see Metrics Reference.
metric_dimensions str
Map of the resources associated with the alarm rule, such as "instanceId", "device" and "port". Each key's value is a string, and it uses comma to split multiple items. For more information, see Metrics Reference.
name str
The name of the alert rule.
period int
The statistical period of the metric. Unit: seconds. Default value: 300.
project Changes to this property will trigger replacement. str
The namespace of the cloud service, such as acs_ecs_dashboard and acs_rds_dashboard. For more information, see Metrics Reference. NOTE: The dimensions and metric_dimensions must be empty when project is acs_prometheus, otherwise, one of them must be set.
prometheuses Sequence[AlarmPrometheusArgs]
The Prometheus alert rule. See prometheus below. Note: This parameter is required only when you create a Prometheus alert rule for Hybrid Cloud Monitoring.
silence_time int
Notification silence period in the alarm state, in seconds. Default value: 86400. Valid value range: [300, 86400].
start_time int
Field start_time has been deprecated from provider version 1.50.0. New field effective_interval instead.

Deprecated: Field start_time has been deprecated from provider version 1.50.0. New field effective_interval instead.

status str
The status of the Alarm.
tags Mapping[str, str]
A mapping of tags to assign to the resource.
targets Sequence[AlarmTargetArgs]
Adds or modifies the push channels of an alert rule. See targets below.
webhook str
The webhook that should be called when the alarm is triggered. Currently, only http protocol is supported. Default is empty string.
compositeExpression Property Map
The trigger conditions for multiple metrics. See composite_expression below.
contactGroups List<String>
List contact groups of the alarm rule, which must have been created on the console.
dimensions Map<String>
Field dimensions has been deprecated from provider version 1.173.0. New field metric_dimensions instead.

Deprecated: Field dimensions has been deprecated from provider version 1.173.0. New field metric_dimensions instead.

effectiveInterval String
The interval of effecting alarm rule. It format as "hh:mm-hh:mm", like "0:00-4:00". Default value: 00:00-23:59.
enabled Boolean
Whether to enable alarm rule. Default value: true.
endTime Number
Field end_time has been deprecated from provider version 1.50.0. New field effective_interval instead.

Deprecated: Field end_time has been deprecated from provider version 1.50.0. New field effective_interval instead.

escalationsCritical Property Map
A configuration of critical alarm. See escalations_critical below.
escalationsInfo Property Map
A configuration of critical info. See escalations_info below.
escalationsWarn Property Map
A configuration of critical warn. See escalations_warn below.
metric Changes to this property will trigger replacement. String
The name of the metric, such as CPUUtilization and networkin_rate. For more information, see Metrics Reference.
metricDimensions String
Map of the resources associated with the alarm rule, such as "instanceId", "device" and "port". Each key's value is a string, and it uses comma to split multiple items. For more information, see Metrics Reference.
name String
The name of the alert rule.
period Number
The statistical period of the metric. Unit: seconds. Default value: 300.
project Changes to this property will trigger replacement. String
The namespace of the cloud service, such as acs_ecs_dashboard and acs_rds_dashboard. For more information, see Metrics Reference. NOTE: The dimensions and metric_dimensions must be empty when project is acs_prometheus, otherwise, one of them must be set.
prometheuses List<Property Map>
The Prometheus alert rule. See prometheus below. Note: This parameter is required only when you create a Prometheus alert rule for Hybrid Cloud Monitoring.
silenceTime Number
Notification silence period in the alarm state, in seconds. Default value: 86400. Valid value range: [300, 86400].
startTime Number
Field start_time has been deprecated from provider version 1.50.0. New field effective_interval instead.

Deprecated: Field start_time has been deprecated from provider version 1.50.0. New field effective_interval instead.

status String
The status of the Alarm.
tags Map<String>
A mapping of tags to assign to the resource.
targets List<Property Map>
Adds or modifies the push channels of an alert rule. See targets below.
webhook String
The webhook that should be called when the alarm is triggered. Currently, only http protocol is supported. Default is empty string.

Supporting Types

AlarmCompositeExpression
, AlarmCompositeExpressionArgs

ExpressionListJoin string
The relationship between the trigger conditions for multiple metrics. Valid values: &&, ||.
ExpressionLists List<Pulumi.AliCloud.Cms.Inputs.AlarmCompositeExpressionExpressionList>
The trigger conditions that are created in standard mode. See expression_list below.
ExpressionRaw string
The trigger conditions that are created by using expressions.
Level string
The level of the alert. Valid values: CRITICAL, WARN, INFO.
Times int
The number of consecutive triggers.
ExpressionListJoin string
The relationship between the trigger conditions for multiple metrics. Valid values: &&, ||.
ExpressionLists []AlarmCompositeExpressionExpressionList
The trigger conditions that are created in standard mode. See expression_list below.
ExpressionRaw string
The trigger conditions that are created by using expressions.
Level string
The level of the alert. Valid values: CRITICAL, WARN, INFO.
Times int
The number of consecutive triggers.
expressionListJoin String
The relationship between the trigger conditions for multiple metrics. Valid values: &&, ||.
expressionLists List<AlarmCompositeExpressionExpressionList>
The trigger conditions that are created in standard mode. See expression_list below.
expressionRaw String
The trigger conditions that are created by using expressions.
level String
The level of the alert. Valid values: CRITICAL, WARN, INFO.
times Integer
The number of consecutive triggers.
expressionListJoin string
The relationship between the trigger conditions for multiple metrics. Valid values: &&, ||.
expressionLists AlarmCompositeExpressionExpressionList[]
The trigger conditions that are created in standard mode. See expression_list below.
expressionRaw string
The trigger conditions that are created by using expressions.
level string
The level of the alert. Valid values: CRITICAL, WARN, INFO.
times number
The number of consecutive triggers.
expression_list_join str
The relationship between the trigger conditions for multiple metrics. Valid values: &&, ||.
expression_lists Sequence[AlarmCompositeExpressionExpressionList]
The trigger conditions that are created in standard mode. See expression_list below.
expression_raw str
The trigger conditions that are created by using expressions.
level str
The level of the alert. Valid values: CRITICAL, WARN, INFO.
times int
The number of consecutive triggers.
expressionListJoin String
The relationship between the trigger conditions for multiple metrics. Valid values: &&, ||.
expressionLists List<Property Map>
The trigger conditions that are created in standard mode. See expression_list below.
expressionRaw String
The trigger conditions that are created by using expressions.
level String
The level of the alert. Valid values: CRITICAL, WARN, INFO.
times Number
The number of consecutive triggers.

AlarmCompositeExpressionExpressionList
, AlarmCompositeExpressionExpressionListArgs

ComparisonOperator string
MetricName string
The metric that is used to monitor the cloud service.
Period string
The statistical period of the metric. Unit: seconds. Default value: 300.
Statistics string
Field statistics has been removed from provider version 1.216.0. New field escalations_critical.statistics instead.
Threshold string
Field threshold has been removed from provider version 1.216.0. New field escalations_critical.threshold instead.
ComparisonOperator string
MetricName string
The metric that is used to monitor the cloud service.
Period string
The statistical period of the metric. Unit: seconds. Default value: 300.
Statistics string
Field statistics has been removed from provider version 1.216.0. New field escalations_critical.statistics instead.
Threshold string
Field threshold has been removed from provider version 1.216.0. New field escalations_critical.threshold instead.
comparisonOperator String
metricName String
The metric that is used to monitor the cloud service.
period String
The statistical period of the metric. Unit: seconds. Default value: 300.
statistics String
Field statistics has been removed from provider version 1.216.0. New field escalations_critical.statistics instead.
threshold String
Field threshold has been removed from provider version 1.216.0. New field escalations_critical.threshold instead.
comparisonOperator string
metricName string
The metric that is used to monitor the cloud service.
period string
The statistical period of the metric. Unit: seconds. Default value: 300.
statistics string
Field statistics has been removed from provider version 1.216.0. New field escalations_critical.statistics instead.
threshold string
Field threshold has been removed from provider version 1.216.0. New field escalations_critical.threshold instead.
comparison_operator str
metric_name str
The metric that is used to monitor the cloud service.
period str
The statistical period of the metric. Unit: seconds. Default value: 300.
statistics str
Field statistics has been removed from provider version 1.216.0. New field escalations_critical.statistics instead.
threshold str
Field threshold has been removed from provider version 1.216.0. New field escalations_critical.threshold instead.
comparisonOperator String
metricName String
The metric that is used to monitor the cloud service.
period String
The statistical period of the metric. Unit: seconds. Default value: 300.
statistics String
Field statistics has been removed from provider version 1.216.0. New field escalations_critical.statistics instead.
threshold String
Field threshold has been removed from provider version 1.216.0. New field escalations_critical.threshold instead.

AlarmEscalationsCritical
, AlarmEscalationsCriticalArgs

ComparisonOperator string
Critical level alarm comparison operator. Default value: >. Valid values: >, >=, <, <=, !=, ==, GreaterThanYesterday, LessThanYesterday, GreaterThanLastWeek, LessThanLastWeek, GreaterThanLastPeriod, LessThanLastPeriod. NOTE: From version 1.231.0, comparison_operator can be set to ==.
Statistics string
Critical level alarm statistics method. It must be consistent with that defined for metrics. For more information, see How to use it.
Threshold string
Critical level alarm threshold value, which must be a numeric value currently.
Times int
Critical level alarm retry times. Default value: 3.
ComparisonOperator string
Critical level alarm comparison operator. Default value: >. Valid values: >, >=, <, <=, !=, ==, GreaterThanYesterday, LessThanYesterday, GreaterThanLastWeek, LessThanLastWeek, GreaterThanLastPeriod, LessThanLastPeriod. NOTE: From version 1.231.0, comparison_operator can be set to ==.
Statistics string
Critical level alarm statistics method. It must be consistent with that defined for metrics. For more information, see How to use it.
Threshold string
Critical level alarm threshold value, which must be a numeric value currently.
Times int
Critical level alarm retry times. Default value: 3.
comparisonOperator String
Critical level alarm comparison operator. Default value: >. Valid values: >, >=, <, <=, !=, ==, GreaterThanYesterday, LessThanYesterday, GreaterThanLastWeek, LessThanLastWeek, GreaterThanLastPeriod, LessThanLastPeriod. NOTE: From version 1.231.0, comparison_operator can be set to ==.
statistics String
Critical level alarm statistics method. It must be consistent with that defined for metrics. For more information, see How to use it.
threshold String
Critical level alarm threshold value, which must be a numeric value currently.
times Integer
Critical level alarm retry times. Default value: 3.
comparisonOperator string
Critical level alarm comparison operator. Default value: >. Valid values: >, >=, <, <=, !=, ==, GreaterThanYesterday, LessThanYesterday, GreaterThanLastWeek, LessThanLastWeek, GreaterThanLastPeriod, LessThanLastPeriod. NOTE: From version 1.231.0, comparison_operator can be set to ==.
statistics string
Critical level alarm statistics method. It must be consistent with that defined for metrics. For more information, see How to use it.
threshold string
Critical level alarm threshold value, which must be a numeric value currently.
times number
Critical level alarm retry times. Default value: 3.
comparison_operator str
Critical level alarm comparison operator. Default value: >. Valid values: >, >=, <, <=, !=, ==, GreaterThanYesterday, LessThanYesterday, GreaterThanLastWeek, LessThanLastWeek, GreaterThanLastPeriod, LessThanLastPeriod. NOTE: From version 1.231.0, comparison_operator can be set to ==.
statistics str
Critical level alarm statistics method. It must be consistent with that defined for metrics. For more information, see How to use it.
threshold str
Critical level alarm threshold value, which must be a numeric value currently.
times int
Critical level alarm retry times. Default value: 3.
comparisonOperator String
Critical level alarm comparison operator. Default value: >. Valid values: >, >=, <, <=, !=, ==, GreaterThanYesterday, LessThanYesterday, GreaterThanLastWeek, LessThanLastWeek, GreaterThanLastPeriod, LessThanLastPeriod. NOTE: From version 1.231.0, comparison_operator can be set to ==.
statistics String
Critical level alarm statistics method. It must be consistent with that defined for metrics. For more information, see How to use it.
threshold String
Critical level alarm threshold value, which must be a numeric value currently.
times Number
Critical level alarm retry times. Default value: 3.

AlarmEscalationsInfo
, AlarmEscalationsInfoArgs

ComparisonOperator string
Info level alarm comparison operator. Default value: >. Valid values: >, >=, <, <=, !=, ==, GreaterThanYesterday, LessThanYesterday, GreaterThanLastWeek, LessThanLastWeek, GreaterThanLastPeriod, LessThanLastPeriod. NOTE: From version 1.231.0, comparison_operator can be set to ==.
Statistics string
Info level alarm statistics method. It must be consistent with that defined for metrics. For more information, see How to use it.
Threshold string
Info level alarm threshold value, which must be a numeric value currently.
Times int
Info level alarm retry times. Default value: 3.
ComparisonOperator string
Info level alarm comparison operator. Default value: >. Valid values: >, >=, <, <=, !=, ==, GreaterThanYesterday, LessThanYesterday, GreaterThanLastWeek, LessThanLastWeek, GreaterThanLastPeriod, LessThanLastPeriod. NOTE: From version 1.231.0, comparison_operator can be set to ==.
Statistics string
Info level alarm statistics method. It must be consistent with that defined for metrics. For more information, see How to use it.
Threshold string
Info level alarm threshold value, which must be a numeric value currently.
Times int
Info level alarm retry times. Default value: 3.
comparisonOperator String
Info level alarm comparison operator. Default value: >. Valid values: >, >=, <, <=, !=, ==, GreaterThanYesterday, LessThanYesterday, GreaterThanLastWeek, LessThanLastWeek, GreaterThanLastPeriod, LessThanLastPeriod. NOTE: From version 1.231.0, comparison_operator can be set to ==.
statistics String
Info level alarm statistics method. It must be consistent with that defined for metrics. For more information, see How to use it.
threshold String
Info level alarm threshold value, which must be a numeric value currently.
times Integer
Info level alarm retry times. Default value: 3.
comparisonOperator string
Info level alarm comparison operator. Default value: >. Valid values: >, >=, <, <=, !=, ==, GreaterThanYesterday, LessThanYesterday, GreaterThanLastWeek, LessThanLastWeek, GreaterThanLastPeriod, LessThanLastPeriod. NOTE: From version 1.231.0, comparison_operator can be set to ==.
statistics string
Info level alarm statistics method. It must be consistent with that defined for metrics. For more information, see How to use it.
threshold string
Info level alarm threshold value, which must be a numeric value currently.
times number
Info level alarm retry times. Default value: 3.
comparison_operator str
Info level alarm comparison operator. Default value: >. Valid values: >, >=, <, <=, !=, ==, GreaterThanYesterday, LessThanYesterday, GreaterThanLastWeek, LessThanLastWeek, GreaterThanLastPeriod, LessThanLastPeriod. NOTE: From version 1.231.0, comparison_operator can be set to ==.
statistics str
Info level alarm statistics method. It must be consistent with that defined for metrics. For more information, see How to use it.
threshold str
Info level alarm threshold value, which must be a numeric value currently.
times int
Info level alarm retry times. Default value: 3.
comparisonOperator String
Info level alarm comparison operator. Default value: >. Valid values: >, >=, <, <=, !=, ==, GreaterThanYesterday, LessThanYesterday, GreaterThanLastWeek, LessThanLastWeek, GreaterThanLastPeriod, LessThanLastPeriod. NOTE: From version 1.231.0, comparison_operator can be set to ==.
statistics String
Info level alarm statistics method. It must be consistent with that defined for metrics. For more information, see How to use it.
threshold String
Info level alarm threshold value, which must be a numeric value currently.
times Number
Info level alarm retry times. Default value: 3.

AlarmEscalationsWarn
, AlarmEscalationsWarnArgs

ComparisonOperator string
Warn level alarm comparison operator. Default value: >. Valid values: >, >=, <, <=, !=, ==, GreaterThanYesterday, LessThanYesterday, GreaterThanLastWeek, LessThanLastWeek, GreaterThanLastPeriod, LessThanLastPeriod. NOTE: From version 1.231.0, comparison_operator can be set to ==.
Statistics string
Warn level alarm statistics method. It must be consistent with that defined for metrics. For more information, see How to use it.
Threshold string
Warn level alarm threshold value, which must be a numeric value currently.
Times int
Warn level alarm retry times. Default value: 3.
ComparisonOperator string
Warn level alarm comparison operator. Default value: >. Valid values: >, >=, <, <=, !=, ==, GreaterThanYesterday, LessThanYesterday, GreaterThanLastWeek, LessThanLastWeek, GreaterThanLastPeriod, LessThanLastPeriod. NOTE: From version 1.231.0, comparison_operator can be set to ==.
Statistics string
Warn level alarm statistics method. It must be consistent with that defined for metrics. For more information, see How to use it.
Threshold string
Warn level alarm threshold value, which must be a numeric value currently.
Times int
Warn level alarm retry times. Default value: 3.
comparisonOperator String
Warn level alarm comparison operator. Default value: >. Valid values: >, >=, <, <=, !=, ==, GreaterThanYesterday, LessThanYesterday, GreaterThanLastWeek, LessThanLastWeek, GreaterThanLastPeriod, LessThanLastPeriod. NOTE: From version 1.231.0, comparison_operator can be set to ==.
statistics String
Warn level alarm statistics method. It must be consistent with that defined for metrics. For more information, see How to use it.
threshold String
Warn level alarm threshold value, which must be a numeric value currently.
times Integer
Warn level alarm retry times. Default value: 3.
comparisonOperator string
Warn level alarm comparison operator. Default value: >. Valid values: >, >=, <, <=, !=, ==, GreaterThanYesterday, LessThanYesterday, GreaterThanLastWeek, LessThanLastWeek, GreaterThanLastPeriod, LessThanLastPeriod. NOTE: From version 1.231.0, comparison_operator can be set to ==.
statistics string
Warn level alarm statistics method. It must be consistent with that defined for metrics. For more information, see How to use it.
threshold string
Warn level alarm threshold value, which must be a numeric value currently.
times number
Warn level alarm retry times. Default value: 3.
comparison_operator str
Warn level alarm comparison operator. Default value: >. Valid values: >, >=, <, <=, !=, ==, GreaterThanYesterday, LessThanYesterday, GreaterThanLastWeek, LessThanLastWeek, GreaterThanLastPeriod, LessThanLastPeriod. NOTE: From version 1.231.0, comparison_operator can be set to ==.
statistics str
Warn level alarm statistics method. It must be consistent with that defined for metrics. For more information, see How to use it.
threshold str
Warn level alarm threshold value, which must be a numeric value currently.
times int
Warn level alarm retry times. Default value: 3.
comparisonOperator String
Warn level alarm comparison operator. Default value: >. Valid values: >, >=, <, <=, !=, ==, GreaterThanYesterday, LessThanYesterday, GreaterThanLastWeek, LessThanLastWeek, GreaterThanLastPeriod, LessThanLastPeriod. NOTE: From version 1.231.0, comparison_operator can be set to ==.
statistics String
Warn level alarm statistics method. It must be consistent with that defined for metrics. For more information, see How to use it.
threshold String
Warn level alarm threshold value, which must be a numeric value currently.
times Number
Warn level alarm retry times. Default value: 3.

AlarmPrometheus
, AlarmPrometheusArgs

Annotations Dictionary<string, string>
The annotations of the Prometheus alert rule. When a Prometheus alert is triggered, the system renders the annotated keys and values to help you understand the metrics and alert rule.
Level string
The level of the alert. Valid values: Critical, Warn, Info.
PromQl string
The PromQL query statement. Note: The data obtained by using the PromQL query statement is the monitoring data. You must include the alert threshold in this statement.
Times int
The number of consecutive triggers. If the number of times that the metric values meet the trigger conditions reaches the value of this parameter, CloudMonitor sends alert notifications.
Annotations map[string]string
The annotations of the Prometheus alert rule. When a Prometheus alert is triggered, the system renders the annotated keys and values to help you understand the metrics and alert rule.
Level string
The level of the alert. Valid values: Critical, Warn, Info.
PromQl string
The PromQL query statement. Note: The data obtained by using the PromQL query statement is the monitoring data. You must include the alert threshold in this statement.
Times int
The number of consecutive triggers. If the number of times that the metric values meet the trigger conditions reaches the value of this parameter, CloudMonitor sends alert notifications.
annotations Map<String,String>
The annotations of the Prometheus alert rule. When a Prometheus alert is triggered, the system renders the annotated keys and values to help you understand the metrics and alert rule.
level String
The level of the alert. Valid values: Critical, Warn, Info.
promQl String
The PromQL query statement. Note: The data obtained by using the PromQL query statement is the monitoring data. You must include the alert threshold in this statement.
times Integer
The number of consecutive triggers. If the number of times that the metric values meet the trigger conditions reaches the value of this parameter, CloudMonitor sends alert notifications.
annotations {[key: string]: string}
The annotations of the Prometheus alert rule. When a Prometheus alert is triggered, the system renders the annotated keys and values to help you understand the metrics and alert rule.
level string
The level of the alert. Valid values: Critical, Warn, Info.
promQl string
The PromQL query statement. Note: The data obtained by using the PromQL query statement is the monitoring data. You must include the alert threshold in this statement.
times number
The number of consecutive triggers. If the number of times that the metric values meet the trigger conditions reaches the value of this parameter, CloudMonitor sends alert notifications.
annotations Mapping[str, str]
The annotations of the Prometheus alert rule. When a Prometheus alert is triggered, the system renders the annotated keys and values to help you understand the metrics and alert rule.
level str
The level of the alert. Valid values: Critical, Warn, Info.
prom_ql str
The PromQL query statement. Note: The data obtained by using the PromQL query statement is the monitoring data. You must include the alert threshold in this statement.
times int
The number of consecutive triggers. If the number of times that the metric values meet the trigger conditions reaches the value of this parameter, CloudMonitor sends alert notifications.
annotations Map<String>
The annotations of the Prometheus alert rule. When a Prometheus alert is triggered, the system renders the annotated keys and values to help you understand the metrics and alert rule.
level String
The level of the alert. Valid values: Critical, Warn, Info.
promQl String
The PromQL query statement. Note: The data obtained by using the PromQL query statement is the monitoring data. You must include the alert threshold in this statement.
times Number
The number of consecutive triggers. If the number of times that the metric values meet the trigger conditions reaches the value of this parameter, CloudMonitor sends alert notifications.

AlarmTarget
, AlarmTargetArgs

Arn string
The Alibaba Cloud Resource Name (ARN) of the resource. Simple Message Queue (formerly MNS) (SMQ), Auto Scaling, Simple Log Service, and Function Compute are supported:

  • SMQ: acs:mns:{regionId}:{userId}:/{Resource type}/{Resource name}/message. {regionId}: the region ID of the SMQ queue or topic. {userId}: the ID of the Alibaba Cloud account that owns the resource. {Resource type}: the type of the resource for which alerts are triggered. Valid values:queues, topics. {Resource name}: the resource name. If the resource type is queues, the resource name is the queue name. If the resource type is topics, the resource name is the topic name.
  • Auto Scaling: acs:ess:{regionId}:{userId}:scalingGroupId/{Scaling group ID}:scalingRuleId/{Scaling rule ID}
  • Simple Log Service: acs:log:{regionId}:{userId}:project/{Project name}/logstore/{Logstore name}
  • Function Compute: acs:fc:{regionId}:{userId}:services/{Service name}/functions/{Function name}
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.
TargetId string
The ID of the resource for which alerts are triggered. For more information about how to obtain the ID of the resource for which alerts are triggered, see DescribeMetricRuleTargets .
Arn string
The Alibaba Cloud Resource Name (ARN) of the resource. Simple Message Queue (formerly MNS) (SMQ), Auto Scaling, Simple Log Service, and Function Compute are supported:

  • SMQ: acs:mns:{regionId}:{userId}:/{Resource type}/{Resource name}/message. {regionId}: the region ID of the SMQ queue or topic. {userId}: the ID of the Alibaba Cloud account that owns the resource. {Resource type}: the type of the resource for which alerts are triggered. Valid values:queues, topics. {Resource name}: the resource name. If the resource type is queues, the resource name is the queue name. If the resource type is topics, the resource name is the topic name.
  • Auto Scaling: acs:ess:{regionId}:{userId}:scalingGroupId/{Scaling group ID}:scalingRuleId/{Scaling rule ID}
  • Simple Log Service: acs:log:{regionId}:{userId}:project/{Project name}/logstore/{Logstore name}
  • Function Compute: acs:fc:{regionId}:{userId}:services/{Service name}/functions/{Function name}
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.
TargetId string
The ID of the resource for which alerts are triggered. For more information about how to obtain the ID of the resource for which alerts are triggered, see DescribeMetricRuleTargets .
arn String
The Alibaba Cloud Resource Name (ARN) of the resource. Simple Message Queue (formerly MNS) (SMQ), Auto Scaling, Simple Log Service, and Function Compute are supported:

  • SMQ: acs:mns:{regionId}:{userId}:/{Resource type}/{Resource name}/message. {regionId}: the region ID of the SMQ queue or topic. {userId}: the ID of the Alibaba Cloud account that owns the resource. {Resource type}: the type of the resource for which alerts are triggered. Valid values:queues, topics. {Resource name}: the resource name. If the resource type is queues, the resource name is the queue name. If the resource type is topics, the resource name is the topic name.
  • Auto Scaling: acs:ess:{regionId}:{userId}:scalingGroupId/{Scaling group ID}:scalingRuleId/{Scaling rule ID}
  • Simple Log Service: acs:log:{regionId}:{userId}:project/{Project name}/logstore/{Logstore name}
  • Function Compute: acs:fc:{regionId}:{userId}:services/{Service name}/functions/{Function name}
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.
targetId String
The ID of the resource for which alerts are triggered. For more information about how to obtain the ID of the resource for which alerts are triggered, see DescribeMetricRuleTargets .
arn string
The Alibaba Cloud Resource Name (ARN) of the resource. Simple Message Queue (formerly MNS) (SMQ), Auto Scaling, Simple Log Service, and Function Compute are supported:

  • SMQ: acs:mns:{regionId}:{userId}:/{Resource type}/{Resource name}/message. {regionId}: the region ID of the SMQ queue or topic. {userId}: the ID of the Alibaba Cloud account that owns the resource. {Resource type}: the type of the resource for which alerts are triggered. Valid values:queues, topics. {Resource name}: the resource name. If the resource type is queues, the resource name is the queue name. If the resource type is topics, the resource name is the topic name.
  • Auto Scaling: acs:ess:{regionId}:{userId}:scalingGroupId/{Scaling group ID}:scalingRuleId/{Scaling rule ID}
  • Simple Log Service: acs:log:{regionId}:{userId}:project/{Project name}/logstore/{Logstore name}
  • Function Compute: acs:fc:{regionId}:{userId}:services/{Service name}/functions/{Function name}
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.
targetId string
The ID of the resource for which alerts are triggered. For more information about how to obtain the ID of the resource for which alerts are triggered, see DescribeMetricRuleTargets .
arn str
The Alibaba Cloud Resource Name (ARN) of the resource. Simple Message Queue (formerly MNS) (SMQ), Auto Scaling, Simple Log Service, and Function Compute are supported:

  • SMQ: acs:mns:{regionId}:{userId}:/{Resource type}/{Resource name}/message. {regionId}: the region ID of the SMQ queue or topic. {userId}: the ID of the Alibaba Cloud account that owns the resource. {Resource type}: the type of the resource for which alerts are triggered. Valid values:queues, topics. {Resource name}: the resource name. If the resource type is queues, the resource name is the queue name. If the resource type is topics, the resource name is the topic name.
  • Auto Scaling: acs:ess:{regionId}:{userId}:scalingGroupId/{Scaling group ID}:scalingRuleId/{Scaling rule ID}
  • Simple Log Service: acs:log:{regionId}:{userId}:project/{Project name}/logstore/{Logstore name}
  • Function Compute: acs:fc:{regionId}:{userId}:services/{Service name}/functions/{Function name}
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.
target_id str
The ID of the resource for which alerts are triggered. For more information about how to obtain the ID of the resource for which alerts are triggered, see DescribeMetricRuleTargets .
arn String
The Alibaba Cloud Resource Name (ARN) of the resource. Simple Message Queue (formerly MNS) (SMQ), Auto Scaling, Simple Log Service, and Function Compute are supported:

  • SMQ: acs:mns:{regionId}:{userId}:/{Resource type}/{Resource name}/message. {regionId}: the region ID of the SMQ queue or topic. {userId}: the ID of the Alibaba Cloud account that owns the resource. {Resource type}: the type of the resource for which alerts are triggered. Valid values:queues, topics. {Resource name}: the resource name. If the resource type is queues, the resource name is the queue name. If the resource type is topics, the resource name is the topic name.
  • Auto Scaling: acs:ess:{regionId}:{userId}:scalingGroupId/{Scaling group ID}:scalingRuleId/{Scaling rule ID}
  • Simple Log Service: acs:log:{regionId}:{userId}:project/{Project name}/logstore/{Logstore name}
  • Function Compute: acs:fc:{regionId}:{userId}:services/{Service name}/functions/{Function name}
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.
targetId String
The ID of the resource for which alerts are triggered. For more information about how to obtain the ID of the resource for which alerts are triggered, see DescribeMetricRuleTargets .

Import

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

$ pulumi import alicloud:cms/alarm:Alarm example <id>
Copy

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.