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

alicloud.ess.ScalingRule

Explore with Pulumi AI

Provides a ESS scaling rule resource.

For information about ess scaling rule, see CreateScalingRule.

NOTE: Available since v1.39.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 defaultInteger = new random.index.Integer("default", {
    min: 10000,
    max: 99999,
});
const myName = `${name}-${defaultInteger.result}`;
const _default = alicloud.getZones({
    availableDiskCategory: "cloud_efficiency",
    availableResourceCreation: "VSwitch",
});
const defaultGetInstanceTypes = _default.then(_default => alicloud.ecs.getInstanceTypes({
    availabilityZone: _default.zones?.[0]?.id,
    cpuCoreCount: 2,
    memorySize: 4,
}));
const defaultGetImages = alicloud.ecs.getImages({
    nameRegex: "^ubuntu_18.*64",
    mostRecent: true,
    owners: "system",
});
const defaultNetwork = new alicloud.vpc.Network("default", {
    vpcName: myName,
    cidrBlock: "172.16.0.0/16",
});
const defaultSwitch = new alicloud.vpc.Switch("default", {
    vpcId: defaultNetwork.id,
    cidrBlock: "172.16.0.0/24",
    zoneId: _default.then(_default => _default.zones?.[0]?.id),
    vswitchName: myName,
});
const defaultSecurityGroup = new alicloud.ecs.SecurityGroup("default", {
    securityGroupName: myName,
    vpcId: defaultNetwork.id,
});
const defaultSecurityGroupRule = new alicloud.ecs.SecurityGroupRule("default", {
    type: "ingress",
    ipProtocol: "tcp",
    nicType: "intranet",
    policy: "accept",
    portRange: "22/22",
    priority: 1,
    securityGroupId: defaultSecurityGroup.id,
    cidrIp: "172.16.0.0/24",
});
const defaultScalingGroup = new alicloud.ess.ScalingGroup("default", {
    minSize: 1,
    maxSize: 1,
    scalingGroupName: myName,
    vswitchIds: [defaultSwitch.id],
    removalPolicies: [
        "OldestInstance",
        "NewestInstance",
    ],
});
const defaultScalingConfiguration = new alicloud.ess.ScalingConfiguration("default", {
    scalingGroupId: defaultScalingGroup.id,
    imageId: defaultGetImages.then(defaultGetImages => defaultGetImages.images?.[0]?.id),
    instanceType: defaultGetInstanceTypes.then(defaultGetInstanceTypes => defaultGetInstanceTypes.instanceTypes?.[0]?.id),
    securityGroupId: defaultSecurityGroup.id,
    forceDelete: true,
});
const defaultScalingRule = new alicloud.ess.ScalingRule("default", {
    scalingGroupId: defaultScalingGroup.id,
    adjustmentType: "TotalCapacity",
    adjustmentValue: 1,
});
Copy
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_integer = random.index.Integer("default",
    min=10000,
    max=99999)
my_name = f"{name}-{default_integer['result']}"
default = alicloud.get_zones(available_disk_category="cloud_efficiency",
    available_resource_creation="VSwitch")
default_get_instance_types = alicloud.ecs.get_instance_types(availability_zone=default.zones[0].id,
    cpu_core_count=2,
    memory_size=4)
default_get_images = alicloud.ecs.get_images(name_regex="^ubuntu_18.*64",
    most_recent=True,
    owners="system")
default_network = alicloud.vpc.Network("default",
    vpc_name=my_name,
    cidr_block="172.16.0.0/16")
default_switch = alicloud.vpc.Switch("default",
    vpc_id=default_network.id,
    cidr_block="172.16.0.0/24",
    zone_id=default.zones[0].id,
    vswitch_name=my_name)
default_security_group = alicloud.ecs.SecurityGroup("default",
    security_group_name=my_name,
    vpc_id=default_network.id)
