1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. ess
  5. Alarm
Alibaba Cloud v3.51.0 published on Saturday, Mar 23, 2024 by Pulumi

alicloud.ess.Alarm

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.51.0 published on Saturday, Mar 23, 2024 by Pulumi

    Provides a ESS alarm task resource.

    For information about ess alarm, see CreateAlarm.

    NOTE: Available since v1.15.0.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    import * as random from "@pulumi/random";
    
    const config = new pulumi.Config();
    const name = config.get("name") || "terraform-example";
    const defaultRandomInteger = new random.RandomInteger("defaultRandomInteger", {
        min: 10000,
        max: 99999,
    });
    const myName = pulumi.interpolate`${name}-${defaultRandomInteger.result}`;
    const defaultZones = alicloud.getZones({
        availableDiskCategory: "cloud_efficiency",
        availableResourceCreation: "VSwitch",
    });
    const defaultInstanceTypes = defaultZones.then(defaultZones => alicloud.ecs.getInstanceTypes({
        availabilityZone: defaultZones.zones?.[0]?.id,
        cpuCoreCount: 2,
        memorySize: 4,
    }));
    const defaultImages = alicloud.ecs.getImages({
        nameRegex: "^ubuntu_18.*64",
        mostRecent: true,
        owners: "system",
    });
    const defaultNetwork = new alicloud.vpc.Network("defaultNetwork", {
        vpcName: myName,
        cidrBlock: "172.16.0.0/16",
    });
    const defaultSwitch = new alicloud.vpc.Switch("defaultSwitch", {
        vpcId: defaultNetwork.id,
        cidrBlock: "172.16.0.0/24",
        zoneId: defaultZones.then(defaultZones => defaultZones.zones?.[0]?.id),
        vswitchName: myName,
    });
    const defaultSecurityGroup = new alicloud.ecs.SecurityGroup("defaultSecurityGroup", {vpcId: defaultNetwork.id});
    const defaultSecurityGroupRule = new alicloud.ecs.SecurityGroupRule("defaultSecurityGroupRule", {
        type: "ingress",
        ipProtocol: "tcp",
        nicType: "intranet",
        policy: "accept",
        portRange: "22/22",
        priority: 1,
        securityGroupId: defaultSecurityGroup.id,
        cidrIp: "172.16.0.0/24",
    });
    const default2 = new alicloud.vpc.Switch("default2", {
        vpcId: defaultNetwork.id,
        cidrBlock: "172.16.1.0/24",
        zoneId: defaultZones.then(defaultZones => defaultZones.zones?.[0]?.id),
        vswitchName: `${name}-bar`,
    });
    const defaultScalingGroup = new alicloud.ess.ScalingGroup("defaultScalingGroup", {
        minSize: 1,
        maxSize: 1,
        scalingGroupName: myName,
        defaultCooldown: 20,
        vswitchIds: [
            defaultSwitch.id,
            default2.id,
        ],
        removalPolicies: [
            "OldestInstance",
            "NewestInstance",
        ],
    });
    const defaultScalingRule = new alicloud.ess.ScalingRule("defaultScalingRule", {
        scalingRuleName: myName,
        scalingGroupId: defaultScalingGroup.id,
        adjustmentType: "TotalCapacity",
        adjustmentValue: 2,
        cooldown: 60,
    });
    const defaultAlarm = new alicloud.ess.Alarm("defaultAlarm", {
        description: name,
        alarmActions: [defaultScalingRule.ari],
        scalingGroupId: defaultScalingGroup.id,
        metricType: "system",
        metricName: "CpuUtilization",
        period: 300,
        statistics: "Average",
        threshold: "200.3",
        comparisonOperator: ">=",
        evaluationCount: 2,
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    import pulumi_random as random
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "terraform-example"
    default_random_integer = random.RandomInteger("defaultRandomInteger",
        min=10000,
        max=99999)
    my_name = default_random_integer.result.apply(lambda result: f"{name}-{result}")
    default_zones = alicloud.get_zones(available_disk_category="cloud_efficiency",
        available_resource_creation="VSwitch")
    default_instance_types = alicloud.ecs.get_instance_types(availability_zone=default_zones.zones[0].id,
        cpu_core_count=2,
        memory_size=4)
    default_images = alicloud.ecs.get_images(name_regex="^ubuntu_18.*64",
        most_recent=True,
        owners="system")
    default_network = alicloud.vpc.Network("defaultNetwork",
        vpc_name=my_name,
        cidr_block="172.16.0.0/16")
    default_switch = alicloud.vpc.Switch("defaultSwitch",
        vpc_id=default_network.id,
        cidr_block="172.16.0.0/24",
        zone_id=default_zones.zones[0].id,
        vswitch_name=my_name)
    default_security_group = alicloud.ecs.SecurityGroup("defaultSecurityGroup", vpc_id=default_network.id)
    default_security_group_rule = alicloud.ecs.SecurityGroupRule("defaultSecurityGroupRule",
        type="ingress",
        ip_protocol="tcp",
        nic_type="intranet",
        policy="accept",
        port_range="22/22",
        priority=1,
        security_group_id=default_security_group.id,
        cidr_ip="172.16.0.0/24")
    default2 = alicloud.vpc.Switch("default2",
        vpc_id=default_network.id,
        cidr_block="172.16.1.0/24",
        zone_id=default_zones.zones[0].id,
        vswitch_name=f"{name}-bar")
    default_scaling_group = alicloud.ess.ScalingGroup("defaultScalingGroup",
        min_size=1,
        max_size=1,
        scaling_group_name=my_name,
        default_cooldown=20,
        vswitch_ids=[
            default_switch.id,
            default2.id,
        ],
        removal_policies=[
            "OldestInstance",
            "NewestInstance",
        ])
    default_scaling_rule = alicloud.ess.ScalingRule("defaultScalingRule",
        scaling_rule_name=my_name,
        scaling_group_id=default_scaling_group.id,
        adjustment_type="TotalCapacity",
        adjustment_value=2,
        cooldown=60)
    default_alarm = alicloud.ess.Alarm("defaultAlarm",
        description=name,
        alarm_actions=[default_scaling_rule.ari],
        scaling_group_id=default_scaling_group.id,
        metric_type="system",
        metric_name="CpuUtilization",
        period=300,
        statistics="Average",
        threshold="200.3",
        comparison_operator=">=",
        evaluation_count=2)
    
    package main
    
    import (
    	"fmt"
    
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud"
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ecs"
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ess"
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vpc"
    	"github.com/pulumi/pulumi-random/sdk/v4/go/random"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		cfg := config.New(ctx, "")
    		name := "terraform-example"
    		if param := cfg.Get("name"); param != "" {
    			name = param
    		}
    		defaultRandomInteger, err := random.NewRandomInteger(ctx, "defaultRandomInteger", &random.RandomIntegerArgs{
    			Min: pulumi.Int(10000),
    			Max: pulumi.Int(99999),
    		})
    		if err != nil {
    			return err
    		}
    		myName := defaultRandomInteger.Result.ApplyT(func(result int) (string, error) {
    			return fmt.Sprintf("%v-%v", name, result), nil
    		}).(pulumi.StringOutput)
    		defaultZones, err := alicloud.GetZones(ctx, &alicloud.GetZonesArgs{
    			AvailableDiskCategory:     pulumi.StringRef("cloud_efficiency"),
    			AvailableResourceCreation: pulumi.StringRef("VSwitch"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = ecs.GetInstanceTypes(ctx, &ecs.GetInstanceTypesArgs{
    			AvailabilityZone: pulumi.StringRef(defaultZones.Zones[0].Id),
    			CpuCoreCount:     pulumi.IntRef(2),
    			MemorySize:       pulumi.Float64Ref(4),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = ecs.GetImages(ctx, &ecs.GetImagesArgs{
    			NameRegex:  pulumi.StringRef("^ubuntu_18.*64"),
    			MostRecent: pulumi.BoolRef(true),
    			Owners:     pulumi.StringRef("system"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		defaultNetwork, err := vpc.NewNetwork(ctx, "defaultNetwork", &vpc.NetworkArgs{
    			VpcName:   pulumi.String(myName),
    			CidrBlock: pulumi.String("172.16.0.0/16"),
    		})
    		if err != nil {
    			return err
    		}
    		defaultSwitch, err := vpc.NewSwitch(ctx, "defaultSwitch", &vpc.SwitchArgs{
    			VpcId:       defaultNetwork.ID(),
    			CidrBlock:   pulumi.String("172.16.0.0/24"),
    			ZoneId:      pulumi.String(defaultZones.Zones[0].Id),
    			VswitchName: pulumi.String(myName),
    		})
    		if err != nil {
    			return err
    		}
    		defaultSecurityGroup, err := ecs.NewSecurityGroup(ctx, "defaultSecurityGroup", &ecs.SecurityGroupArgs{
    			VpcId: defaultNetwork.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = ecs.NewSecurityGroupRule(ctx, "defaultSecurityGroupRule", &ecs.SecurityGroupRuleArgs{
    			Type:            pulumi.String("ingress"),
    			IpProtocol:      pulumi.String("tcp"),
    			NicType:         pulumi.String("intranet"),
    			Policy:          pulumi.String("accept"),
    			PortRange:       pulumi.String("22/22"),
    			Priority:        pulumi.Int(1),
    			SecurityGroupId: defaultSecurityGroup.ID(),
    			CidrIp:          pulumi.String("172.16.0.0/24"),
    		})
    		if err != nil {
    			return err
    		}
    		default2, err := vpc.NewSwitch(ctx, "default2", &vpc.SwitchArgs{
    			VpcId:       defaultNetwork.ID(),
    			CidrBlock:   pulumi.String("172.16.1.0/24"),
    			ZoneId:      pulumi.String(defaultZones.Zones[0].Id),
    			VswitchName: pulumi.String(fmt.Sprintf("%v-bar", name)),
    		})
    		if err != nil {
    			return err
    		}
    		defaultScalingGroup, err := ess.NewScalingGroup(ctx, "defaultScalingGroup", &ess.ScalingGroupArgs{
    			MinSize:          pulumi.Int(1),
    			MaxSize:          pulumi.Int(1),
    			ScalingGroupName: pulumi.String(myName),
    			DefaultCooldown:  pulumi.Int(20),
    			VswitchIds: pulumi.StringArray{
    				defaultSwitch.ID(),
    				default2.ID(),
    			},
    			RemovalPolicies: pulumi.StringArray{
    				pulumi.String("OldestInstance"),
    				pulumi.String("NewestInstance"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		defaultScalingRule, err := ess.NewScalingRule(ctx, "defaultScalingRule", &ess.ScalingRuleArgs{
    			ScalingRuleName: pulumi.String(myName),
    			ScalingGroupId:  defaultScalingGroup.ID(),
    			AdjustmentType:  pulumi.String("TotalCapacity"),
    			AdjustmentValue: pulumi.Int(2),
    			Cooldown:        pulumi.Int(60),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = ess.NewAlarm(ctx, "defaultAlarm", &ess.AlarmArgs{
    			Description: pulumi.String(name),
    			AlarmActions: pulumi.StringArray{
    				defaultScalingRule.Ari,
    			},
    			ScalingGroupId:     defaultScalingGroup.ID(),
    			MetricType:         pulumi.String("system"),
    			MetricName:         pulumi.String("CpuUtilization"),
    			Period:             pulumi.Int(300),
    			Statistics:         pulumi.String("Average"),
    			Threshold:          pulumi.String("200.3"),
    			ComparisonOperator: pulumi.String(">="),
    			EvaluationCount:    pulumi.Int(2),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    using Random = Pulumi.Random;
    
    return await Deployment.RunAsync(() => 
    {
        var config = new Config();
        var name = config.Get("name") ?? "terraform-example";
        var defaultRandomInteger = new Random.RandomInteger("defaultRandomInteger", new()
        {
            Min = 10000,
            Max = 99999,
        });
    
        var myName = defaultRandomInteger.Result.Apply(result => $"{name}-{result}");
    
        var defaultZones = AliCloud.GetZones.Invoke(new()
        {
            AvailableDiskCategory = "cloud_efficiency",
            AvailableResourceCreation = "VSwitch",
        });
    
        var defaultInstanceTypes = AliCloud.Ecs.GetInstanceTypes.Invoke(new()
        {
            AvailabilityZone = defaultZones.Apply(getZonesResult => getZonesResult.Zones[0]?.Id),
            CpuCoreCount = 2,
            MemorySize = 4,
        });
    
        var defaultImages = AliCloud.Ecs.GetImages.Invoke(new()
        {
            NameRegex = "^ubuntu_18.*64",
            MostRecent = true,
            Owners = "system",
        });
    
        var defaultNetwork = new AliCloud.Vpc.Network("defaultNetwork", new()
        {
            VpcName = myName,
            CidrBlock = "172.16.0.0/16",
        });
    
        var defaultSwitch = new AliCloud.Vpc.Switch("defaultSwitch", new()
        {
            VpcId = defaultNetwork.Id,
            CidrBlock = "172.16.0.0/24",
            ZoneId = defaultZones.Apply(getZonesResult => getZonesResult.Zones[0]?.Id),
            VswitchName = myName,
        });
    
        var defaultSecurityGroup = new AliCloud.Ecs.SecurityGroup("defaultSecurityGroup", new()
        {
            VpcId = defaultNetwork.Id,
        });
    
        var defaultSecurityGroupRule = new AliCloud.Ecs.SecurityGroupRule("defaultSecurityGroupRule", new()
        {
            Type = "ingress",
            IpProtocol = "tcp",
            NicType = "intranet",
            Policy = "accept",
            PortRange = "22/22",
            Priority = 1,
            SecurityGroupId = defaultSecurityGroup.Id,
            CidrIp = "172.16.0.0/24",
        });
    
        var default2 = new AliCloud.Vpc.Switch("default2", new()
        {
            VpcId = defaultNetwork.Id,
            CidrBlock = "172.16.1.0/24",
            ZoneId = defaultZones.Apply(getZonesResult => getZonesResult.Zones[0]?.Id),
            VswitchName = $"{name}-bar",
        });
    
        var defaultScalingGroup = new AliCloud.Ess.ScalingGroup("defaultScalingGroup", new()
        {
            MinSize = 1,
            MaxSize = 1,
            ScalingGroupName = myName,
            DefaultCooldown = 20,
            VswitchIds = new[]
            {
                defaultSwitch.Id,
                default2.Id,
            },
            RemovalPolicies = new[]
            {
                "OldestInstance",
                "NewestInstance",
            },
        });
    
        var defaultScalingRule = new AliCloud.Ess.ScalingRule("defaultScalingRule", new()
        {
            ScalingRuleName = myName,
            ScalingGroupId = defaultScalingGroup.Id,
            AdjustmentType = "TotalCapacity",
            AdjustmentValue = 2,
            Cooldown = 60,
        });
    
        var defaultAlarm = new AliCloud.Ess.Alarm("defaultAlarm", new()
        {
            Description = name,
            AlarmActions = new[]
            {
                defaultScalingRule.Ari,
            },
            ScalingGroupId = defaultScalingGroup.Id,
            MetricType = "system",
            MetricName = "CpuUtilization",
            Period = 300,
            Statistics = "Average",
            Threshold = "200.3",
            ComparisonOperator = ">=",
            EvaluationCount = 2,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.random.RandomInteger;
    import com.pulumi.random.RandomIntegerArgs;
    import com.pulumi.alicloud.AlicloudFunctions;
    import com.pulumi.alicloud.inputs.GetZonesArgs;
    import com.pulumi.alicloud.ecs.EcsFunctions;
    import com.pulumi.alicloud.ecs.inputs.GetInstanceTypesArgs;
    import com.pulumi.alicloud.ecs.inputs.GetImagesArgs;
    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.SecurityGroupRule;
    import com.pulumi.alicloud.ecs.SecurityGroupRuleArgs;
    import com.pulumi.alicloud.ess.ScalingGroup;
    import com.pulumi.alicloud.ess.ScalingGroupArgs;
    import com.pulumi.alicloud.ess.ScalingRule;
    import com.pulumi.alicloud.ess.ScalingRuleArgs;
    import com.pulumi.alicloud.ess.Alarm;
    import com.pulumi.alicloud.ess.AlarmArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            final var config = ctx.config();
            final var name = config.get("name").orElse("terraform-example");
            var defaultRandomInteger = new RandomInteger("defaultRandomInteger", RandomIntegerArgs.builder()        
                .min(10000)
                .max(99999)
                .build());
    
            final var myName = defaultRandomInteger.result().applyValue(result -> String.format("%s-%s", name,result));
    
            final var defaultZones = AlicloudFunctions.getZones(GetZonesArgs.builder()
                .availableDiskCategory("cloud_efficiency")
                .availableResourceCreation("VSwitch")
                .build());
    
            final var defaultInstanceTypes = EcsFunctions.getInstanceTypes(GetInstanceTypesArgs.builder()
                .availabilityZone(defaultZones.applyValue(getZonesResult -> getZonesResult.zones()[0].id()))
                .cpuCoreCount(2)
                .memorySize(4)
                .build());
    
            final var defaultImages = EcsFunctions.getImages(GetImagesArgs.builder()
                .nameRegex("^ubuntu_18.*64")
                .mostRecent(true)
                .owners("system")
                .build());
    
            var defaultNetwork = new Network("defaultNetwork", NetworkArgs.builder()        
                .vpcName(myName)
                .cidrBlock("172.16.0.0/16")
                .build());
    
            var defaultSwitch = new Switch("defaultSwitch", SwitchArgs.builder()        
                .vpcId(defaultNetwork.id())
                .cidrBlock("172.16.0.0/24")
                .zoneId(defaultZones.applyValue(getZonesResult -> getZonesResult.zones()[0].id()))
                .vswitchName(myName)
                .build());
    
            var defaultSecurityGroup = new SecurityGroup("defaultSecurityGroup", SecurityGroupArgs.builder()        
                .vpcId(defaultNetwork.id())
                .build());
    
            var defaultSecurityGroupRule = new SecurityGroupRule("defaultSecurityGroupRule", SecurityGroupRuleArgs.builder()        
                .type("ingress")
                .ipProtocol("tcp")
                .nicType("intranet")
                .policy("accept")
                .portRange("22/22")
                .priority(1)
                .securityGroupId(defaultSecurityGroup.id())
                .cidrIp("172.16.0.0/24")
                .build());
    
            var default2 = new Switch("default2", SwitchArgs.builder()        
                .vpcId(defaultNetwork.id())
                .cidrBlock("172.16.1.0/24")
                .zoneId(defaultZones.applyValue(getZonesResult -> getZonesResult.zones()[0].id()))
                .vswitchName(String.format("%s-bar", name))
                .build());
    
            var defaultScalingGroup = new ScalingGroup("defaultScalingGroup", ScalingGroupArgs.builder()        
                .minSize(1)
                .maxSize(1)
                .scalingGroupName(myName)
                .defaultCooldown(20)
                .vswitchIds(            
                    defaultSwitch.id(),
                    default2.id())
                .removalPolicies(            
                    "OldestInstance",
                    "NewestInstance")
                .build());
    
            var defaultScalingRule = new ScalingRule("defaultScalingRule", ScalingRuleArgs.builder()        
                .scalingRuleName(myName)
                .scalingGroupId(defaultScalingGroup.id())
                .adjustmentType("TotalCapacity")
                .adjustmentValue(2)
                .cooldown(60)
                .build());
    
            var defaultAlarm = new Alarm("defaultAlarm", AlarmArgs.builder()        
                .description(name)
                .alarmActions(defaultScalingRule.ari())
                .scalingGroupId(defaultScalingGroup.id())
                .metricType("system")
                .metricName("CpuUtilization")
                .period(300)
                .statistics("Average")
                .threshold(200.3)
                .comparisonOperator(">=")
                .evaluationCount(2)
                .build());
    
        }
    }
    
    configuration:
      name:
        type: string
        default: terraform-example
    resources:
      defaultRandomInteger:
        type: random:RandomInteger
        properties:
          min: 10000
          max: 99999
      defaultNetwork:
        type: alicloud:vpc:Network
        properties:
          vpcName: ${myName}
          cidrBlock: 172.16.0.0/16
      defaultSwitch:
        type: alicloud:vpc:Switch
        properties:
          vpcId: ${defaultNetwork.id}
          cidrBlock: 172.16.0.0/24
          zoneId: ${defaultZones.zones[0].id}
          vswitchName: ${myName}
      defaultSecurityGroup:
        type: alicloud:ecs:SecurityGroup
        properties:
          vpcId: ${defaultNetwork.id}
      defaultSecurityGroupRule:
        type: alicloud:ecs:SecurityGroupRule
        properties:
          type: ingress
          ipProtocol: tcp
          nicType: intranet
          policy: accept
          portRange: 22/22
          priority: 1
          securityGroupId: ${defaultSecurityGroup.id}
          cidrIp: 172.16.0.0/24
      default2:
        type: alicloud:vpc:Switch
        properties:
          vpcId: ${defaultNetwork.id}
          cidrBlock: 172.16.1.0/24
          zoneId: ${defaultZones.zones[0].id}
          vswitchName: ${name}-bar
      defaultScalingGroup:
        type: alicloud:ess:ScalingGroup
        properties:
          minSize: 1
          maxSize: 1
          scalingGroupName: ${myName}
          defaultCooldown: 20
          vswitchIds:
            - ${defaultSwitch.id}
            - ${default2.id}
          removalPolicies:
            - OldestInstance
            - NewestInstance
      defaultScalingRule:
        type: alicloud:ess:ScalingRule
        properties:
          scalingRuleName: ${myName}
          scalingGroupId: ${defaultScalingGroup.id}
          adjustmentType: TotalCapacity
          adjustmentValue: 2
          cooldown: 60
      defaultAlarm:
        type: alicloud:ess:Alarm
        properties:
          description: ${name}
          alarmActions:
            - ${defaultScalingRule.ari}
          scalingGroupId: ${defaultScalingGroup.id}
          metricType: system
          metricName: CpuUtilization
          period: 300
          statistics: Average
          threshold: 200.3
          comparisonOperator: '>='
          evaluationCount: 2
    variables:
      myName: ${name}-${defaultRandomInteger.result}
      defaultZones:
        fn::invoke:
          Function: alicloud:getZones
          Arguments:
            availableDiskCategory: cloud_efficiency
            availableResourceCreation: VSwitch
      defaultInstanceTypes:
        fn::invoke:
          Function: alicloud:ecs:getInstanceTypes
          Arguments:
            availabilityZone: ${defaultZones.zones[0].id}
            cpuCoreCount: 2
            memorySize: 4
      defaultImages:
        fn::invoke:
          Function: alicloud:ecs:getImages
          Arguments:
            nameRegex: ^ubuntu_18.*64
            mostRecent: true
            owners: system
    

    Module Support

    You can use to the existing autoscaling-rule module to create alarm task, different type rules and scheduled task one-click.

    Create Alarm Resource

    new Alarm(name: string, args: AlarmArgs, opts?: CustomResourceOptions);
    @overload
    def Alarm(resource_name: str,
              opts: Optional[ResourceOptions] = None,
              alarm_actions: Optional[Sequence[str]] = None,
              cloud_monitor_group_id: Optional[int] = None,
              comparison_operator: Optional[str] = None,
              description: Optional[str] = None,
              dimensions: Optional[Mapping[str, Any]] = None,
              enable: Optional[bool] = None,
              evaluation_count: Optional[int] = None,
              metric_name: Optional[str] = None,
              metric_type: Optional[str] = None,
              name: Optional[str] = None,
              period: Optional[int] = None,
              scaling_group_id: Optional[str] = None,
              statistics: Optional[str] = None,
              threshold: Optional[str] = None)
    @overload
    def Alarm(resource_name: str,
              args: AlarmArgs,
              opts: Optional[ResourceOptions] = 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:ess:Alarm
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    name string
    The unique name of the resource.
    args AlarmArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args 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 string
    The unique name of the resource.
    args AlarmArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args AlarmArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args AlarmArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    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

    The Alarm resource accepts the following input properties:

    AlarmActions List<string>
    The list of actions to execute when this alarm transition into an ALARM state. Each action is specified as ess scaling rule ari.
    MetricName string
    The name for the alarm's associated metric. See dimensions below for details.
    ScalingGroupId string
    The scaling group associated with this alarm, the 'ForceNew' attribute is available in 1.56.0+.
    Threshold string
    The value against which the specified statistics is compared.
    CloudMonitorGroupId int
    Defines the application group id defined by CMS which is assigned when you upload custom metric to CMS, only available for custom metirc.
    ComparisonOperator string
    The arithmetic operation to use when comparing the specified Statistic and Threshold. The specified Statistic value is used as the first operand. Supported value: >=, <=, >, <. Defaults to >=.
    Description string
    The description for the alarm.
    Dimensions Dictionary<string, object>
    The dimension map for the alarm's associated metric. For all metrics, you can not set the dimension key as "scaling_group" or "userId", which is set by default, the second dimension for metric, such as "device" for "PackagesNetIn", need to be set by users. See dimensions below.
    Enable bool
    Whether to enable specific ess alarm. Default to true.
    EvaluationCount int
    The number of times that needs to satisfies comparison condition before transition into ALARM state. Defaults to 3.
    MetricType string
    The type for the alarm's associated metric. Supported value: system, custom. "system" means the metric data is collected by Aliyun Cloud Monitor Service(CMS), "custom" means the metric data is upload to CMS by users. Defaults to system.
    Name string
    The name for ess alarm.
    Period int
    The period in seconds over which the specified statistic is applied. Supported value: 60, 120, 300, 900. Defaults to 300.
    Statistics string
    The statistic to apply to the alarm's associated metric. Supported value: Average, Minimum, Maximum. Defaults to Average.
    AlarmActions []string
    The list of actions to execute when this alarm transition into an ALARM state. Each action is specified as ess scaling rule ari.
    MetricName string
    The name for the alarm's associated metric. See dimensions below for details.
    ScalingGroupId string
    The scaling group associated with this alarm, the 'ForceNew' attribute is available in 1.56.0+.
    Threshold string
    The value against which the specified statistics is compared.
    CloudMonitorGroupId int
    Defines the application group id defined by CMS which is assigned when you upload custom metric to CMS, only available for custom metirc.
    ComparisonOperator string
    The arithmetic operation to use when comparing the specified Statistic and Threshold. The specified Statistic value is used as the first operand. Supported value: >=, <=, >, <. Defaults to >=.
    Description string
    The description for the alarm.
    Dimensions map[string]interface{}
    The dimension map for the alarm's associated metric. For all metrics, you can not set the dimension key as "scaling_group" or "userId", which is set by default, the second dimension for metric, such as "device" for "PackagesNetIn", need to be set by users. See dimensions below.
    Enable bool
    Whether to enable specific ess alarm. Default to true.
    EvaluationCount int
    The number of times that needs to satisfies comparison condition before transition into ALARM state. Defaults to 3.
    MetricType string
    The type for the alarm's associated metric. Supported value: system, custom. "system" means the metric data is collected by Aliyun Cloud Monitor Service(CMS), "custom" means the metric data is upload to CMS by users. Defaults to system.
    Name string
    The name for ess alarm.
    Period int
    The period in seconds over which the specified statistic is applied. Supported value: 60, 120, 300, 900. Defaults to 300.
    Statistics string
    The statistic to apply to the alarm's associated metric. Supported value: Average, Minimum, Maximum. Defaults to Average.
    alarmActions List<String>
    The list of actions to execute when this alarm transition into an ALARM state. Each action is specified as ess scaling rule ari.
    metricName String
    The name for the alarm's associated metric. See dimensions below for details.
    scalingGroupId String
    The scaling group associated with this alarm, the 'ForceNew' attribute is available in 1.56.0+.
    threshold String
    The value against which the specified statistics is compared.
    cloudMonitorGroupId Integer
    Defines the application group id defined by CMS which is assigned when you upload custom metric to CMS, only available for custom metirc.
    comparisonOperator String
    The arithmetic operation to use when comparing the specified Statistic and Threshold. The specified Statistic value is used as the first operand. Supported value: >=, <=, >, <. Defaults to >=.
    description String
    The description for the alarm.
    dimensions Map<String,Object>
    The dimension map for the alarm's associated metric. For all metrics, you can not set the dimension key as "scaling_group" or "userId", which is set by default, the second dimension for metric, such as "device" for "PackagesNetIn", need to be set by users. See dimensions below.
    enable Boolean
    Whether to enable specific ess alarm. Default to true.
    evaluationCount Integer
    The number of times that needs to satisfies comparison condition before transition into ALARM state. Defaults to 3.
    metricType String
    The type for the alarm's associated metric. Supported value: system, custom. "system" means the metric data is collected by Aliyun Cloud Monitor Service(CMS), "custom" means the metric data is upload to CMS by users. Defaults to system.
    name String
    The name for ess alarm.
    period Integer
    The period in seconds over which the specified statistic is applied. Supported value: 60, 120, 300, 900. Defaults to 300.
    statistics String
    The statistic to apply to the alarm's associated metric. Supported value: Average, Minimum, Maximum. Defaults to Average.
    alarmActions string[]
    The list of actions to execute when this alarm transition into an ALARM state. Each action is specified as ess scaling rule ari.
    metricName string
    The name for the alarm's associated metric. See dimensions below for details.
    scalingGroupId string
    The scaling group associated with this alarm, the 'ForceNew' attribute is available in 1.56.0+.
    threshold string
    The value against which the specified statistics is compared.
    cloudMonitorGroupId number
    Defines the application group id defined by CMS which is assigned when you upload custom metric to CMS, only available for custom metirc.
    comparisonOperator string
    The arithmetic operation to use when comparing the specified Statistic and Threshold. The specified Statistic value is used as the first operand. Supported value: >=, <=, >, <. Defaults to >=.
    description string
    The description for the alarm.
    dimensions {[key: string]: any}
    The dimension map for the alarm's associated metric. For all metrics, you can not set the dimension key as "scaling_group" or "userId", which is set by default, the second dimension for metric, such as "device" for "PackagesNetIn", need to be set by users. See dimensions below.
    enable boolean
    Whether to enable specific ess alarm. Default to true.
    evaluationCount number
    The number of times that needs to satisfies comparison condition before transition into ALARM state. Defaults to 3.
    metricType string
    The type for the alarm's associated metric. Supported value: system, custom. "system" means the metric data is collected by Aliyun Cloud Monitor Service(CMS), "custom" means the metric data is upload to CMS by users. Defaults to system.
    name string
    The name for ess alarm.
    period number
    The period in seconds over which the specified statistic is applied. Supported value: 60, 120, 300, 900. Defaults to 300.
    statistics string
    The statistic to apply to the alarm's associated metric. Supported value: Average, Minimum, Maximum. Defaults to Average.
    alarm_actions Sequence[str]
    The list of actions to execute when this alarm transition into an ALARM state. Each action is specified as ess scaling rule ari.
    metric_name str
    The name for the alarm's associated metric. See dimensions below for details.
    scaling_group_id str
    The scaling group associated with this alarm, the 'ForceNew' attribute is available in 1.56.0+.
    threshold str
    The value against which the specified statistics is compared.
    cloud_monitor_group_id int
    Defines the application group id defined by CMS which is assigned when you upload custom metric to CMS, only available for custom metirc.
    comparison_operator str
    The arithmetic operation to use when comparing the specified Statistic and Threshold. The specified Statistic value is used as the first operand. Supported value: >=, <=, >, <. Defaults to >=.
    description str
    The description for the alarm.
    dimensions Mapping[str, Any]
    The dimension map for the alarm's associated metric. For all metrics, you can not set the dimension key as "scaling_group" or "userId", which is set by default, the second dimension for metric, such as "device" for "PackagesNetIn", need to be set by users. See dimensions below.
    enable bool
    Whether to enable specific ess alarm. Default to true.
    evaluation_count int
    The number of times that needs to satisfies comparison condition before transition into ALARM state. Defaults to 3.
    metric_type str
    The type for the alarm's associated metric. Supported value: system, custom. "system" means the metric data is collected by Aliyun Cloud Monitor Service(CMS), "custom" means the metric data is upload to CMS by users. Defaults to system.
    name str
    The name for ess alarm.
    period int
    The period in seconds over which the specified statistic is applied. Supported value: 60, 120, 300, 900. Defaults to 300.
    statistics str
    The statistic to apply to the alarm's associated metric. Supported value: Average, Minimum, Maximum. Defaults to Average.
    alarmActions List<String>
    The list of actions to execute when this alarm transition into an ALARM state. Each action is specified as ess scaling rule ari.
    metricName String
    The name for the alarm's associated metric. See dimensions below for details.
    scalingGroupId String
    The scaling group associated with this alarm, the 'ForceNew' attribute is available in 1.56.0+.
    threshold String
    The value against which the specified statistics is compared.
    cloudMonitorGroupId Number
    Defines the application group id defined by CMS which is assigned when you upload custom metric to CMS, only available for custom metirc.
    comparisonOperator String
    The arithmetic operation to use when comparing the specified Statistic and Threshold. The specified Statistic value is used as the first operand. Supported value: >=, <=, >, <. Defaults to >=.
    description String
    The description for the alarm.
    dimensions Map<Any>
    The dimension map for the alarm's associated metric. For all metrics, you can not set the dimension key as "scaling_group" or "userId", which is set by default, the second dimension for metric, such as "device" for "PackagesNetIn", need to be set by users. See dimensions below.
    enable Boolean
    Whether to enable specific ess alarm. Default to true.
    evaluationCount Number
    The number of times that needs to satisfies comparison condition before transition into ALARM state. Defaults to 3.
    metricType String
    The type for the alarm's associated metric. Supported value: system, custom. "system" means the metric data is collected by Aliyun Cloud Monitor Service(CMS), "custom" means the metric data is upload to CMS by users. Defaults to system.
    name String
    The name for ess alarm.
    period Number
    The period in seconds over which the specified statistic is applied. Supported value: 60, 120, 300, 900. Defaults to 300.
    statistics String
    The statistic to apply to the alarm's associated metric. Supported value: Average, Minimum, Maximum. Defaults to Average.

    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.
    State string
    The status of the event-triggered task. Valid values:

    • ALARM: The alert condition is met and an alert is triggered.
    • OK: The alert condition is not met.
    • INSUFFICIENT_DATA: Auto Scaling cannot determine whether the alert condition is met due to insufficient data.
    Id string
    The provider-assigned unique ID for this managed resource.
    State string
    The status of the event-triggered task. Valid values:

    • ALARM: The alert condition is met and an alert is triggered.
    • OK: The alert condition is not met.
    • INSUFFICIENT_DATA: Auto Scaling cannot determine whether the alert condition is met due to insufficient data.
    id String
    The provider-assigned unique ID for this managed resource.
    state String
    The status of the event-triggered task. Valid values:

    • ALARM: The alert condition is met and an alert is triggered.
    • OK: The alert condition is not met.
    • INSUFFICIENT_DATA: Auto Scaling cannot determine whether the alert condition is met due to insufficient data.
    id string
    The provider-assigned unique ID for this managed resource.
    state string
    The status of the event-triggered task. Valid values:

    • ALARM: The alert condition is met and an alert is triggered.
    • OK: The alert condition is not met.
    • INSUFFICIENT_DATA: Auto Scaling cannot determine whether the alert condition is met due to insufficient data.
    id str
    The provider-assigned unique ID for this managed resource.
    state str
    The status of the event-triggered task. Valid values:

    • ALARM: The alert condition is met and an alert is triggered.
    • OK: The alert condition is not met.
    • INSUFFICIENT_DATA: Auto Scaling cannot determine whether the alert condition is met due to insufficient data.
    id String
    The provider-assigned unique ID for this managed resource.
    state String
    The status of the event-triggered task. Valid values:

    • ALARM: The alert condition is met and an alert is triggered.
    • OK: The alert condition is not met.
    • INSUFFICIENT_DATA: Auto Scaling cannot determine whether the alert condition is met due to insufficient data.

    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,
            alarm_actions: Optional[Sequence[str]] = None,
            cloud_monitor_group_id: Optional[int] = None,
            comparison_operator: Optional[str] = None,
            description: Optional[str] = None,
            dimensions: Optional[Mapping[str, Any]] = None,
            enable: Optional[bool] = None,
            evaluation_count: Optional[int] = None,
            metric_name: Optional[str] = None,
            metric_type: Optional[str] = None,
            name: Optional[str] = None,
            period: Optional[int] = None,
            scaling_group_id: Optional[str] = None,
            state: Optional[str] = None,
            statistics: Optional[str] = None,
            threshold: 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)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    AlarmActions List<string>
    The list of actions to execute when this alarm transition into an ALARM state. Each action is specified as ess scaling rule ari.
    CloudMonitorGroupId int
    Defines the application group id defined by CMS which is assigned when you upload custom metric to CMS, only available for custom metirc.
    ComparisonOperator string
    The arithmetic operation to use when comparing the specified Statistic and Threshold. The specified Statistic value is used as the first operand. Supported value: >=, <=, >, <. Defaults to >=.
    Description string
    The description for the alarm.
    Dimensions Dictionary<string, object>
    The dimension map for the alarm's associated metric. For all metrics, you can not set the dimension key as "scaling_group" or "userId", which is set by default, the second dimension for metric, such as "device" for "PackagesNetIn", need to be set by users. See dimensions below.
    Enable bool
    Whether to enable specific ess alarm. Default to true.
    EvaluationCount int
    The number of times that needs to satisfies comparison condition before transition into ALARM state. Defaults to 3.
    MetricName string
    The name for the alarm's associated metric. See dimensions below for details.
    MetricType string
    The type for the alarm's associated metric. Supported value: system, custom. "system" means the metric data is collected by Aliyun Cloud Monitor Service(CMS), "custom" means the metric data is upload to CMS by users. Defaults to system.
    Name string
    The name for ess alarm.
    Period int
    The period in seconds over which the specified statistic is applied. Supported value: 60, 120, 300, 900. Defaults to 300.
    ScalingGroupId string
    The scaling group associated with this alarm, the 'ForceNew' attribute is available in 1.56.0+.
    State string
    The status of the event-triggered task. Valid values:

    • ALARM: The alert condition is met and an alert is triggered.
    • OK: The alert condition is not met.
    • INSUFFICIENT_DATA: Auto Scaling cannot determine whether the alert condition is met due to insufficient data.
    Statistics string
    The statistic to apply to the alarm's associated metric. Supported value: Average, Minimum, Maximum. Defaults to Average.
    Threshold string
    The value against which the specified statistics is compared.
    AlarmActions []string
    The list of actions to execute when this alarm transition into an ALARM state. Each action is specified as ess scaling rule ari.
    CloudMonitorGroupId int
    Defines the application group id defined by CMS which is assigned when you upload custom metric to CMS, only available for custom metirc.
    ComparisonOperator string
    The arithmetic operation to use when comparing the specified Statistic and Threshold. The specified Statistic value is used as the first operand. Supported value: >=, <=, >, <. Defaults to >=.
    Description string
    The description for the alarm.
    Dimensions map[string]interface{}
    The dimension map for the alarm's associated metric. For all metrics, you can not set the dimension key as "scaling_group" or "userId", which is set by default, the second dimension for metric, such as "device" for "PackagesNetIn", need to be set by users. See dimensions below.
    Enable bool
    Whether to enable specific ess alarm. Default to true.
    EvaluationCount int
    The number of times that needs to satisfies comparison condition before transition into ALARM state. Defaults to 3.
    MetricName string
    The name for the alarm's associated metric. See dimensions below for details.
    MetricType string
    The type for the alarm's associated metric. Supported value: system, custom. "system" means the metric data is collected by Aliyun Cloud Monitor Service(CMS), "custom" means the metric data is upload to CMS by users. Defaults to system.
    Name string
    The name for ess alarm.
    Period int
    The period in seconds over which the specified statistic is applied. Supported value: 60, 120, 300, 900. Defaults to 300.
    ScalingGroupId string
    The scaling group associated with this alarm, the 'ForceNew' attribute is available in 1.56.0+.
    State string
    The status of the event-triggered task. Valid values:

    • ALARM: The alert condition is met and an alert is triggered.
    • OK: The alert condition is not met.
    • INSUFFICIENT_DATA: Auto Scaling cannot determine whether the alert condition is met due to insufficient data.
    Statistics string
    The statistic to apply to the alarm's associated metric. Supported value: Average, Minimum, Maximum. Defaults to Average.
    Threshold string
    The value against which the specified statistics is compared.
    alarmActions List<String>
    The list of actions to execute when this alarm transition into an ALARM state. Each action is specified as ess scaling rule ari.
    cloudMonitorGroupId Integer
    Defines the application group id defined by CMS which is assigned when you upload custom metric to CMS, only available for custom metirc.
    comparisonOperator String
    The arithmetic operation to use when comparing the specified Statistic and Threshold. The specified Statistic value is used as the first operand. Supported value: >=, <=, >, <. Defaults to >=.
    description String
    The description for the alarm.
    dimensions Map<String,Object>
    The dimension map for the alarm's associated metric. For all metrics, you can not set the dimension key as "scaling_group" or "userId", which is set by default, the second dimension for metric, such as "device" for "PackagesNetIn", need to be set by users. See dimensions below.
    enable Boolean
    Whether to enable specific ess alarm. Default to true.
    evaluationCount Integer
    The number of times that needs to satisfies comparison condition before transition into ALARM state. Defaults to 3.
    metricName String
    The name for the alarm's associated metric. See dimensions below for details.
    metricType String
    The type for the alarm's associated metric. Supported value: system, custom. "system" means the metric data is collected by Aliyun Cloud Monitor Service(CMS), "custom" means the metric data is upload to CMS by users. Defaults to system.
    name String
    The name for ess alarm.
    period Integer
    The period in seconds over which the specified statistic is applied. Supported value: 60, 120, 300, 900. Defaults to 300.
    scalingGroupId String
    The scaling group associated with this alarm, the 'ForceNew' attribute is available in 1.56.0+.
    state String
    The status of the event-triggered task. Valid values:

    • ALARM: The alert condition is met and an alert is triggered.
    • OK: The alert condition is not met.
    • INSUFFICIENT_DATA: Auto Scaling cannot determine whether the alert condition is met due to insufficient data.
    statistics String
    The statistic to apply to the alarm's associated metric. Supported value: Average, Minimum, Maximum. Defaults to Average.
    threshold String
    The value against which the specified statistics is compared.
    alarmActions string[]
    The list of actions to execute when this alarm transition into an ALARM state. Each action is specified as ess scaling rule ari.
    cloudMonitorGroupId number
    Defines the application group id defined by CMS which is assigned when you upload custom metric to CMS, only available for custom metirc.
    comparisonOperator string
    The arithmetic operation to use when comparing the specified Statistic and Threshold. The specified Statistic value is used as the first operand. Supported value: >=, <=, >, <. Defaults to >=.
    description string
    The description for the alarm.
    dimensions {[key: string]: any}
    The dimension map for the alarm's associated metric. For all metrics, you can not set the dimension key as "scaling_group" or "userId", which is set by default, the second dimension for metric, such as "device" for "PackagesNetIn", need to be set by users. See dimensions below.
    enable boolean
    Whether to enable specific ess alarm. Default to true.
    evaluationCount number
    The number of times that needs to satisfies comparison condition before transition into ALARM state. Defaults to 3.
    metricName string
    The name for the alarm's associated metric. See dimensions below for details.
    metricType string
    The type for the alarm's associated metric. Supported value: system, custom. "system" means the metric data is collected by Aliyun Cloud Monitor Service(CMS), "custom" means the metric data is upload to CMS by users. Defaults to system.
    name string
    The name for ess alarm.
    period number
    The period in seconds over which the specified statistic is applied. Supported value: 60, 120, 300, 900. Defaults to 300.
    scalingGroupId string
    The scaling group associated with this alarm, the 'ForceNew' attribute is available in 1.56.0+.
    state string
    The status of the event-triggered task. Valid values:

    • ALARM: The alert condition is met and an alert is triggered.
    • OK: The alert condition is not met.
    • INSUFFICIENT_DATA: Auto Scaling cannot determine whether the alert condition is met due to insufficient data.
    statistics string
    The statistic to apply to the alarm's associated metric. Supported value: Average, Minimum, Maximum. Defaults to Average.
    threshold string
    The value against which the specified statistics is compared.
    alarm_actions Sequence[str]
    The list of actions to execute when this alarm transition into an ALARM state. Each action is specified as ess scaling rule ari.
    cloud_monitor_group_id int
    Defines the application group id defined by CMS which is assigned when you upload custom metric to CMS, only available for custom metirc.
    comparison_operator str
    The arithmetic operation to use when comparing the specified Statistic and Threshold. The specified Statistic value is used as the first operand. Supported value: >=, <=, >, <. Defaults to >=.
    description str
    The description for the alarm.
    dimensions Mapping[str, Any]
    The dimension map for the alarm's associated metric. For all metrics, you can not set the dimension key as "scaling_group" or "userId", which is set by default, the second dimension for metric, such as "device" for "PackagesNetIn", need to be set by users. See dimensions below.
    enable bool
    Whether to enable specific ess alarm. Default to true.
    evaluation_count int
    The number of times that needs to satisfies comparison condition before transition into ALARM state. Defaults to 3.
    metric_name str
    The name for the alarm's associated metric. See dimensions below for details.
    metric_type str
    The type for the alarm's associated metric. Supported value: system, custom. "system" means the metric data is collected by Aliyun Cloud Monitor Service(CMS), "custom" means the metric data is upload to CMS by users. Defaults to system.
    name str
    The name for ess alarm.
    period int
    The period in seconds over which the specified statistic is applied. Supported value: 60, 120, 300, 900. Defaults to 300.
    scaling_group_id str
    The scaling group associated with this alarm, the 'ForceNew' attribute is available in 1.56.0+.
    state str
    The status of the event-triggered task. Valid values:

    • ALARM: The alert condition is met and an alert is triggered.
    • OK: The alert condition is not met.
    • INSUFFICIENT_DATA: Auto Scaling cannot determine whether the alert condition is met due to insufficient data.
    statistics str
    The statistic to apply to the alarm's associated metric. Supported value: Average, Minimum, Maximum. Defaults to Average.
    threshold str
    The value against which the specified statistics is compared.
    alarmActions List<String>
    The list of actions to execute when this alarm transition into an ALARM state. Each action is specified as ess scaling rule ari.
    cloudMonitorGroupId Number
    Defines the application group id defined by CMS which is assigned when you upload custom metric to CMS, only available for custom metirc.
    comparisonOperator String
    The arithmetic operation to use when comparing the specified Statistic and Threshold. The specified Statistic value is used as the first operand. Supported value: >=, <=, >, <. Defaults to >=.
    description String
    The description for the alarm.
    dimensions Map<Any>
    The dimension map for the alarm's associated metric. For all metrics, you can not set the dimension key as "scaling_group" or "userId", which is set by default, the second dimension for metric, such as "device" for "PackagesNetIn", need to be set by users. See dimensions below.
    enable Boolean
    Whether to enable specific ess alarm. Default to true.
    evaluationCount Number
    The number of times that needs to satisfies comparison condition before transition into ALARM state. Defaults to 3.
    metricName String
    The name for the alarm's associated metric. See dimensions below for details.
    metricType String
    The type for the alarm's associated metric. Supported value: system, custom. "system" means the metric data is collected by Aliyun Cloud Monitor Service(CMS), "custom" means the metric data is upload to CMS by users. Defaults to system.
    name String
    The name for ess alarm.
    period Number
    The period in seconds over which the specified statistic is applied. Supported value: 60, 120, 300, 900. Defaults to 300.
    scalingGroupId String
    The scaling group associated with this alarm, the 'ForceNew' attribute is available in 1.56.0+.
    state String
    The status of the event-triggered task. Valid values:

    • ALARM: The alert condition is met and an alert is triggered.
    • OK: The alert condition is not met.
    • INSUFFICIENT_DATA: Auto Scaling cannot determine whether the alert condition is met due to insufficient data.
    statistics String
    The statistic to apply to the alarm's associated metric. Supported value: Average, Minimum, Maximum. Defaults to Average.
    threshold String
    The value against which the specified statistics is compared.

    Import

    Ess alarm can be imported using the id, e.g.

    $ pulumi import alicloud:ess/alarm:Alarm example asg-2ze500_045efffe-4d05
    

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.51.0 published on Saturday, Mar 23, 2024 by Pulumi