Skip to content

ScalingRuleProps

Properties for defining a ScalingRule.

See https://www.alibabacloud.com/help/ros/developer-reference/aliyun-ess-scalingrule

Initializer

import { ScalingRuleProps } from '@alicloud/ros-cdk-ess'
const scalingRuleProps: ScalingRuleProps = { ... }

Properties

Name Type Description
scalingGroupId string | @alicloud/ros-cdk-core.IResolvable Property scalingGroupId: ID of the scaling group of a scaling rule.
adjustmentType string | @alicloud/ros-cdk-core.IResolvable Property adjustmentType: The adjustment method of the scaling rule.
adjustmentValue number | @alicloud/ros-cdk-core.IResolvable Property adjustmentValue: The number of instances that must be scaled based on the scaling rule.
cooldown number | @alicloud/ros-cdk-core.IResolvable Property cooldown: The cooldown period of the scaling rule.
disableScaleIn boolean | @alicloud/ros-cdk-core.IResolvable Property disableScaleIn: Specifies whether to disable scale-in.
estimatedInstanceWarmup number | @alicloud/ros-cdk-core.IResolvable Property estimatedInstanceWarmup: The warm-up period of the ECS instances.
initialMaxSize number | @alicloud/ros-cdk-core.IResolvable Property initialMaxSize: The maximum number of ECS instances in the scaling group, which is used together with PredictiveValueBehavior.
metricName string | @alicloud/ros-cdk-core.IResolvable Property metricName: The predefined metric to monitor.
minAdjustmentMagnitude number | @alicloud/ros-cdk-core.IResolvable Property minAdjustmentMagnitude: The minimum number of ECS instances to be adjusted in a scaling rule.
predictiveScalingMode string | @alicloud/ros-cdk-core.IResolvable Property predictiveScalingMode: The mode of the predictive scaling rule.
predictiveTaskBufferTime number | @alicloud/ros-cdk-core.IResolvable Property predictiveTaskBufferTime: The amount of buffer time ahead of the forecast task execution time.
predictiveValueBehavior string | @alicloud/ros-cdk-core.IResolvable Property predictiveValueBehavior: The action taken on the predicted maximum value.
predictiveValueBuffer number | @alicloud/ros-cdk-core.IResolvable Property predictiveValueBuffer: The ratio of the increment to the predicted value when PredictiveValueBehavior is set to PredictiveValueOverrideMaxWithBuffer.
scaleInEvaluationCount number | @alicloud/ros-cdk-core.IResolvable Property scaleInEvaluationCount: The number of consecutive times that the event-triggered task created for scale-in activities meets the threshold conditions before an alert is triggered.
scaleOutEvaluationCount number | @alicloud/ros-cdk-core.IResolvable Property scaleOutEvaluationCount: The number of consecutive times that the event-triggered task created for scale-out activities meets the threshold conditions before an alert is triggered.
scalingRuleName string | @alicloud/ros-cdk-core.IResolvable Property scalingRuleName: The name of the scaling rule.
scalingRuleType string | @alicloud/ros-cdk-core.IResolvable Property scalingRuleType: The type of the scaling rule.
stepAdjustment @alicloud/ros-cdk-core.IResolvable | @alicloud/ros-cdk-core.IResolvable | StepAdjustmentProperty[] Property stepAdjustment: Details of the step adjustments.
targetValue number | @alicloud/ros-cdk-core.IResolvable Property targetValue: The target value of a metric.

scalingGroupIdRequired

public readonly scalingGroupId: string | IResolvable;
  • Type: string | @alicloud/ros-cdk-core.IResolvable

Property scalingGroupId: ID of the scaling group of a scaling rule.


adjustmentTypeOptional

public readonly adjustmentType: string | IResolvable;
  • Type: string | @alicloud/ros-cdk-core.IResolvable

Property adjustmentType: The adjustment method of the scaling rule.

If you set ScalingRuleType to SimpleScalingRule or StepScalingRule, you must specify this parameter. Valid values: * QuantityChangeInCapacity: adds the specified number of ECS instances to or removes the specified number of ECS instances from the scaling group. * PercentChangeInCapacity: adds the specified percentage of ECS instances to or removes the specified percentage of ECS instances from the scaling group. * TotalCapacity: adjusts the number of ECS instances in the scaling group to a specified number.


adjustmentValueOptional