default_security_group_rule = alicloud.ecs.SecurityGroupRule("default",
    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")
default_scaling_group = alicloud.ess.ScalingGroup("default",
    min_size=1,
    max_size=1,
    scaling_group_name=my_name,
    vswitch_ids=[default_switch.id],
    removal_policies=[
        "OldestInstance",
        "NewestInstance",
    ])
default_scaling_configuration = alicloud.ess.ScalingConfiguration("default",
    scaling_group_id=default_scaling_group.id,
    image_id=default_get_images.images[0].id,
    instance_type=default_get_instance_types.instance_types[0].id,
    security_group_id=default_security_group.id,
    force_delete=True)
default_scaling_rule = alicloud.ess.ScalingRule("default",
    scaling_group_id=default_scaling_group.id,
    adjustment_type="TotalCapacity",
    adjustment_value=1)
Copy
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
		}
		defaultInteger, err := random.NewInteger(ctx, "default", &random.IntegerArgs{
			Min: 10000,
			Max: 99999,
		})
		if err != nil {
			return err
		}
		myName := fmt.Sprintf("%v-%v", name, defaultInteger.Result)
		_default, err := alicloud.GetZones(ctx, &alicloud.GetZonesArgs{
			AvailableDiskCategory:     pulumi.StringRef("cloud_efficiency"),
			AvailableResourceCreation: pulumi.StringRef("VSwitch"),
		}, nil)
		if err != nil {
			return err
		}
		defaultGetInstanceTypes, err := ecs.GetInstanceTypes(ctx, &ecs.GetInstanceTypesArgs{
			AvailabilityZone: pulumi.StringRef(_default.Zones[0].Id),
			CpuCoreCount:     pulumi.IntRef(2),
			MemorySize:       pulumi.Float64Ref(4),
		}, nil)
		if err != nil {
			return err
		}
		defaultGetImages, 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, "default", &vpc.NetworkArgs{
			VpcName:   pulumi.String(myName),
			CidrBlock: pulumi.String("172.16.0.0/16"),
		})
		if err != nil {
			return err
		}
		defaultSwitch, err := vpc.NewSwitch(ctx, "default", &vpc.SwitchArgs{
			VpcId:       defaultNetwork.ID(),
			CidrBlock:   pulumi.String("172.16.0.0/24"),
			ZoneId:      pulumi.String(_default.Zones[0].Id),
			VswitchName: pulumi.String(myName),
		})
		if err != nil {
			return err
		}
		defaultSecurityGroup, err := ecs.NewSecurityGroup(ctx, "default", &ecs.SecurityGroupArgs{
			SecurityGroupName: pulumi.String(myName),
			VpcId:             defaultNetwork.ID(),
		})
		if err != nil {
			return err
		}
		_, err = ecs.NewSecurityGroupRule(ctx, "default", &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
		}
		defaultScalingGroup, err := ess.NewScalingGroup(ctx, "default", &ess.ScalingGroupArgs{
			MinSize:          pulumi.Int(1),
			MaxSize:          pulumi.Int(1),
			ScalingGroupName: pulumi.String(myName),
			VswitchIds: pulumi.StringArray{
				defaultSwitch.ID(),
			},
			RemovalPolicies: pulumi.StringArray{
				pulumi.String("OldestInstance"),
				pulumi.String("NewestInstance"),
			},
		})
		if err != nil {
			return err
		}
		_, err = ess.NewScalingConfiguration(ctx, "default", &ess.ScalingConfigurationArgs{
			ScalingGroupId:  defaultScalingGroup.ID(),
			ImageId:         pulumi.String(defaultGetImages.Images[0].Id),
			InstanceType:    pulumi.String(defaultGetInstanceTypes.InstanceTypes[0].Id),
			SecurityGroupId: defaultSecurityGroup.ID(),
			ForceDelete:     pulumi.Bool(true),
		})
		if err != nil {
			return err
		}
		_, err = ess.NewScalingRule(ctx, "default", &ess.ScalingRuleArgs{
			ScalingGroupId:  defaultScalingGroup.ID(),
			AdjustmentType:  pulumi.String("TotalCapacity"),
			AdjustmentValue: pulumi.Int(1),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
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 defaultInteger = new Random.Index.Integer("default", new()
    {
        Min = 10000,
        Max = 99999,
    });

    var myName = $"{name}-{defaultInteger.Result}";

    var @default = AliCloud.GetZones.Invoke(new()
    {
        AvailableDiskCategory = "cloud_efficiency",
        AvailableResourceCreation = "VSwitch",
    });

    var defaultGetInstanceTypes = AliCloud.Ecs.GetInstanceTypes.Invoke(new()
    {
        AvailabilityZone = @default.Apply(getZonesResult => getZonesResult.Zones[0]?.Id),
        CpuCoreCount = 2,
        MemorySize = 4,
    });

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

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

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

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

    var defaultSecurityGroupRule = new AliCloud.Ecs.SecurityGroupRule("default", new()
    {
        Type = "ingress",
        IpProtocol = "tcp",
        NicType = "intranet",
        Policy = "accept",
        PortRange = "22/22",
        Priority = 1,
        SecurityGroupId = defaultSecurityGroup.Id,
        CidrIp = "172.16.0.0/24",
    });

    var defaultScalingGroup = new AliCloud.Ess.ScalingGroup("default", new()
    {
        MinSize = 1,
        MaxSize = 1,
        ScalingGroupName = myName,
        VswitchIds = new[]
        {
            defaultSwitch.Id,
        },
        RemovalPolicies = new[]
        {
            "OldestInstance",
            "NewestInstance",
        },
    });

    var defaultScalingConfiguration = new AliCloud.Ess.ScalingConfiguration("default", new()
    {
        ScalingGroupId = defaultScalingGroup.Id,
        ImageId = defaultGetImages.Apply(getImagesResult => getImagesResult.Images[0]?.Id),
        InstanceType = defaultGetInstanceTypes.Apply(getInstanceTypesResult => getInstanceTypesResult.InstanceTypes[0]?.Id),
        SecurityGroupId = defaultSecurityGroup.Id,
        ForceDelete = true,
    });

    var defaultScalingRule = new AliCloud.Ess.ScalingRule("default", new()
    {
        ScalingGroupId = defaultScalingGroup.Id,
        AdjustmentType = "TotalCapacity",
        AdjustmentValue = 1,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.random.integer;
import com.pulumi.random.IntegerArgs;
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.ScalingConfiguration;
import com.pulumi.alicloud.ess.ScalingConfigurationArgs;
import com.pulumi.alicloud.ess.ScalingRule;
import com.pulumi.alicloud.ess.ScalingRuleArgs;
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 defaultInteger = new Integer("defaultInteger", IntegerArgs.builder()
            .min(10000)
            .max(99999)
            .build());

        final var myName = String.format("%s-%s", name,defaultInteger.result());

        final var default = AlicloudFunctions.getZones(GetZonesArgs.builder()
            .availableDiskCategory("cloud_efficiency")
            .availableResourceCreation("VSwitch")
            .build());

        final var defaultGetInstanceTypes = EcsFunctions.getInstanceTypes(GetInstanceTypesArgs.builder()
            .availabilityZone(default_.zones()[0].id())
            .cpuCoreCount(2)
            .memorySize(4)
            .build());

        final var defaultGetImages = 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(default_.zones()[0].id())
            .vswitchName(myName)
            .build());

        var defaultSecurityGroup = new SecurityGroup("defaultSecurityGroup", SecurityGroupArgs.builder()
            .securityGroupName(myName)
            .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 defaultScalingGroup = new ScalingGroup("defaultScalingGroup", ScalingGroupArgs.builder()
            .minSize(1)
            .maxSize(1)
            .scalingGroupName(myName)
            .vswitchIds(defaultSwitch.id())
            .removalPolicies(            
                "OldestInstance",
                "NewestInstance")
            .build());

        var defaultScalingConfiguration = new ScalingConfiguration("defaultScalingConfiguration", ScalingConfigurationArgs.builder()
            .scalingGroupId(defaultScalingGroup.id())
            .imageId(defaultGetImages.applyValue(getImagesResult -> getImagesResult.images()[0].id()))
            .instanceType(defaultGetInstanceTypes.applyValue(getInstanceTypesResult -> getInstanceTypesResult.instanceTypes()[0].id()))
            .securityGroupId(defaultSecurityGroup.id())
            .forceDelete("true")
            .build());

        var defaultScalingRule = new ScalingRule("defaultScalingRule", ScalingRuleArgs.builder()
            .scalingGroupId(defaultScalingGroup.id())
            .adjustmentType("TotalCapacity")
            .adjustmentValue(1)
            .build());

    }
}
Copy
configuration:
  name:
    type: string
    default: terraform-example
resources:
  defaultInteger:
    type: random:integer
    name: default
    properties:
      min: 10000
      max: 99999
  defaultNetwork:
    type: alicloud:vpc:Network
    name: default
    properties:
      vpcName: ${myName}
      cidrBlock: 172.16.0.0/16
  defaultSwitch:
    type: alicloud:vpc:Switch
    name: default
    properties:
      vpcId: ${defaultNetwork.id}
      cidrBlock: 172.16.0.0/24
      zoneId: ${default.zones[0].id}
      vswitchName: ${myName}
  defaultSecurityGroup:
    type: alicloud:ecs:SecurityGroup
    name: default
    properties:
      securityGroupName: ${myName}
      vpcId: ${defaultNetwork.id}
  defaultSecurityGroupRule:
    type: alicloud:ecs:SecurityGroupRule
    name: default
    properties:
      type: ingress
      ipProtocol: tcp
      nicType: intranet
      policy: accept
      portRange: 22/22
      priority: 1
      securityGroupId: ${defaultSecurityGroup.id}
      cidrIp: 172.16.0.0/24
  defaultScalingGroup:
    type: alicloud:ess:ScalingGroup
    name: default
    properties:
      minSize: 1
      maxSize: 1
      scalingGroupName: ${myName}
      vswitchIds:
        - ${defaultSwitch.id}
      removalPolicies:
        - OldestInstance
        - NewestInstance
  defaultScalingConfiguration:
    type: alicloud:ess:ScalingConfiguration
    name: default
    properties:
      scalingGroupId: ${defaultScalingGroup.id}
      imageId: ${defaultGetImages.images[0].id}
      instanceType: ${defaultGetInstanceTypes.instanceTypes[0].id}
      securityGroupId: ${defaultSecurityGroup.id}
      forceDelete: 'true'
  defaultScalingRule:
    type: alicloud:ess:ScalingRule
    name: default
    properties:
      scalingGroupId: ${defaultScalingGroup.id}
      adjustmentType: TotalCapacity
      adjustmentValue: 1
variables:
  myName: ${name}-${defaultInteger.result}
  default:
    fn::invoke:
      function: alicloud:getZones
      arguments:
        availableDiskCategory: cloud_efficiency
        availableResourceCreation: VSwitch
  defaultGetInstanceTypes:
    fn::invoke:
      function: alicloud:ecs:getInstanceTypes
      arguments:
        availabilityZone: ${default.zones[0].id}
        cpuCoreCount: 2
        memorySize: 4
  defaultGetImages:
    fn::invoke:
      function: alicloud:ecs:getImages
      arguments:
        nameRegex: ^ubuntu_18.*64
        mostRecent: true
        owners: system
Copy

Module Support

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

Create ScalingRule Resource

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

Constructor syntax

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

@overload
def ScalingRule(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                scaling_group_id: Optional[str] = None,
                metric_type: Optional[str] = None,
                cooldown: Optional[int] = None,
                predictive_scaling_mode: Optional[str] = None,
                disable_scale_in: Optional[bool] = None,
                estimated_instance_warmup: Optional[int] = None,
                hybrid_metrics: Optional[Sequence[ScalingRuleHybridMetricArgs]] = None,
                hybrid_monitor_namespace: Optional[str] = None,
                initial_max_size: Optional[int] = None,
                predictive_task_buffer_time: Optional[int] = None,
                adjustment_type: Optional[str] = None,
                target_value: Optional[float] = None,
                alarm_dimension: Optional[ScalingRuleAlarmDimensionArgs] = None,
                metric_name: Optional[str] = None,
                predictive_value_behavior: Optional[str] = None,
                predictive_value_buffer: Optional[int] = None,
                scale_in_evaluation_count: Optional[int] = None,
                scale_out_evaluation_count: Optional[int] = None,
                adjustment_value: Optional[int] = None,
                scaling_rule_name: Optional[str] = None,
                scaling_rule_type: Optional[str] = None,
                step_adjustments: Optional[Sequence[ScalingRuleStepAdjustmentArgs]] = None,
                min_adjustment_magnitude: Optional[int] = None)
func NewScalingRule(ctx *Context, name string, args ScalingRuleArgs, opts ...ResourceOption) (*ScalingRule, error)
public ScalingRule(string name, ScalingRuleArgs args, CustomResourceOptions? opts = null)
public ScalingRule(String name, ScalingRuleArgs args)
public ScalingRule(String name, ScalingRuleArgs args, CustomResourceOptions options)
type: alicloud:ess:ScalingRule
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. ScalingRuleArgs
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. ScalingRuleArgs
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. ScalingRuleArgs
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. ScalingRuleArgs
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. ScalingRuleArgs
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 scalingRuleResource = new AliCloud.Ess.ScalingRule("scalingRuleResource", new()
{
    ScalingGroupId = "string",
    MetricType = "string",
    Cooldown = 0,
    PredictiveScalingMode = "string",
    DisableScaleIn = false,
    EstimatedInstanceWarmup = 0,
    HybridMetrics = new[]
    {
        new AliCloud.Ess.Inputs.ScalingRuleHybridMetricArgs
        {
            Dimensions = new[]
            {
                new AliCloud.Ess.Inputs.ScalingRuleHybridMetricDimensionArgs
                {
                    DimensionKey = "string",
                    DimensionValue = "string",
                },
            },
            Expression = "string",
            Id = "string",
            MetricName = "string",
            Statistic = "string",
        },
    },
    HybridMonitorNamespace = "string",
    InitialMaxSize = 0,
    PredictiveTaskBufferTime = 0,
    AdjustmentType = "string",
    TargetValue = 0,
    AlarmDimension = new AliCloud.Ess.Inputs.ScalingRuleAlarmDimensionArgs
    {
        DimensionKey = "string",
        DimensionValue = "string",
    },
    MetricName = "string",
    PredictiveValueBehavior = "string",
    PredictiveValueBuffer = 0,
    ScaleInEvaluationCount = 0,
    ScaleOutEvaluationCount = 0,
    AdjustmentValue = 0,
    ScalingRuleName = "string",
    ScalingRuleType = "string",
    StepAdjustments = new[]
    {
        new AliCloud.Ess.Inputs.ScalingRuleStepAdjustmentArgs
        {
            MetricIntervalLowerBound = "string",
            MetricIntervalUpperBound = "string",
            ScalingAdjustment = 0,
        },
    },
    MinAdjustmentMagnitude = 0,
});
Copy
example, err := ess.NewScalingRule(ctx, "scalingRuleResource", &ess.ScalingRuleArgs{
	ScalingGroupId:          pulumi.String("string"),
	MetricType:              pulumi.String("string"),
	Cooldown:                pulumi.Int(0),
	PredictiveScalingMode:   pulumi.String("string"),
	DisableScaleIn:          pulumi.Bool(false),
	EstimatedInstanceWarmup: pulumi.Int(0),
	HybridMetrics: ess.ScalingRuleHybridMetricArray{
		&ess.ScalingRuleHybridMetricArgs{
			Dimensions: ess.ScalingRuleHybridMetricDimensionArray{
				&ess.ScalingRuleHybridMetricDimensionArgs{
					DimensionKey:   pulumi.String("string"),
					DimensionValue: pulumi.String("string"),
				},
			},
			Expression: pulumi.String("string"),
			Id:         pulumi.String("string"),
			MetricName: pulumi.String("string"),
			Statistic:  pulumi.String("string"),
		},
	},
	HybridMonitorNamespace:   pulumi.String("string"),
	InitialMaxSize:           pulumi.Int(0),
	PredictiveTaskBufferTime: pulumi.Int(0),
	AdjustmentType:           pulumi.String("string"),
	TargetValue:              pulumi.Float64(0),
	AlarmDimension: &ess.ScalingRuleAlarmDimensionArgs{
		DimensionKey:   pulumi.String("string"),
		DimensionValue: pulumi.String("string"),
	},
	MetricName:              pulumi.String("string"),
	PredictiveValueBehavior: pulumi.String("string"),
	PredictiveValueBuffer:   pulumi.Int(0),
	ScaleInEvaluationCount:  pulumi.Int(0),
	ScaleOutEvaluationCount: pulumi.Int(0),
	AdjustmentValue:         pulumi.Int(0),
	ScalingRuleName:         pulumi.String("string"),
	ScalingRuleType:         pulumi.String("string"),
	StepAdjustments: ess.ScalingRuleStepAdjustmentArray{
		&ess.ScalingRuleStepAdjustmentArgs{
			MetricIntervalLowerBound: pulumi.String("string"),
			MetricIntervalUpperBound: pulumi.String("string"),
			ScalingAdjustment:        pulumi.Int(0),
		},
	},
	MinAdjustmentMagnitude: pulumi.Int(0),
})
Copy
var scalingRuleResource = new ScalingRule("scalingRuleResource", ScalingRuleArgs.builder()
    .scalingGroupId("string")
    .metricType("string")
    .cooldown(0)
    .predictiveScalingMode("string")
    .disableScaleIn(false)
    .estimatedInstanceWarmup(0)
    .hybridMetrics(ScalingRuleHybridMetricArgs.builder()
        .dimensions(ScalingRuleHybridMetricDimensionArgs.builder()
            .dimensionKey("string")
            .dimensionValue("string")
            .build())
        .expression("string")
        .id("string")
        .metricName("string")
        .statistic("string")
        .build())
    .hybridMonitorNamespace("string")
    .initialMaxSize(0)
    .predictiveTaskBufferTime(0)
    .adjustmentType("string")
    .targetValue(0)
    .alarmDimension(ScalingRuleAlarmDimensionArgs.builder()
        .dimensionKey("string")
        .dimensionValue("string")
        .build())
    .metricName("string")
    .predictiveValueBehavior("string")
    .predictiveValueBuffer(0)
    .scaleInEvaluationCount(0)
    .scaleOutEvaluationCount(0)
    .adjustmentValue(0)
    .scalingRuleName("string")
    .scalingRuleType("string")
    .stepAdjustments(ScalingRuleStepAdjustmentArgs.builder()
        .metricIntervalLowerBound("string")
        .metricIntervalUpperBound("string")
        .scalingAdjustment(0)
        .build())
    .minAdjustmentMagnitude(0)
    .build());
Copy
scaling_rule_resource = alicloud.ess.ScalingRule("scalingRuleResource",
    scaling_group_id="string",
    metric_type="string",
    cooldown=0,
    predictive_scaling_mode="string",
    disable_scale_in=False,
    estimated_instance_warmup=0,
    hybrid_metrics=[{
        "dimensions": [{
            "dimension_key": "string",
            "dimension_value": "string",
        }],
        "expression": "string",
        "id": "string",
        "metric_name": "string",
        "statistic": "string",
    }],
    hybrid_monitor_namespace="string",
    initial_max_size=0,
    predictive_task_buffer_time=0,
    adjustment_type="string",
    target_value=0,
    alarm_dimension={
        "dimension_key": "string",
        "dimension_value": "string",
    },
    metric_name="string",
    predictive_value_behavior="string",
    predictive_value_buffer=0,
    scale_in_evaluation_count=0,
    scale_out_evaluation_count=0,
    adjustment_value=0,
    scaling_rule_name="string",
    scaling_rule_type="string",
    step_adjustments=[{
        "metric_interval_lower_bound": "string",
        "metric_interval_upper_bound": "string",
        "scaling_adjustment": 0,
    }],
    min_adjustment_magnitude=0)
Copy
const scalingRuleResource = new alicloud.ess.ScalingRule("scalingRuleResource", {
    scalingGroupId: "string",
    metricType: "string",
    cooldown: 0,
    predictiveScalingMode: "string",
    disableScaleIn: false,
    estimatedInstanceWarmup: 0,
    hybridMetrics: [{
        dimensions: [{
            dimensionKey: "string",
            dimensionValue: "string",
        }],
        expression: "string",
        id: "string",
        metricName: "string",
        statistic: "string",
    }],
    hybridMonitorNamespace: "string",
    initialMaxSize: 0,
    predictiveTaskBufferTime: 0,
    adjustmentType: "string",
    targetValue: 0,
    alarmDimension: {
        dimensionKey: "string",
        dimensionValue: "string",
    },
    metricName: "string",
    predictiveValueBehavior: "string",
    predictiveValueBuffer: 0,
    scaleInEvaluationCount: 0,
    scaleOutEvaluationCount: 0,
    adjustmentValue: 0,
    scalingRuleName: "string",
    scalingRuleType: "string",
    stepAdjustments: [{
        metricIntervalLowerBound: "string",
        metricIntervalUpperBound: "string",
        scalingAdjustment: 0,
    }],
    minAdjustmentMagnitude: 0,
});
Copy
type: alicloud:ess:ScalingRule
properties:
    adjustmentType: string
    adjustmentValue: 0
    alarmDimension:
        dimensionKey: string
        dimensionValue: string
    cooldown: 0
    disableScaleIn: false
    estimatedInstanceWarmup: 0
    hybridMetrics:
        - dimensions:
            - dimensionKey: string
              dimensionValue: string
          expression: string
          id: string
          metricName: string
          statistic: string
    hybridMonitorNamespace: string
    initialMaxSize: 0
    metricName: string
    metricType: string
    minAdjustmentMagnitude: 0
    predictiveScalingMode: string
    predictiveTaskBufferTime: 0
    predictiveValueBehavior: string
    predictiveValueBuffer: 0
    scaleInEvaluationCount: 0
    scaleOutEvaluationCount: 0
    scalingGroupId: string
    scalingRuleName: string
    scalingRuleType: string
    stepAdjustments:
        - metricIntervalLowerBound: string
          metricIntervalUpperBound: string
          scalingAdjustment: 0
    targetValue: 0
Copy

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

ScalingGroupId
This property is required.
Changes to this property will trigger replacement.
string
ID of the scaling group of a scaling rule.
AdjustmentType string
Adjustment mode of a scaling rule. Optional values:

  • QuantityChangeInCapacity: It is used to increase or decrease a specified number of ECS instances.
  • PercentChangeInCapacity: It is used to increase or decrease a specified proportion of ECS instances.
  • TotalCapacity: It is used to adjust the quantity of ECS instances in the current scaling group to a specified value.
AdjustmentValue int
The number of ECS instances to be adjusted in the scaling rule. This parameter is required and applicable only to simple scaling rules. The number of ECS instances to be adjusted in a single scaling activity cannot exceed 500. Value range:

  • QuantityChangeInCapacity:(0, 500] U (-500, 0]
  • PercentChangeInCapacity:[0, 10000] U [-100, 0]
  • TotalCapacity:[0, 1000]
AlarmDimension Changes to this property will trigger replacement. Pulumi.AliCloud.Ess.Inputs.ScalingRuleAlarmDimension
AlarmDimension for StepScalingRule. See alarm_dimension below.
Cooldown int
The cooldown time of the scaling rule. This parameter is applicable only to simple scaling rules. Value range: [0, 86,400], in seconds. The default value is empty,if not set, the return value will be 0, which is the default value of integer.
DisableScaleIn bool
Indicates whether scale in by the target tracking policy is disabled. Default to false.
EstimatedInstanceWarmup int
The estimated time, in seconds, until a newly launched instance will contribute CloudMonitor metrics. Default to 300.
HybridMetrics List<Pulumi.AliCloud.Ess.Inputs.ScalingRuleHybridMetric>
The Hybrid Cloud Monitoring metrics. See hybrid_metrics below.
HybridMonitorNamespace string
The ID of the Hybrid Cloud Monitoring metric repository.
InitialMaxSize int
The maximum number of ECS instances that can be added to the scaling group. If you specify InitialMaxSize, you must also specify PredictiveValueBehavior.
MetricName string
A CloudMonitor metric name.
MetricType string
The type of the metric. Valid values: system, custom, hybrid.
MinAdjustmentMagnitude int
The minimum number of instances that must be scaled. This parameter takes effect if you set ScalingRuleType to SimpleScalingRule or StepScalingRule, and AdjustmentType to PercentChangeInCapacity.
PredictiveScalingMode string
The mode of the predictive scaling rule. Valid values: PredictAndScale, PredictOnly.
PredictiveTaskBufferTime int
The amount of buffer time before the prediction task runs. By default, all prediction tasks that are automatically created by a predictive scaling rule run on the hour. You can specify a buffer time to run prediction tasks and prepare resources in advance. Valid values: 0 to 60. Unit: minutes.
PredictiveValueBehavior string
The action on the predicted maximum value. Valid values: MaxOverridePredictiveValue, PredictiveValueOverrideMax, PredictiveValueOverrideMaxWithBuffer.
PredictiveValueBuffer int
The ratio based on which the predicted value is increased if you set PredictiveValueBehavior to PredictiveValueOverrideMaxWithBuffer. If the predicted value increased by this ratio is greater than the initial maximum capacity, the increased value is used as the maximum value for prediction tasks. Valid values: 0 to 100.
ScaleInEvaluationCount int
The number of consecutive times that the event-triggered task created for scale-ins must meet the threshold conditions before an alert is triggered. After a target tracking scaling rule is created, an event-triggered task is automatically created and associated with the target tracking scaling rule.
ScaleOutEvaluationCount int
The number of consecutive times that the event-triggered task created for scale-outs must meet the threshold conditions before an alert is triggered. After a target tracking scaling rule is created, an event-triggered task is automatically created and associated with the target tracking scaling rule.
ScalingRuleName string
Name shown for the scaling rule, which must contain 2-64 characters (English or Chinese), starting with numbers, English letters or Chinese characters, and can contain number, underscores _, hypens -, and decimal point .. If this parameter value is not specified, the default value is scaling rule id.
ScalingRuleType Changes to this property will trigger replacement. string
The scaling rule type, either "SimpleScalingRule", "TargetTrackingScalingRule", "StepScalingRule", "PredictiveScalingRule". Default to "SimpleScalingRule".
StepAdjustments List<Pulumi.AliCloud.Ess.Inputs.ScalingRuleStepAdjustment>
Steps for StepScalingRule. See step_adjustment below.
TargetValue double
The target value for the metric.
ScalingGroupId
This property is required.
Changes to this property will trigger replacement.
string
ID of the scaling group of a scaling rule.
AdjustmentType string
Adjustment mode of a scaling rule. Optional values:

  • QuantityChangeInCapacity: It is used to increase or decrease a specified number of ECS instances.
  • PercentChangeInCapacity: It is used to increase or decrease a specified proportion of ECS instances.
  • TotalCapacity: It is used to adjust the quantity of ECS instances in the current scaling group to a specified value.
AdjustmentValue int
The number of ECS instances to be adjusted in the scaling rule. This parameter is required and applicable only to simple scaling rules. The number of ECS instances to be adjusted in a single scaling activity cannot exceed 500. Value range:

  • QuantityChangeInCapacity:(0, 500] U (-500, 0]
  • PercentChangeInCapacity:[0, 10000] U [-100, 0]
  • TotalCapacity:[0, 1000]
AlarmDimension Changes to this property will trigger replacement. ScalingRuleAlarmDimensionArgs
AlarmDimension for StepScalingRule. See alarm_dimension below.
Cooldown int
The cooldown time of the scaling rule. This parameter is applicable only to simple scaling rules. Value range: [0, 86,400], in seconds. The default value is empty,if not set, the return value will be 0, which is the default value of integer.
DisableScaleIn bool
Indicates whether scale in by the target tracking policy is disabled. Default to false.
EstimatedInstanceWarmup int
The estimated time, in seconds, until a newly launched instance will contribute CloudMonitor metrics. Default to 300.
HybridMetrics []ScalingRuleHybridMetricArgs
The Hybrid Cloud Monitoring metrics. See hybrid_metrics below.
HybridMonitorNamespace string
The ID of the Hybrid Cloud Monitoring metric repository.
InitialMaxSize int
The maximum number of ECS instances that can be added to the scaling group. If you specify InitialMaxSize, you must also specify PredictiveValueBehavior.
MetricName string
A CloudMonitor metric name.
MetricType string
The type of the metric. Valid values: system, custom, hybrid.
MinAdjustmentMagnitude int
The minimum number of instances that must be scaled. This parameter takes effect if you set ScalingRuleType to SimpleScalingRule or StepScalingRule, and AdjustmentType to PercentChangeInCapacity.
PredictiveScalingMode string
The mode of the predictive scaling rule. Valid values: PredictAndScale, PredictOnly.
PredictiveTaskBufferTime int
The amount of buffer time before the prediction task runs. By default, all prediction tasks that are automatically created by a predictive scaling rule run on the hour. You can specify a buffer time to run prediction tasks and prepare resources in advance. Valid values: 0 to 60. Unit: minutes.
PredictiveValueBehavior string
The action on the predicted maximum value. Valid values: MaxOverridePredictiveValue, PredictiveValueOverrideMax, PredictiveValueOverrideMaxWithBuffer.
PredictiveValueBuffer int
The ratio based on which the predicted value is increased if you set PredictiveValueBehavior to PredictiveValueOverrideMaxWithBuffer. If the predicted value increased by this ratio is greater than the initial maximum capacity, the increased value is used as the maximum value for prediction tasks. Valid values: 0 to 100.
ScaleInEvaluationCount int
The number of consecutive times that the event-triggered task created for scale-ins must meet the threshold conditions before an alert is triggered. After a target tracking scaling rule is created, an event-triggered task is automatically created and associated with the target tracking scaling rule.
ScaleOutEvaluationCount int
The number of consecutive times that the event-triggered task created for scale-outs must meet the threshold conditions before an alert is triggered. After a target tracking scaling rule is created, an event-triggered task is automatically created and associated with the target tracking scaling rule.
ScalingRuleName string
Name shown for the scaling rule, which must contain 2-64 characters (English or Chinese), starting with numbers, English letters or Chinese characters, and can contain number, underscores _, hypens -, and decimal point .. If this parameter value is not specified, the default value is scaling rule id.
ScalingRuleType Changes to this property will trigger replacement. string
The scaling rule type, either "SimpleScalingRule", "TargetTrackingScalingRule", "StepScalingRule", "PredictiveScalingRule". Default to "SimpleScalingRule".
StepAdjustments []ScalingRuleStepAdjustmentArgs
Steps for StepScalingRule. See step_adjustment below.
TargetValue float64
The target value for the metric.
scalingGroupId
This property is required.
Changes to this property will trigger replacement.
String
ID of the scaling group of a scaling rule.
adjustmentType String
Adjustment mode of a scaling rule. Optional values:

  • QuantityChangeInCapacity: It is used to increase or decrease a specified number of ECS instances.
  • PercentChangeInCapacity: It is used to increase or decrease a specified proportion of ECS instances.
  • TotalCapacity: It is used to adjust the quantity of ECS instances in the current scaling group to a specified value.
adjustmentValue Integer
The number of ECS instances to be adjusted in the scaling rule. This parameter is required and applicable only to simple scaling rules. The number of ECS instances to be adjusted in a single scaling activity cannot exceed 500. Value range:

  • QuantityChangeInCapacity:(0, 500] U (-500, 0]
  • PercentChangeInCapacity:[0, 10000] U [-100, 0]
  • TotalCapacity:[0, 1000]
alarmDimension Changes to this property will trigger replacement. ScalingRuleAlarmDimension
AlarmDimension for StepScalingRule. See alarm_dimension below.
cooldown Integer
The cooldown time of the scaling rule. This parameter is applicable only to simple scaling rules. Value range: [0, 86,400], in seconds. The default value is empty,if not set, the return value will be 0, which is the default value of integer.
disableScaleIn Boolean
Indicates whether scale in by the target tracking policy is disabled. Default to false.
estimatedInstanceWarmup Integer
The estimated time, in seconds, until a newly launched instance will contribute CloudMonitor metrics. Default to 300.
hybridMetrics List<ScalingRuleHybridMetric>
The Hybrid Cloud Monitoring metrics. See hybrid_metrics below.
hybridMonitorNamespace String
The ID of the Hybrid Cloud Monitoring metric repository.
initialMaxSize Integer
The maximum number of ECS instances that can be added to the scaling group. If you specify InitialMaxSize, you must also specify PredictiveValueBehavior.
metricName String
A CloudMonitor metric name.
metricType String
The type of the metric. Valid values: system, custom, hybrid.
minAdjustmentMagnitude Integer
The minimum number of instances that must be scaled. This parameter takes effect if you set ScalingRuleType to SimpleScalingRule or StepScalingRule, and AdjustmentType to PercentChangeInCapacity.
predictiveScalingMode String
The mode of the predictive scaling rule. Valid values: PredictAndScale, PredictOnly.
predictiveTaskBufferTime Integer
The amount of buffer time before the prediction task runs. By default, all prediction tasks that are automatically created by a predictive scaling rule run on the hour. You can specify a buffer time to run prediction tasks and prepare resources in advance. Valid values: 0 to 60. Unit: minutes.
predictiveValueBehavior String
The action on the predicted maximum value. Valid values: MaxOverridePredictiveValue, PredictiveValueOverrideMax, PredictiveValueOverrideMaxWithBuffer.
predictiveValueBuffer Integer
The ratio based on which the predicted value is increased if you set PredictiveValueBehavior to PredictiveValueOverrideMaxWithBuffer. If the predicted value increased by this ratio is greater than the initial maximum capacity, the increased value is used as the maximum value for prediction tasks. Valid values: 0 to 100.
scaleInEvaluationCount Integer
The number of consecutive times that the event-triggered task created for scale-ins must meet the threshold conditions before an alert is triggered. After a target tracking scaling rule is created, an event-triggered task is automatically created and associated with the target tracking scaling rule.
scaleOutEvaluationCount Integer
The number of consecutive times that the event-triggered task created for scale-outs must meet the threshold conditions before an alert is triggered. After a target tracking scaling rule is created, an event-triggered task is automatically created and associated with the target tracking scaling rule.
scalingRuleName String
Name shown for the scaling rule, which must contain 2-64 characters (English or Chinese), starting with numbers, English letters or Chinese characters, and can contain number, underscores _, hypens -, and decimal point .. If this parameter value is not specified, the default value is scaling rule id.
scalingRuleType Changes to this property will trigger replacement. String
The scaling rule type, either "SimpleScalingRule", "TargetTrackingScalingRule", "StepScalingRule", "PredictiveScalingRule". Default to "SimpleScalingRule".
stepAdjustments List<ScalingRuleStepAdjustment>
Steps for StepScalingRule. See step_adjustment below.
targetValue Double
The target value for the metric.
scalingGroupId
This property is required.
Changes to this property will trigger replacement.
string
ID of the scaling group of a scaling rule.
adjustmentType string
Adjustment mode of a scaling rule. Optional values:

  • QuantityChangeInCapacity: It is used to increase or decrease a specified number of ECS instances.
  • PercentChangeInCapacity: It is used to increase or decrease a specified proportion of ECS instances.
  • TotalCapacity: It is used to adjust the quantity of ECS instances in the current scaling group to a specified value.
adjustmentValue number
The number of ECS instances to be adjusted in the scaling rule. This parameter is required and applicable only to simple scaling rules. The number of ECS instances to be adjusted in a single scaling activity cannot exceed 500. Value range:

  • QuantityChangeInCapacity:(0, 500] U (-500, 0]
  • PercentChangeInCapacity:[0, 10000] U [-100, 0]
  • TotalCapacity:[0, 1000]
alarmDimension Changes to this property will trigger replacement. ScalingRuleAlarmDimension
AlarmDimension for StepScalingRule. See alarm_dimension below.
cooldown number
The cooldown time of the scaling rule. This parameter is applicable only to simple scaling rules. Value range: [0, 86,400], in seconds. The default value is empty,if not set, the return value will be 0, which is the default value of integer.
disableScaleIn boolean
Indicates whether scale in by the target tracking policy is disabled. Default to false.
estimatedInstanceWarmup number
The estimated time, in seconds, until a newly launched instance will contribute CloudMonitor metrics. Default to 300.
hybridMetrics ScalingRuleHybridMetric[]
The Hybrid Cloud Monitoring metrics. See hybrid_metrics below.
hybridMonitorNamespace string
The ID of the Hybrid Cloud Monitoring metric repository.
initialMaxSize number
The maximum number of ECS instances that can be added to the scaling group. If you specify InitialMaxSize, you must also specify PredictiveValueBehavior.
metricName string
A CloudMonitor metric name.
metricType string
The type of the metric. Valid values: system, custom, hybrid.
minAdjustmentMagnitude number
The minimum number of instances that must be scaled. This parameter takes effect if you set ScalingRuleType to SimpleScalingRule or StepScalingRule, and AdjustmentType to PercentChangeInCapacity.
predictiveScalingMode string
The mode of the predictive scaling rule. Valid values: PredictAndScale, PredictOnly.
predictiveTaskBufferTime number
The amount of buffer time before the prediction task runs. By default, all prediction tasks that are automatically created by a predictive scaling rule run on the hour. You can specify a buffer time to run prediction tasks and prepare resources in advance. Valid values: 0 to 60. Unit: minutes.
predictiveValueBehavior string
The action on the predicted maximum value. Valid values: MaxOverridePredictiveValue, PredictiveValueOverrideMax, PredictiveValueOverrideMaxWithBuffer.
predictiveValueBuffer number
The ratio based on which the predicted value is increased if you set PredictiveValueBehavior to PredictiveValueOverrideMaxWithBuffer. If the predicted value increased by this ratio is greater than the initial maximum capacity, the increased value is used as the maximum value for prediction tasks. Valid values: 0 to 100.
scaleInEvaluationCount number
The number of consecutive times that the event-triggered task created for scale-ins must meet the threshold conditions before an alert is triggered. After a target tracking scaling rule is created, an event-triggered task is automatically created and associated with the target tracking scaling rule.
scaleOutEvaluationCount number
The number of consecutive times that the event-triggered task created for scale-outs must meet the threshold conditions before an alert is triggered. After a target tracking scaling rule is created, an event-triggered task is automatically created and associated with the target tracking scaling rule.
scalingRuleName string
Name shown for the scaling rule, which must contain 2-64 characters (English or Chinese), starting with numbers, English letters or Chinese characters, and can contain number, underscores _, hypens -, and decimal point .. If this parameter value is not specified, the default value is scaling rule id.
scalingRuleType Changes to this property will trigger replacement. string
The scaling rule type, either "SimpleScalingRule", "TargetTrackingScalingRule", "StepScalingRule", "PredictiveScalingRule". Default to "SimpleScalingRule".
stepAdjustments ScalingRuleStepAdjustment[]
Steps for StepScalingRule. See step_adjustment below.
targetValue number
The target value for the metric.
scaling_group_id
This property is required.
Changes to this property will trigger replacement.
str
ID of the scaling group of a scaling rule.
adjustment_type str
Adjustment mode of a scaling rule. Optional values:

  • QuantityChangeInCapacity: It is used to increase or decrease a specified number of ECS instances.
  • PercentChangeInCapacity: It is used to increase or decrease a specified proportion of ECS instances.
  • TotalCapacity: It is used to adjust the quantity of ECS instances in the current scaling group to a specified value.
adjustment_value int
The number of ECS instances to be adjusted in the scaling rule. This parameter is required and applicable only to simple scaling rules. The number of ECS instances to be adjusted in a single scaling activity cannot exceed 500. Value range:

  • QuantityChangeInCapacity:(0, 500] U (-500, 0]
  • PercentChangeInCapacity:[0, 10000] U [-100, 0]
  • TotalCapacity:[0, 1000]
alarm_dimension Changes to this property will trigger replacement. ScalingRuleAlarmDimensionArgs
AlarmDimension for StepScalingRule. See alarm_dimension below.
cooldown int
The cooldown time of the scaling rule. This parameter is applicable only to simple scaling rules. Value range: [0, 86,400], in seconds. The default value is empty,if not set, the return value will be 0, which is the default value of integer.
disable_scale_in bool
Indicates whether scale in by the target tracking policy is disabled. Default to false.
estimated_instance_warmup int
The estimated time, in seconds, until a newly launched instance will contribute CloudMonitor metrics. Default to 300.
hybrid_metrics Sequence[ScalingRuleHybridMetricArgs]
The Hybrid Cloud Monitoring metrics. See hybrid_metrics below.
hybrid_monitor_namespace str
The ID of the Hybrid Cloud Monitoring metric repository.
initial_max_size int
The maximum number of ECS instances that can be added to the scaling group. If you specify InitialMaxSize, you must also specify PredictiveValueBehavior.
metric_name str
A CloudMonitor metric name.
metric_type str
The type of the metric. Valid values: system, custom, hybrid.
min_adjustment_magnitude int
The minimum number of instances that must be scaled. This parameter takes effect if you set ScalingRuleType to SimpleScalingRule or StepScalingRule, and AdjustmentType to PercentChangeInCapacity.
predictive_scaling_mode str
The mode of the predictive scaling rule. Valid values: PredictAndScale, PredictOnly.
predictive_task_buffer_time int
The amount of buffer time before the prediction task runs. By default, all prediction tasks that are automatically created by a predictive scaling rule run on the hour. You can specify a buffer time to run prediction tasks and prepare resources in advance. Valid values: 0 to 60. Unit: minutes.
predictive_value_behavior str
The action on the predicted maximum value. Valid values: MaxOverridePredictiveValue, PredictiveValueOverrideMax, PredictiveValueOverrideMaxWithBuffer.
predictive_value_buffer int
The ratio based on which the predicted value is increased if you set PredictiveValueBehavior to PredictiveValueOverrideMaxWithBuffer. If the predicted value increased by this ratio is greater than the initial maximum capacity, the increased value is used as the maximum value for prediction tasks. Valid values: 0 to 100.
scale_in_evaluation_count int
The number of consecutive times that the event-triggered task created for scale-ins must meet the threshold conditions before an alert is triggered. After a target tracking scaling rule is created, an event-triggered task is automatically created and associated with the target tracking scaling rule.
scale_out_evaluation_count int
The number of consecutive times that the event-triggered task created for scale-outs must meet the threshold conditions before an alert is triggered. After a target tracking scaling rule is created, an event-triggered task is automatically created and associated with the target tracking scaling rule.
scaling_rule_name str
Name shown for the scaling rule, which must contain 2-64 characters (English or Chinese), starting with numbers, English letters or Chinese characters, and can contain number, underscores _, hypens -, and decimal point .. If this parameter value is not specified, the default value is scaling rule id.
scaling_rule_type Changes to this property will trigger replacement. str
The scaling rule type, either "SimpleScalingRule", "TargetTrackingScalingRule", "StepScalingRule", "PredictiveScalingRule". Default to "SimpleScalingRule".
step_adjustments Sequence[ScalingRuleStepAdjustmentArgs]
Steps for StepScalingRule. See step_adjustment below.
target_value float
The target value for the metric.
scalingGroupId
This property is required.
Changes to this property will trigger replacement.
String
ID of the scaling group of a scaling rule.
adjustmentType String
Adjustment mode of a scaling rule. Optional values:

  • QuantityChangeInCapacity: It is used to increase or decrease a specified number of ECS instances.
  • PercentChangeInCapacity: It is used to increase or decrease a specified proportion of ECS instances.
  • TotalCapacity: It is used to adjust the quantity of ECS instances in the current scaling group to a specified value.
adjustmentValue Number
The number of ECS instances to be adjusted in the scaling rule. This parameter is required and applicable only to simple scaling rules. The number of ECS instances to be adjusted in a single scaling activity cannot exceed 500. Value range:

  • QuantityChangeInCapacity:(0, 500] U (-500, 0]
  • PercentChangeInCapacity:[0, 10000] U [-100, 0]
  • TotalCapacity:[0, 1000]
alarmDimension Changes to this property will trigger replacement. Property Map
AlarmDimension for StepScalingRule. See alarm_dimension below.
cooldown Number
The cooldown time of the scaling rule. This parameter is applicable only to simple scaling rules. Value range: [0, 86,400], in seconds. The default value is empty,if not set, the return value will be 0, which is the default value of integer.
disableScaleIn Boolean
Indicates whether scale in by the target tracking policy is disabled. Default to false.
estimatedInstanceWarmup Number
The estimated time, in seconds, until a newly launched instance will contribute CloudMonitor metrics. Default to 300.
hybridMetrics List<Property Map>
The Hybrid Cloud Monitoring metrics. See hybrid_metrics below.
hybridMonitorNamespace String
The ID of the Hybrid Cloud Monitoring metric repository.
initialMaxSize Number
The maximum number of ECS instances that can be added to the scaling group. If you specify InitialMaxSize, you must also specify PredictiveValueBehavior.
metricName String
A CloudMonitor metric name.
metricType String
The type of the metric. Valid values: system, custom, hybrid.
minAdjustmentMagnitude Number
The minimum number of instances that must be scaled. This parameter takes effect if you set ScalingRuleType to SimpleScalingRule or StepScalingRule, and AdjustmentType to PercentChangeInCapacity.
predictiveScalingMode String
The mode of the predictive scaling rule. Valid values: PredictAndScale, PredictOnly.
predictiveTaskBufferTime Number
The amount of buffer time before the prediction task runs. By default, all prediction tasks that are automatically created by a predictive scaling rule run on the hour. You can specify a buffer time to run prediction tasks and prepare resources in advance. Valid values: 0 to 60. Unit: minutes.
predictiveValueBehavior String
The action on the predicted maximum value. Valid values: MaxOverridePredictiveValue, PredictiveValueOverrideMax, PredictiveValueOverrideMaxWithBuffer.
predictiveValueBuffer Number
The ratio based on which the predicted value is increased if you set PredictiveValueBehavior to PredictiveValueOverrideMaxWithBuffer. If the predicted value increased by this ratio is greater than the initial maximum capacity, the increased value is used as the maximum value for prediction tasks. Valid values: 0 to 100.
scaleInEvaluationCount Number
The number of consecutive times that the event-triggered task created for scale-ins must meet the threshold conditions before an alert is triggered. After a target tracking scaling rule is created, an event-triggered task is automatically created and associated with the target tracking scaling rule.
scaleOutEvaluationCount Number
The number of consecutive times that the event-triggered task created for scale-outs must meet the threshold conditions before an alert is triggered. After a target tracking scaling rule is created, an event-triggered task is automatically created and associated with the target tracking scaling rule.
scalingRuleName String
Name shown for the scaling rule, which must contain 2-64 characters (English or Chinese), starting with numbers, English letters or Chinese characters, and can contain number, underscores _, hypens -, and decimal point .. If this parameter value is not specified, the default value is scaling rule id.
scalingRuleType Changes to this property will trigger replacement. String
The scaling rule type, either "SimpleScalingRule", "TargetTrackingScalingRule", "StepScalingRule", "PredictiveScalingRule". Default to "SimpleScalingRule".
stepAdjustments List<Property Map>
Steps for StepScalingRule. See step_adjustment below.
targetValue Number
The target value for the metric.

Outputs

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

Ari string
The unique identifier of the scaling rule.
Id string
The provider-assigned unique ID for this managed resource.
Ari string
The unique identifier of the scaling rule.
Id string
The provider-assigned unique ID for this managed resource.
ari String
The unique identifier of the scaling rule.
id String
The provider-assigned unique ID for this managed resource.
ari string
The unique identifier of the scaling rule.
id string
The provider-assigned unique ID for this managed resource.
ari str
The unique identifier of the scaling rule.
id str
The provider-assigned unique ID for this managed resource.
ari String
The unique identifier of the scaling rule.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing ScalingRule Resource

Get an existing ScalingRule 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?: ScalingRuleState, opts?: CustomResourceOptions): ScalingRule
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        adjustment_type: Optional[str] = None,
        adjustment_value: Optional[int] = None,
        alarm_dimension: Optional[ScalingRuleAlarmDimensionArgs] = None,
        ari: Optional[str] = None,
        cooldown: Optional[int] = None,
        disable_scale_in: Optional[bool] = None,
        estimated_instance_warmup: Optional[int] = None,
        hybrid_metrics: Optional[Sequence[ScalingRuleHybridMetricArgs]] = None,
        hybrid_monitor_namespace: Optional[str] = None,
        initial_max_size: Optional[int] = None,
        metric_name: Optional[str] = None,
        metric_type: Optional[str] = None,
        min_adjustment_magnitude: Optional[int] = None,
        predictive_scaling_mode: Optional[str] = None,
        predictive_task_buffer_time: Optional[int] = None,
        predictive_value_behavior: Optional[str] = None,
        predictive_value_buffer: Optional[int] = None,
        scale_in_evaluation_count: Optional[int] = None,
        scale_out_evaluation_count: Optional[int] = None,
        scaling_group_id: Optional[str] = None,
        scaling_rule_name: Optional[str] = None,
        scaling_rule_type: Optional[str] = None,
        step_adjustments: Optional[Sequence[ScalingRuleStepAdjustmentArgs]] = None,
        target_value: Optional[float] = None) -> ScalingRule
