All Products
Search
Document Center

Auto Scaling:ModifyScalingRule

Last Updated:Aug 27, 2026

Modifies a scaling rule. If an existing scaling rule cannot meet your business requirements, you can call the ModifyScalingRule operation to modify the scaling rule, without the need to create a new one. This streamlines your workflow, enhancing operational efficiency while also contributing to cost optimization by avoiding redundant steps.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

ess:ModifyScalingRule

update

*ScalingGroup

acs:ess:{#regionId}:{#accountId}:scalinggroup/{#ScalingGroupId}

None None

Request parameters

Parameter

Type

Required

Description

Example

ScalingRuleId

string

Yes

The ID of the scaling rule that you want to modify.

asr-bp1dvirgwkoowxk7****

ScalingRuleName

string

No

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

The name of each scaling rule must be unique under the same account within the same region.

scalingrule****

Cooldown

integer

No

The cooldown time of the scaling rule. This parameter is available only if you set the ScalingRuleType parameter to SimpleScalingRule.

Valid values: 0 to 86400. Unit: seconds.

60

MinAdjustmentMagnitude

integer

No

The minimum number of instances to scale. This parameter takes effect only if you create a simple scaling rule or step scaling rule and set AdjustmentType to PercentChangeInCapacity.

1

AdjustmentType

string

No

The adjustment method of the scaling rule. This is required when the ScalingRuleType parameter is set to SimpleScalingRule or StepScalingRule. 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 the specified number.

QuantityChangeInCapacity

AdjustmentValue

integer

No

The target value specified in the scaling rule. This parameter is required when the ScalingRuleType parameter is set to SimpleScalingRule or StepScalingRule. The number of ECS instances that are scaled in a single scaling activity cannot exceed 1,000.

  • Valid values if you set the AdjustmentType parameter to QuantityChangeInCapacity: -1000 to 1000.

  • Valid values if you set the AdjustmentType parameter to PercentChangeInCapacity: -100 to 10000.

  • Valid values if you set the AdjustmentType parameter to TotalCapacity: 0 to 2000.

100

EstimatedInstanceWarmup

integer

No

The warmup period of an instance. This parameter is available only if you set the ScalingRuleType parameter to TargetTrackingScalingRule or PredictiveScalingRule. Auto Scaling adds ECS instances that are in the warmup state to a scaling group but does not report monitoring data to CloudMonitor during the warmup period.

Note

Auto Scaling calculates the number of ECS instances that need to be scaled. ECS instances in the warmup state are not counted towards the current capacity of the scaling group.

Valid values: 0 to 86400. Unit: seconds.

60

MetricName

string

No

The predefined metric. This parameter is required only if you create a target tracking scaling rule or predictive scaling rule.

Valid values if you create a target tracking scaling rule:

  • CpuUtilizationAgent (recommended): the CPU utilization.

  • MemoryUtilization (recommended): the memory usage.

  • CpuUtilization: the average CPU utilization.

  • IntranetTx: the average outbound traffic over an internal network.

  • IntranetRx: the average inbound traffic over an internal network.

  • VpcInternetTx: the average outbound traffic from a virtual private cloud (VPC) to the Internet.

  • VpcInternetRx: the average inbound traffic from the Internet to a VPC.

  • LoadBalancerRealServerAverageQps: the queries per second (QPS) per Application Load Balancer (ALB) server group.

Valid values if you create 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.

For more information, see Event-triggered tasks of the system monitoring type.

CpuUtilization

TargetValue

number

No

The target value. This parameter is available only if you set the ScalingRuleType parameter to TargetTrackingScalingRule or PredictiveScalingRule. The value must be greater than 0 and can have up to three decimal places.

0.125

DisableScaleIn

boolean

No

Specifies whether to disable scale-in. This parameter is available only if you set the ScalingRuleType parameter to TargetTrackingScalingRule.

true

ScaleInEvaluationCount

integer

No

The number of consecutive times that the event-triggered task created for scale-in activities 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 then associated with the target tracking scaling rule.

15

ScaleOutEvaluationCount

integer

No

The number of consecutive times that the event-triggered task created for scale-out activities 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 then associated with the target tracking scaling rule.

3

PredictiveScalingMode

string

No

The mode of the predictive scaling rule. Valid values:

  • PredictAndScale: produces predictions and creates prediction tasks.

  • PredictOnly: produces predictions but does not create prediction tasks.

PredictAndScale

PredictiveValueBehavior

string

No

Specifies which one of the initial maximum capacity and the predicted value can be used as the maximum value for prediction tasks. Valid values:

  • MaxOverridePredictiveValue: uses the initial maximum capacity as the maximum value for prediction tasks if the predicted value is greater than the initial maximum capacity.

  • PredictiveValueOverrideMax: uses the predicted value as the maximum value for prediction tasks when the predicted value is greater than the initial maximum capacity.

  • PredictiveValueOverrideMaxWithBuffer: increases the predicted value by a percentage that is specified by the PredictiveValueBuffer parameter. If the predicted value that is increased by the percentage is greater than the initial maximum capacity, the increased value is used as the maximum value for prediction tasks.

MaxOverridePredictiveValue

PredictiveValueBuffer

integer

No

The ratio based on which the predicted value is increased when PredictiveValueBehavior is set 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.

50

PredictiveTaskBufferTime

integer

No

The amount of buffer time before the prediction task is executed. By default, all prediction tasks that are automatically created for a predictive scaling rule are executed on the hour. You can specify an amount of buffer time for resource preparation before the prediction tasks are executed. Valid values: 0 to 60.

30

InitialMaxSize

integer

No

The maximum number of ECS instances that can be contained in the scaling group. If you specify InitialMaxSize, you must specify PredictiveValueBehavior.

100

StepAdjustments

array<object>

No

Details of the step adjustments.

object

No

Details of the step adjustments.

MetricIntervalUpperBound

number

No

The upper limit specified in a step adjustment. This parameter is available only if you set the ScalingRuleType parameter to StepScalingRule. Valid values: -9.999999E18 to 9.999999E18.

5.0

ScalingAdjustment

integer

No

The number of ECS instances that you want to scale in a step adjustment. This parameter is available only if you set the ScalingRuleType parameter to StepScalingRule.

1

MetricIntervalLowerBound

number

No

The lower limit that is specified in a step adjustment. This parameter is available only if you set the ScalingRuleType parameter to StepScalingRule. Valid values: -9.999999E18 to 9.999999E18.

1.0

AlarmDimensions

array<object>

No

The dimensions. This parameter is applicable to target tracking scaling rules. You can specify this parameter if your predefined metric requires extra dimensions. For example, if you predefine the LoadBalancerRealServerAverageQps metric, you must use this parameter to specify the rulePool dimension.

object

No

DimensionKey

string

No

The dimension key of the metric.

rulePool

DimensionValue

string

No

The dimension value of the metric.

sgp-l1cbirz451yxu2dxxx

MetricType

string

No

The metric type. Valid values:

  • system: system metrics of CloudMonitor.

  • custom: custom metrics that are reported to CloudMonitor.

  • hybrid: metrics of Hybrid Cloud Monitoring.

system

HybridMonitorNamespace

string

No

The ID of the Hybrid Cloud Monitoring namespace.

For information about how to manage Hybrid Cloud Monitoring namespaces, see Manage namespaces.

aliyun-test

HybridMetrics

array<object>

No

The Hybrid Cloud Monitoring metrics. For more information, see Create a custom target tracking scaling rule.

array<object>

No

Id

string

No

The reference ID of the metric in the metric expression.

a

Expression

string

No

The metric expression that consists of multiple Hybrid Cloud Monitoring metrics. It calculates a result used to trigger scaling events.

The expression must be written in Reverse Polish Notation (RPN) format and supports only the following operators: +, -, *, /.

(a+b)/2

MetricName

string

No

The name of the Hybrid Cloud Monitoring metric.

AliyunSmq_NumberOfMessagesVisible

Statistic

string

No

The statistical method of the metric value. Valid values:

  • Average: calculates the average value of all metric values within a specified interval.

  • Minimum: calculates the minimum value of all metric values within a specified interval.

  • Maximum: calculates the maximum value of all metric values within a specified interval.

Average

Dimensions

array<object>

No

The metric dimensions. You can use this parameter to specify the monitored resources.

object

No

DimensionKey

string

No

The key of the metric dimension.

queue

DimensionValue

string

No

The value of the metric dimension.

testQueue

AlarmOptions

object

No

The alert attributes.

Period

integer

No

The statistical period of the metric data in the target tracking scaling rule. Unit: seconds. Valid values:

  • 15

  • 60

  • 120

  • 300

  • 900

Note

Default value: 60.

60

Response elements

Element

Type

Description

Example

object

RequestId

string

The ID of the request.

473469C7-AA6F-4DC5-B3DB-A3DC0DE3****

Examples

Success response

JSON format

{
  "RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3****"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.