public readonly adjustmentValue: number | IResolvable;
  • Type: number | @alicloud/ros-cdk-core.IResolvable

Property adjustmentValue: The number of instances that must be scaled based on the scaling rule.

If you set ScalingRuleType to SimpleScalingRule or StepScalingRule, you must specify this parameter. The number of ECS instances that must be scaled in a scaling activity cannot exceed 1,000. Valid values of AdjustmentValue vary based on the value of AdjustmentType. * Valid values if AdjustmentType is set to QuantityChangeInCapacity: -1000 to 1000. * Valid values if AdjustmentType is set to PercentChangeInCapacity: -100 to 10000. * Valid values if AdjustmentType is set to TotalCapacity: 0 to 2000.


cooldownOptional

public readonly cooldown: number | IResolvable;
  • Type: number | @alicloud/ros-cdk-core.IResolvable

Property cooldown: The cooldown period of the scaling rule.

This parameter is available only if you set ScalingRuleType to SimpleScalingRule. Valid values: 0 to 86400. Unit: seconds. You can leave this parameter empty.


disableScaleInOptional

public readonly disableScaleIn: boolean | IResolvable;
  • Type: boolean | @alicloud/ros-cdk-core.IResolvable

Property disableScaleIn: Specifies whether to disable scale-in.

This parameter is applicable only to target tracking scaling rules. Default value: false


estimatedInstanceWarmupOptional

public readonly estimatedInstanceWarmup: number | IResolvable;
  • Type: number | @alicloud/ros-cdk-core.IResolvable

Property estimatedInstanceWarmup: The warm-up period of the ECS instances.

This parameter is applicable to target tracking scaling rules and step scaling rules. The system adds ECS instances that are in the warm-up state to the scaling group, but does not report monitoring data during the warm-up period to CloudMonitor. Note: When calculating the number of ECS instances to be adjusted, the system does not count ECS instances in the warm-up state as part of the current capacity of the scaling group. Valid values: 0 to 86400. Unit: seconds. Default value: 300.


initialMaxSizeOptional

public readonly initialMaxSize: number | IResolvable;
  • Type: number | @alicloud/ros-cdk-core.IResolvable

Property initialMaxSize: The maximum number of ECS instances in the scaling group, which is used together with PredictiveValueBehavior.

Default value: the same as the value of MaxSize


metricNameOptional

public readonly metricName: string | IResolvable;
  • Type: string | @alicloud/ros-cdk-core.IResolvable

Property metricName: The predefined metric to monitor.

This parameter is required and applicable only to target tracking scaling rules and predictive scaling rules. Valid values of a target tracking scaling rule: - CpuUtilizationAgent: (recommended) the CPU utilization. - MemoryUtilization: (recommended) the memory usage.- CpuUtilization: the average CPU utilization. - IntranetTx: the outbound traffic over an internal network. - IntranetRx: the average inbound traffic over an internal network. - VpcInternetTx: the outbound traffic from a virtual private cloud (VPC) to the Internet. - VpcInternetRx: the inbound traffic from the Internet to a VPC. - LoadBalancerRealServerAverageQps: the queries per second (QPS) per Application Load Balancer (ALB) server group. Valid values of a predictive scaling rule: - CpuUtilization: the average CPU utilization. - IntranetRx: the average inbound traffic over an internal network. - IntranetTx: the average outbound traffic over an internal network.


minAdjustmentMagnitudeOptional

public readonly minAdjustmentMagnitude: number | IResolvable;
  • Type: number | @alicloud/ros-cdk-core.IResolvable

Property minAdjustmentMagnitude: The minimum number of ECS instances to be adjusted in a scaling rule.

This parameter takes effect only when the scaling rule type is SimpleScalingRule or StepScalingRule and AdjustmentType is PercentChangeInCapacity.


predictiveScalingModeOptional

public readonly predictiveScalingMode: string | IResolvable;
  • Type: string | @alicloud/ros-cdk-core.IResolvable

Property predictiveScalingMode: The mode of the predictive scaling rule.

Valid values: - PredictAndScale: generates forecasts and creates forecast tasks. - PredictOnly: generates forecasts but does not create forecast tasks. Default value: PredictAndScale


predictiveTaskBufferTimeOptional

public readonly predictiveTaskBufferTime: number | IResolvable;
  • Type: number | @alicloud/ros-cdk-core.IResolvable