func GetScalingRule(ctx *Context, name string, id IDInput, state *ScalingRuleState, opts ...ResourceOption) (*ScalingRule, error)
public static ScalingRule Get(string name, Input<string> id, ScalingRuleState? state, CustomResourceOptions? opts = null)
public static ScalingRule get(String name, Output<String> id, ScalingRuleState state, CustomResourceOptions options)
resources:  _:    type: alicloud:ess:ScalingRule    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:
AdjustmentType string
Adjustment mode of a scaling rule. Optional values:

  • QuantityChangeInCapacity: It is used to increase or decrease a specified number of ECS instances.
  • PercentChangeInCapacity: It is used to increase or decrease a specified proportion of ECS instances.
  • TotalCapacity: It is used to adjust the quantity of ECS instances in the current scaling group to a specified value.
AdjustmentValue int
The number of ECS instances to be adjusted in the scaling rule. This parameter is required and applicable only to simple scaling rules. The number of ECS instances to be adjusted in a single scaling activity cannot exceed 500. Value range:

  • QuantityChangeInCapacity:(0, 500] U (-500, 0]
  • PercentChangeInCapacity:[0, 10000] U [-100, 0]
  • TotalCapacity:[0, 1000]
AlarmDimension Changes to this property will trigger replacement. Pulumi.AliCloud.Ess.Inputs.ScalingRuleAlarmDimension
AlarmDimension for StepScalingRule. See alarm_dimension below.
Ari string
The unique identifier of the scaling rule.
Cooldown int
The cooldown time of the scaling rule. This parameter is applicable only to simple scaling rules. Value range: [0, 86,400], in seconds. The default value is empty,if not set, the return value will be 0, which is the default value of integer.
DisableScaleIn bool
Indicates whether scale in by the target tracking policy is disabled. Default to false.
EstimatedInstanceWarmup int
The estimated time, in seconds, until a newly launched instance will contribute CloudMonitor metrics. Default to 300.
HybridMetrics List<Pulumi.AliCloud.Ess.Inputs.ScalingRuleHybridMetric>
The Hybrid Cloud Monitoring metrics. See hybrid_metrics below.
HybridMonitorNamespace string
The ID of the Hybrid Cloud Monitoring metric repository.
InitialMaxSize int
The maximum number of ECS instances that can be added to the scaling group. If you specify InitialMaxSize, you must also specify PredictiveValueBehavior.
MetricName string
A CloudMonitor metric name.
MetricType string
The type of the metric. Valid values: system, custom, hybrid.
MinAdjustmentMagnitude int
The minimum number of instances that must be scaled. This parameter takes effect if you set ScalingRuleType to SimpleScalingRule or StepScalingRule, and AdjustmentType to PercentChangeInCapacity.
PredictiveScalingMode string
The mode of the predictive scaling rule. Valid values: PredictAndScale, PredictOnly.
PredictiveTaskBufferTime int
The amount of buffer time before the prediction task runs. By default, all prediction tasks that are automatically created by a predictive scaling rule run on the hour. You can specify a buffer time to run prediction tasks and prepare resources in advance. Valid values: 0 to 60. Unit: minutes.
PredictiveValueBehavior string
The action on the predicted maximum value. Valid values: MaxOverridePredictiveValue, PredictiveValueOverrideMax, PredictiveValueOverrideMaxWithBuffer.
PredictiveValueBuffer int
The ratio based on which the predicted value is increased if you set PredictiveValueBehavior to PredictiveValueOverrideMaxWithBuffer. If the predicted value increased by this ratio is greater than the initial maximum capacity, the increased value is used as the maximum value for prediction tasks. Valid values: 0 to 100.
ScaleInEvaluationCount int
The number of consecutive times that the event-triggered task created for scale-ins must meet the threshold conditions before an alert is triggered. After a target tracking scaling rule is created, an event-triggered task is automatically created and associated with the target tracking scaling rule.
ScaleOutEvaluationCount int
The number of consecutive times that the event-triggered task created for scale-outs must meet the threshold conditions before an alert is triggered. After a target tracking scaling rule is created, an event-triggered task is automatically created and associated with the target tracking scaling rule.
ScalingGroupId Changes to this property will trigger replacement. string
ID of the scaling group of a scaling rule.
ScalingRuleName string
Name shown for the scaling rule, which must contain 2-64 characters (English or Chinese), starting with numbers, English letters or Chinese characters, and can contain number, underscores _, hypens -, and decimal point .. If this parameter value is not specified, the default value is scaling rule id.
ScalingRuleType Changes to this property will trigger replacement. string
The scaling rule type, either "SimpleScalingRule", "TargetTrackingScalingRule", "StepScalingRule", "PredictiveScalingRule". Default to "SimpleScalingRule".
StepAdjustments List<Pulumi.AliCloud.Ess.Inputs.ScalingRuleStepAdjustment>
Steps for StepScalingRule. See step_adjustment below.
TargetValue double
The target value for the metric.
AdjustmentType string
Adjustment mode of a scaling rule. Optional values:

  • QuantityChangeInCapacity: It is used to increase or decrease a specified number of ECS instances.
  • PercentChangeInCapacity: It is used to increase or decrease a specified proportion of ECS instances.
  • TotalCapacity: It is used to adjust the quantity of ECS instances in the current scaling group to a specified value.
AdjustmentValue int
The number of ECS instances to be adjusted in the scaling rule. This parameter is required and applicable only to simple scaling rules. The number of ECS instances to be adjusted in a single scaling activity cannot exceed 500. Value range:

  • QuantityChangeInCapacity:(0, 500] U (-500, 0]
  • PercentChangeInCapacity:[0, 10000] U [-100, 0]
  • TotalCapacity:[0, 1000]
AlarmDimension Changes to this property will trigger replacement. ScalingRuleAlarmDimensionArgs
AlarmDimension for StepScalingRule. See alarm_dimension below.
Ari string
The unique identifier of the scaling rule.
Cooldown int
The cooldown time of the scaling rule. This parameter is applicable only to simple scaling rules. Value range: [0, 86,400], in seconds. The default value is empty,if not set, the return value will be 0, which is the default value of integer.
DisableScaleIn bool
Indicates whether scale in by the target tracking policy is disabled. Default to false.
EstimatedInstanceWarmup int
The estimated time, in seconds, until a newly launched instance will contribute CloudMonitor metrics. Default to 300.
HybridMetrics []ScalingRuleHybridMetricArgs
The Hybrid Cloud Monitoring metrics. See hybrid_metrics below.
HybridMonitorNamespace string
The ID of the Hybrid Cloud Monitoring metric repository.
InitialMaxSize int
The maximum number of ECS instances that can be added to the scaling group. If you specify InitialMaxSize, you must also specify PredictiveValueBehavior.
MetricName string
A CloudMonitor metric name.
MetricType string
The type of the metric. Valid values: system, custom, hybrid.
MinAdjustmentMagnitude int
The minimum number of instances that must be scaled. This parameter takes effect if you set ScalingRuleType to SimpleScalingRule or StepScalingRule, and AdjustmentType to PercentChangeInCapacity.
PredictiveScalingMode string
The mode of the predictive scaling rule. Valid values: PredictAndScale, PredictOnly.
PredictiveTaskBufferTime int
The amount of buffer time before the prediction task runs. By default, all prediction tasks that are automatically created by a predictive scaling rule run on the hour. You can specify a buffer time to run prediction tasks and prepare resources in advance. Valid values: 0 to 60. Unit: minutes.
PredictiveValueBehavior string
The action on the predicted maximum value. Valid values: MaxOverridePredictiveValue, PredictiveValueOverrideMax, PredictiveValueOverrideMaxWithBuffer.
PredictiveValueBuffer int
The ratio based on which the predicted value is increased if you set PredictiveValueBehavior to PredictiveValueOverrideMaxWithBuffer. If the predicted value increased by this ratio is greater than the initial maximum capacity, the increased value is used as the maximum value for prediction tasks. Valid values: 0 to 100.
ScaleInEvaluationCount int
The number of consecutive times that the event-triggered task created for scale-ins must meet the threshold conditions before an alert is triggered. After a target tracking scaling rule is created, an event-triggered task is automatically created and associated with the target tracking scaling rule.
ScaleOutEvaluationCount int
The number of consecutive times that the event-triggered task created for scale-outs must meet the threshold conditions before an alert is triggered. After a target tracking scaling rule is created, an event-triggered task is automatically created and associated with the target tracking scaling rule.
ScalingGroupId Changes to this property will trigger replacement. string
ID of the scaling group of a scaling rule.
ScalingRuleName string
Name shown for the scaling rule, which must contain 2-64 characters (English or Chinese), starting with numbers, English letters or Chinese characters, and can contain number, underscores _, hypens -, and decimal point .. If this parameter value is not specified, the default value is scaling rule id.
ScalingRuleType Changes to this property will trigger replacement. string
The scaling rule type, either "SimpleScalingRule", "TargetTrackingScalingRule", "StepScalingRule", "PredictiveScalingRule". Default to "SimpleScalingRule".
StepAdjustments []ScalingRuleStepAdjustmentArgs
Steps for StepScalingRule. See step_adjustment below.
TargetValue float64
The target value for the metric.
adjustmentType String
Adjustment mode of a scaling rule. Optional values:

  • QuantityChangeInCapacity: It is used to increase or decrease a specified number of ECS instances.
  • PercentChangeInCapacity: It is used to increase or decrease a specified proportion of ECS instances.
  • TotalCapacity: It is used to adjust the quantity of ECS instances in the current scaling group to a specified value.