Property predictiveTaskBufferTime: The amount of buffer time ahead of the forecast task execution time.

By default, all scheduled tasks that are automatically created for a predictive scaling rule are executed at the beginning of each hour. You can set a buffer time to execute forecast tasks ahead of schedule, so that resources can be prepared in advance. Valid values: 0 to 60. Unit: minutes. Default value: 0


predictiveValueBehaviorOptional

public readonly predictiveValueBehavior: string | IResolvable;
  • Type: string | @alicloud/ros-cdk-core.IResolvable

Property predictiveValueBehavior: The action taken on the predicted maximum value.

Valid values: - MaxOverridePredictiveValue: uses the initial maximum capacity as the maximum value for forecast tasks when the predicted value is greater than the initial maximum capacity. - PredictiveValueOverrideMax: uses the predicted value as the maximum value for forecast tasks when the predicted value is greater than the initial maximum capacity. - PredictiveValueOverrideMaxWithBuffer: increases the predicted value with a ratio, which is specified by PredictiveValueBuffer. If the value after the increase is greater than the initial maximum capacity, the value after the increase is used as the maximum value for forecast tasks. Default value: MaxOverridePredictiveValue


predictiveValueBufferOptional

public readonly predictiveValueBuffer: number | IResolvable;
  • Type: number | @alicloud/ros-cdk-core.IResolvable

Property predictiveValueBuffer: The ratio of the increment to the predicted value when PredictiveValueBehavior is set to PredictiveValueOverrideMaxWithBuffer.

When the value after the increase is greater than the initial maximum capacity, the value after the increase is used for forecast tasks. Valid values: 0 to 100 Default value: 0


scaleInEvaluationCountOptional

public readonly scaleInEvaluationCount: number | IResolvable;
  • Type: number | @alicloud/ros-cdk-core.IResolvable

Property scaleInEvaluationCount: The number of consecutive times that the event-triggered task created for scale-in activities meets the threshold conditions before an alert is triggered.

After a target tracking scaling rule is created, an event-triggered task is automatically created and then associated with the target tracking scaling rule. Default value: 15.


scaleOutEvaluationCountOptional

public readonly scaleOutEvaluationCount: number | IResolvable;
  • Type: number | @alicloud/ros-cdk-core.IResolvable

Property scaleOutEvaluationCount: The number of consecutive times that the event-triggered task created for scale-out activities meets the threshold conditions before an alert is triggered.

After a target tracking scaling rule is created, an event-triggered task is automatically created and then associated with the target tracking scaling rule. Default value: 3.


scalingRuleNameOptional

public readonly scalingRuleName: string | IResolvable;
  • Type: string | @alicloud/ros-cdk-core.IResolvable

Property scalingRuleName: The name of the scaling rule.

The name must be 2 to 64 characters in length, and can contain letters, digits, underscores (_), hyphens (-), and periods (.). The name must start with a letter or a digit. The name of a scaling rule must be unique within an account in a region.

If you leave this parameter empty, the scaling rule ID is used.


scalingRuleTypeOptional

public readonly scalingRuleType: string | IResolvable;
  • Type: string | @alicloud/ros-cdk-core.IResolvable

Property scalingRuleType: The type of the scaling rule.

Valid values: - SimpleScalingRule: scales ECS instances based on the values of AdjustmentType and AdjustmentValue. - TargetTrackingScalingRule: dynamically calculates the number of ECS instances to be adjusted and tries to keep the value of a predefined monitoring metric close to TargetValue. - StepScalingRule: scales ECS instances in steps based on specified thresholds and metric values. - PredictiveScalingRule: uses machine learning to analyze historical monitoring data of the scaling group and then predicts the future values of monitored metrics, the rule then automatically creates scheduled tasks to set the boundary values for the scaling group. If this parameter value is not specified, the default value is SimpleScalingRule.


stepAdjustmentOptional

public readonly stepAdjustment: IResolvable | IResolvable | StepAdjustmentProperty[];

Property stepAdjustment: Details of the step adjustments.


targetValueOptional

public readonly targetValue: number | IResolvable;
  • Type: number | @alicloud/ros-cdk-core.IResolvable

Property targetValue: The target value of a metric.

This parameter is required and applicable only to target tracking scaling rules and predictive scaling rules. The value of TargetValue must be greater than 0 and can have a maximum of three decimal places.