adjustmentValue Integer
The number of ECS instances to be adjusted in the scaling rule. This parameter is required and applicable only to simple scaling rules. The number of ECS instances to be adjusted in a single scaling activity cannot exceed 500. Value range:

  • QuantityChangeInCapacity:(0, 500] U (-500, 0]
  • PercentChangeInCapacity:[0, 10000] U [-100, 0]
  • TotalCapacity:[0, 1000]
alarmDimension Changes to this property will trigger replacement. ScalingRuleAlarmDimension
AlarmDimension for StepScalingRule. See alarm_dimension below.
ari String
The unique identifier of the scaling rule.
cooldown Integer
The cooldown time of the scaling rule. This parameter is applicable only to simple scaling rules. Value range: [0, 86,400], in seconds. The default value is empty,if not set, the return value will be 0, which is the default value of integer.
disableScaleIn Boolean
Indicates whether scale in by the target tracking policy is disabled. Default to false.
estimatedInstanceWarmup Integer
The estimated time, in seconds, until a newly launched instance will contribute CloudMonitor metrics. Default to 300.
hybridMetrics List<ScalingRuleHybridMetric>
The Hybrid Cloud Monitoring metrics. See hybrid_metrics below.
hybridMonitorNamespace String
The ID of the Hybrid Cloud Monitoring metric repository.
initialMaxSize Integer
The maximum number of ECS instances that can be added to the scaling group. If you specify InitialMaxSize, you must also specify PredictiveValueBehavior.
metricName String
A CloudMonitor metric name.
metricType String
The type of the metric. Valid values: system, custom, hybrid.
minAdjustmentMagnitude Integer
The minimum number of instances that must be scaled. This parameter takes effect if you set ScalingRuleType to SimpleScalingRule or StepScalingRule, and AdjustmentType to PercentChangeInCapacity.
predictiveScalingMode String
The mode of the predictive scaling rule. Valid values: PredictAndScale, PredictOnly.
predictiveTaskBufferTime Integer
The amount of buffer time before the prediction task runs. By default, all prediction tasks that are automatically created by a predictive scaling rule run on the hour. You can specify a buffer time to run prediction tasks and prepare resources in advance. Valid values: 0 to 60. Unit: minutes.
predictiveValueBehavior String
The action on the predicted maximum value. Valid values: MaxOverridePredictiveValue, PredictiveValueOverrideMax, PredictiveValueOverrideMaxWithBuffer.
predictiveValueBuffer Integer
The ratio based on which the predicted value is increased if you set PredictiveValueBehavior to PredictiveValueOverrideMaxWithBuffer. If the predicted value increased by this ratio is greater than the initial maximum capacity, the increased value is used as the maximum value for prediction tasks. Valid values: 0 to 100.
scaleInEvaluationCount Integer
The number of consecutive times that the event-triggered task created for scale-ins must meet the threshold conditions before an alert is triggered. After a target tracking scaling rule is created, an event-triggered task is automatically created and associated with the target tracking scaling rule.
scaleOutEvaluationCount Integer
The number of consecutive times that the event-triggered task created for scale-outs must meet the threshold conditions before an alert is triggered. After a target tracking scaling rule is created, an event-triggered task is automatically created and associated with the target tracking scaling rule.
scalingGroupId Changes to this property will trigger replacement. String
ID of the scaling group of a scaling rule.
scalingRuleName String
Name shown for the scaling rule, which must contain 2-64 characters (English or Chinese), starting with numbers, English letters or Chinese characters, and can contain number, underscores _, hypens -, and decimal point .. If this parameter value is not specified, the default value is scaling rule id.
scalingRuleType Changes to this property will trigger replacement. String
The scaling rule type, either "SimpleScalingRule", "TargetTrackingScalingRule", "StepScalingRule", "PredictiveScalingRule". Default to "SimpleScalingRule".
stepAdjustments List<ScalingRuleStepAdjustment>
Steps for StepScalingRule. See step_adjustment below.
targetValue Double
The target value for the metric.
adjustmentType string
Adjustment mode of a scaling rule. Optional values:

  • QuantityChangeInCapacity: It is used to increase or decrease a specified number of ECS instances.
  • PercentChangeInCapacity: It is used to increase or decrease a specified proportion of ECS instances.
  • TotalCapacity: It is used to adjust the quantity of ECS instances in the current scaling group to a specified value.
adjustmentValue number
The number of ECS instances to be adjusted in the scaling rule. This parameter is required and applicable only to simple scaling rules. The number of ECS instances to be adjusted in a single scaling activity cannot exceed 500. Value range:

  • QuantityChangeInCapacity:(0, 500] U (-500, 0]
  • PercentChangeInCapacity:[0, 10000] U [-100, 0]
  • TotalCapacity:[0, 1000]
alarmDimension Changes to this property will trigger replacement. ScalingRuleAlarmDimension
AlarmDimension for StepScalingRule. See alarm_dimension below.
ari string
The unique identifier of the scaling rule.
cooldown number
The cooldown time of the scaling rule. This parameter is applicable only to simple scaling rules. Value range: [0, 86,400], in seconds. The default value is empty,if not set, the return value will be 0, which is the default value of integer.
disableScaleIn boolean
Indicates whether scale in by the target tracking policy is disabled. Default to false.
estimatedInstanceWarmup number
The estimated time, in seconds, until a newly launched instance will contribute CloudMonitor metrics. Default to 300.
hybridMetrics ScalingRuleHybridMetric[]
The Hybrid Cloud Monitoring metrics. See hybrid_metrics below.
hybridMonitorNamespace string
The ID of the Hybrid Cloud Monitoring metric repository.
initialMaxSize number
The maximum number of ECS instances that can be added to the scaling group. If you specify InitialMaxSize, you must also specify PredictiveValueBehavior.
metricName string
A CloudMonitor metric name.
metricType string
The type of the metric. Valid values: system, custom, hybrid.
minAdjustmentMagnitude number
The minimum number of instances that must be scaled. This parameter takes effect if you set ScalingRuleType to SimpleScalingRule or StepScalingRule, and AdjustmentType to PercentChangeInCapacity.
predictiveScalingMode string
The mode of the predictive scaling rule. Valid values: PredictAndScale, PredictOnly.
predictiveTaskBufferTime number
The amount of buffer time before the prediction task runs. By default, all prediction tasks that are automatically created by a predictive scaling rule run on the hour. You can specify a buffer time to run prediction tasks and prepare resources in advance. Valid values: 0 to 60. Unit: minutes.
predictiveValueBehavior string
The action on the predicted maximum value. Valid values: MaxOverridePredictiveValue, PredictiveValueOverrideMax, PredictiveValueOverrideMaxWithBuffer.
predictiveValueBuffer number
The ratio based on which the predicted value is increased if you set PredictiveValueBehavior to PredictiveValueOverrideMaxWithBuffer. If the predicted value increased by this ratio is greater than the initial maximum capacity, the increased value is used as the maximum value for prediction tasks. Valid values: 0 to 100.
scaleInEvaluationCount number
The number of consecutive times that the event-triggered task created for scale-ins must meet the threshold conditions before an alert is triggered. After a target tracking scaling rule is created, an event-triggered task is automatically created and associated with the target tracking scaling rule.
scaleOutEvaluationCount number
The number of consecutive times that the event-triggered task created for scale-outs must meet the threshold conditions before an alert is triggered. After a target tracking scaling rule is created, an event-triggered task is automatically created and associated with the target tracking scaling rule.
scalingGroupId Changes to this property will trigger replacement. string
ID of the scaling group of a scaling rule.
scalingRuleName string
Name shown for the scaling rule, which must contain 2-64 characters (English or Chinese), starting with numbers, English letters or Chinese characters, and can contain number, underscores _, hypens -, and decimal point .. If this parameter value is not specified, the default value is scaling rule id.
scalingRuleType Changes to this property will trigger replacement. string
The scaling rule type, either "SimpleScalingRule", "TargetTrackingScalingRule", "StepScalingRule", "PredictiveScalingRule". Default to "SimpleScalingRule".
stepAdjustments ScalingRuleStepAdjustment[]
Steps for StepScalingRule. See step_adjustment below.
targetValue number
The target value for the metric.
adjustment_type str
Adjustment mode of a scaling rule. Optional values:

  • QuantityChangeInCapacity: It is used to increase or decrease a specified number of ECS instances.
  • PercentChangeInCapacity: It is used to increase or decrease a specified proportion of ECS instances.
  • TotalCapacity: It is used to adjust the quantity of ECS instances in the current scaling group to a specified value.
adjustment_value int
The number of ECS instances to be adjusted in the scaling rule. This parameter is required and applicable only to simple scaling rules. The number of ECS instances to be adjusted in a single scaling activity cannot exceed 500. Value range:

  • QuantityChangeInCapacity:(0, 500] U (-500, 0]
  • PercentChangeInCapacity:[0, 10000] U [-100, 0]
  • TotalCapacity:[0, 1000]
alarm_dimension Changes to this property will trigger replacement. ScalingRuleAlarmDimensionArgs
AlarmDimension for StepScalingRule. See alarm_dimension below.
ari str
The unique identifier of the scaling rule.
cooldown int
The cooldown time of the scaling rule. This parameter is applicable only to simple scaling rules. Value range: [0, 86,400], in seconds. The default value is empty,if not set, the return value will be 0, which is the default value of integer.
disable_scale_in bool
Indicates whether scale in by the target tracking policy is disabled. Default to false.
estimated_instance_warmup int
The estimated time, in seconds, until a newly launched instance will contribute CloudMonitor metrics. Default to 300.
hybrid_metrics Sequence[ScalingRuleHybridMetricArgs]
The Hybrid Cloud Monitoring metrics. See hybrid_metrics below.
hybrid_monitor_namespace str
The ID of the Hybrid Cloud Monitoring metric repository.
initial_max_size int
The maximum number of ECS instances that can be added to the scaling group. If you specify InitialMaxSize, you must also specify PredictiveValueBehavior.
metric_name str
A CloudMonitor metric name.
metric_type str
The type of the metric. Valid values: system, custom, hybrid.
min_adjustment_magnitude int
The minimum number of instances that must be scaled. This parameter takes effect if you set ScalingRuleType to SimpleScalingRule or StepScalingRule, and AdjustmentType to PercentChangeInCapacity.
predictive_scaling_mode str
The mode of the predictive scaling rule. Valid values: PredictAndScale, PredictOnly.
predictive_task_buffer_time int
The amount of buffer time before the prediction task runs. By default, all prediction tasks that are automatically created by a predictive scaling rule run on the hour. You can specify a buffer time to run prediction tasks and prepare resources in advance. Valid values: 0 to 60. Unit: minutes.
predictive_value_behavior str
The action on the predicted maximum value. Valid values: MaxOverridePredictiveValue, PredictiveValueOverrideMax, PredictiveValueOverrideMaxWithBuffer.
predictive_value_buffer int
The ratio based on which the predicted value is increased if you set PredictiveValueBehavior to PredictiveValueOverrideMaxWithBuffer. If the predicted value increased by this ratio is greater than the initial maximum capacity, the increased value is used as the maximum value for prediction tasks. Valid values: 0 to 100.
scale_in_evaluation_count int
The number of consecutive times that the event-triggered task created for scale-ins must meet the threshold conditions before an alert is triggered. After a target tracking scaling rule is created, an event-triggered task is automatically created and associated with the target tracking scaling rule.
scale_out_evaluation_count int
The number of consecutive times that the event-triggered task created for scale-outs must meet the threshold conditions before an alert is triggered. After a target tracking scaling rule is created, an event-triggered task is automatically created and associated with the target tracking scaling rule.
scaling_group_id Changes to this property will trigger replacement. str
ID of the scaling group of a scaling rule.
scaling_rule_name str
Name shown for the scaling rule, which must contain 2-64 characters (English or Chinese), starting with numbers, English letters or Chinese characters, and can contain number, underscores _, hypens -, and decimal point .. If this parameter value is not specified, the default value is scaling rule id.
scaling_rule_type Changes to this property will trigger replacement. str
The scaling rule type, either "SimpleScalingRule", "TargetTrackingScalingRule", "StepScalingRule", "PredictiveScalingRule". Default to "SimpleScalingRule".
step_adjustments Sequence[ScalingRuleStepAdjustmentArgs]
Steps for StepScalingRule. See step_adjustment below.
target_value float
The target value for the metric.
adjustmentType String
Adjustment mode of a scaling rule. Optional values:

  • QuantityChangeInCapacity: It is used to increase or decrease a specified number of ECS instances.
  • PercentChangeInCapacity: It is used to increase or decrease a specified proportion of ECS instances.
  • TotalCapacity: It is used to adjust the quantity of ECS instances in the current scaling group to a specified value.
adjustmentValue Number
The number of ECS instances to be adjusted in the scaling rule. This parameter is required and applicable only to simple scaling rules. The number of ECS instances to be adjusted in a single scaling activity cannot exceed 500. Value range:

  • QuantityChangeInCapacity:(0, 500] U (-500, 0]
  • PercentChangeInCapacity:[0, 10000] U [-100, 0]
  • TotalCapacity:[0, 1000]
alarmDimension Changes to this property will trigger replacement. Property Map
AlarmDimension for StepScalingRule. See alarm_dimension below.
ari String
The unique identifier of the scaling rule.
cooldown Number
The cooldown time of the scaling rule. This parameter is applicable only to simple scaling rules. Value range: [0, 86,400], in seconds. The default value is empty,if not set, the return value will be 0, which is the default value of integer.
disableScaleIn Boolean
Indicates whether scale in by the target tracking policy is disabled. Default to false.
estimatedInstanceWarmup Number
The estimated time, in seconds, until a newly launched instance will contribute CloudMonitor metrics. Default to 300.
hybridMetrics List<Property Map>
The Hybrid Cloud Monitoring metrics. See hybrid_metrics below.
hybridMonitorNamespace String
The ID of the Hybrid Cloud Monitoring metric repository.
initialMaxSize Number
The maximum number of ECS instances that can be added to the scaling group. If you specify InitialMaxSize, you must also specify PredictiveValueBehavior.
metricName String
A CloudMonitor metric name.
metricType String
The type of the metric. Valid values: system, custom, hybrid.
minAdjustmentMagnitude Number
The minimum number of instances that must be scaled. This parameter takes effect if you set ScalingRuleType to SimpleScalingRule or StepScalingRule, and AdjustmentType to PercentChangeInCapacity.
predictiveScalingMode String
The mode of the predictive scaling rule. Valid values: PredictAndScale, PredictOnly.
predictiveTaskBufferTime Number
The amount of buffer time before the prediction task runs. By default, all prediction tasks that are automatically created by a predictive scaling rule run on the hour. You can specify a buffer time to run prediction tasks and prepare resources in advance. Valid values: 0 to 60. Unit: minutes.
predictiveValueBehavior String
The action on the predicted maximum value. Valid values: MaxOverridePredictiveValue, PredictiveValueOverrideMax, PredictiveValueOverrideMaxWithBuffer.
predictiveValueBuffer Number
The ratio based on which the predicted value is increased if you set PredictiveValueBehavior to PredictiveValueOverrideMaxWithBuffer. If the predicted value increased by this ratio is greater than the initial maximum capacity, the increased value is used as the maximum value for prediction tasks. Valid values: 0 to 100.
scaleInEvaluationCount Number
The number of consecutive times that the event-triggered task created for scale-ins must meet the threshold conditions before an alert is triggered. After a target tracking scaling rule is created, an event-triggered task is automatically created and associated with the target tracking scaling rule.
scaleOutEvaluationCount Number
The number of consecutive times that the event-triggered task created for scale-outs must meet the threshold conditions before an alert is triggered. After a target tracking scaling rule is created, an event-triggered task is automatically created and associated with the target tracking scaling rule.
scalingGroupId Changes to this property will trigger replacement. String
ID of the scaling group of a scaling rule.
scalingRuleName String
Name shown for the scaling rule, which must contain 2-64 characters (English or Chinese), starting with numbers, English letters or Chinese characters, and can contain number, underscores _, hypens -, and decimal point .. If this parameter value is not specified, the default value is scaling rule id.
scalingRuleType Changes to this property will trigger replacement. String
The scaling rule type, either "SimpleScalingRule", "TargetTrackingScalingRule", "StepScalingRule", "PredictiveScalingRule". Default to "SimpleScalingRule".
stepAdjustments List<Property Map>
Steps for StepScalingRule. See step_adjustment below.
targetValue Number
The target value for the metric.

Supporting Types

ScalingRuleAlarmDimension
, ScalingRuleAlarmDimensionArgs

DimensionKey string
The dimension key of the metric.
DimensionValue Changes to this property will trigger replacement. string
The dimension value of the metric.
DimensionKey string
The dimension key of the metric.
DimensionValue Changes to this property will trigger replacement. string
The dimension value of the metric.
dimensionKey String
The dimension key of the metric.
dimensionValue Changes to this property will trigger replacement. String
The dimension value of the metric.
dimensionKey string
The dimension key of the metric.
dimensionValue Changes to this property will trigger replacement. string
The dimension value of the metric.
dimension_key str
The dimension key of the metric.
dimension_value Changes to this property will trigger replacement. str
The dimension value of the metric.
dimensionKey String
The dimension key of the metric.
dimensionValue Changes to this property will trigger replacement. String
The dimension value of the metric.

ScalingRuleHybridMetric
, ScalingRuleHybridMetricArgs

Dimensions List<Pulumi.AliCloud.Ess.Inputs.ScalingRuleHybridMetricDimension>
The structure of volumeMounts. See dimensions below for details.
Expression string
The metric expression that consists of multiple Hybrid Cloud Monitoring metrics. It calculates a result used to trigger scaling events. The expression must comply with the Reverse Polish Notation (RPN) specification, and the operators can only be + - × /.
Id string
The reference ID of the metric in the metric expression.
MetricName string
The name of the Hybrid Cloud Monitoring metric.
Statistic string
The statistical method of the metric value. Valid values: Average, Minimum, Maximum.
Dimensions []ScalingRuleHybridMetricDimension
The structure of volumeMounts. See dimensions below for details.
Expression string
The metric expression that consists of multiple Hybrid Cloud Monitoring metrics. It calculates a result used to trigger scaling events. The expression must comply with the Reverse Polish Notation (RPN) specification, and the operators can only be + - × /.
Id string
The reference ID of the metric in the metric expression.
MetricName string
The name of the Hybrid Cloud Monitoring metric.
Statistic string
The statistical method of the metric value. Valid values: Average, Minimum, Maximum.
dimensions List<ScalingRuleHybridMetricDimension>
The structure of volumeMounts. See dimensions below for details.
expression String
The metric expression that consists of multiple Hybrid Cloud Monitoring metrics. It calculates a result used to trigger scaling events. The expression must comply with the Reverse Polish Notation (RPN) specification, and the operators can only be + - × /.
id String
The reference ID of the metric in the metric expression.
metricName String
The name of the Hybrid Cloud Monitoring metric.
statistic String
The statistical method of the metric value. Valid values: Average, Minimum, Maximum.
dimensions ScalingRuleHybridMetricDimension[]
The structure of volumeMounts. See dimensions below for details.
expression string
The metric expression that consists of multiple Hybrid Cloud Monitoring metrics. It calculates a result used to trigger scaling events. The expression must comply with the Reverse Polish Notation (RPN) specification, and the operators can only be + - × /.
id string
The reference ID of the metric in the metric expression.
metricName string
The name of the Hybrid Cloud Monitoring metric.
statistic string
The statistical method of the metric value. Valid values: Average, Minimum, Maximum.
dimensions Sequence[ScalingRuleHybridMetricDimension]
The structure of volumeMounts. See dimensions below for details.
expression str
The metric expression that consists of multiple Hybrid Cloud Monitoring metrics. It calculates a result used to trigger scaling events. The expression must comply with the Reverse Polish Notation (RPN) specification, and the operators can only be + - × /.
id str
The reference ID of the metric in the metric expression.
metric_name str
The name of the Hybrid Cloud Monitoring metric.
statistic str
The statistical method of the metric value. Valid values: Average, Minimum, Maximum.
dimensions List<Property Map>
The structure of volumeMounts. See dimensions below for details.
expression String
The metric expression that consists of multiple Hybrid Cloud Monitoring metrics. It calculates a result used to trigger scaling events. The expression must comply with the Reverse Polish Notation (RPN) specification, and the operators can only be + - × /.
id String
The reference ID of the metric in the metric expression.
metricName String
The name of the Hybrid Cloud Monitoring metric.
statistic String
The statistical method of the metric value. Valid values: Average, Minimum, Maximum.

ScalingRuleHybridMetricDimension
, ScalingRuleHybridMetricDimensionArgs

ScalingRuleStepAdjustment
, ScalingRuleStepAdjustmentArgs

MetricIntervalLowerBound string
The lower bound of step.
MetricIntervalUpperBound string
The upper bound of step.
ScalingAdjustment int
The adjust value of step.
MetricIntervalLowerBound string
The lower bound of step.
MetricIntervalUpperBound string
The upper bound of step.
ScalingAdjustment int
The adjust value of step.
metricIntervalLowerBound String
The lower bound of step.
metricIntervalUpperBound String
The upper bound of step.
scalingAdjustment Integer
The adjust value of step.
metricIntervalLowerBound string
The lower bound of step.
metricIntervalUpperBound string
The upper bound of step.
scalingAdjustment number
The adjust value of step.
metric_interval_lower_bound str
The lower bound of step.
metric_interval_upper_bound str
The upper bound of step.
scaling_adjustment int
The adjust value of step.
metricIntervalLowerBound String
The lower bound of step.
metricIntervalUpperBound String
The upper bound of step.
scalingAdjustment Number
The adjust value of step.

Import

ESS scaling rule can be imported using the id, e.g.

$ pulumi import alicloud:ess/scalingRule:ScalingRule example abc123456
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.