Creates a scaling rule for Auto Scaling (ESS).
Syntax
{
"Type": "ALIYUN::ESS::ScalingRule",
"Properties": {
"AdjustmentValue": Integer,
"Cooldown": Integer,
"ScalingGroupId": String,
"AdjustmentType": String,
"ScalingRuleName": String,
"MetricName": String,
"PredictiveTaskBufferTime": Integer,
"ScalingRuleType": String,
"PredictiveValueBuffer": Integer,
"TargetValue": Number,
"StepAdjustment": List,
"PredictiveValueBehavior": String,
"DisableScaleIn": Boolean,
"InitialMaxSize": Integer,
"MinAdjustmentMagnitude": Integer,
"EstimatedInstanceWarmup": Integer,
"PredictiveScalingMode": String,
"ScaleInEvaluationCount": Integer,
"ScaleOutEvaluationCount": Integer
}
}
Properties
| Property name | Type | Required | Update allowed | Description | Constraints |
| AdjustmentValue | Integer | No | Yes |
The adjustment value. Applies to simple scaling rules and step scaling rules. |
Valid values vary based on AdjustmentType:
Note The number of ECS instances that are adjusted in a single scaling activity cannot exceed 500. |
| Cooldown | Integer | No | Yes | The cooldown time. Applies only to simple scaling rules. | Valid values: 0 to 86400. Unit: seconds. The default value is empty. |
| ScalingGroupId | String | Yes | No | The ID of the scaling group to which the scaling rule belongs. | None |
| AdjustmentType | String | No | Yes | The adjustment method. Applies to simple scaling rules and step scaling rules. | Valid values:
|
| ScalingRuleName | String | No | Yes | The name of the scaling rule. | The name must be 2 to 64 characters in length. It can contain letters, digits, underscores (_), hyphens (-), and periods (.). The name must start with a letter or a digit. If you do not specify this parameter, the value of ScalingRuleId is used by default. |
| MetricName | String | No | No | The predefined metric. Applies to target tracking scaling rules and predictive scaling rules. | Valid values:
|
| PredictiveTaskBufferTime | Integer | No | No | A predictive scaling rule automatically creates a predictive task that runs on the hour. Set a buffer time to run the task in advance and prepare resources. | Valid values: 0 to 60. Unit: minutes. Default value: 0. |
| ScalingRuleType | String | No | No | The type of the scaling rule. | Valid values:
|
| PredictiveValueBuffer | Integer | No | No | The percentage by which the predicted value is increased. Takes effect only when PredictiveValueBehavior is set to PredictiveValueOverrideMaxWithBuffer. If the increased value is greater than the initial maximum value, the increased value is used. | Valid values: 0 to 100. Default value: 0. |
| TargetValue | Number | No | No | The target value. Applies to target tracking scaling rules and predictive scaling rules. | The value of TargetValue can have up to three decimal places and must be greater than 0. |
| StepAdjustment | List | No | No | Procedure | For more information, see StepAdjustment properties. |
| PredictiveValueBehavior | String | No | No | The action to take on the maximum value for a predictive scaling rule. | Valid values:
|
| DisableScaleIn | Boolean | No | No | Specifies whether to disable scale-in. Applies only to target tracking scaling rules. | Valid values:
|
| InitialMaxSize | Integer | No | No | The maximum number of instances in the scaling group. Used with PredictiveValueBehavior. | The default value is the maximum number of instances (MaxSize) of the scaling group. |
| MinAdjustmentMagnitude | Integer | No | No | The minimum number of instances to adjust. | This parameter takes effect only when ScalingRuleType is SimpleScalingRule or StepScalingRule and AdjustmentType is PercentChangeInCapacity. |
| EstimatedInstanceWarmup | Integer | No | No | The warm-up period for newly added instances. Applies to target tracking scaling rules and step scaling rules. | Valid values: 0 to 86,400. Unit: seconds. Default value: 300.An ECS instance in the ramp-up state is added to the scaling group as usual, but its monitoring data is not reported to CloudMonitor during this period. Note When the number of ECS instances to be scaled is dynamically calculated, instances in the ramp-up state are not counted as part of the current number of instances. |
| PredictiveScalingMode | String | No | No | The mode of the predictive scaling rule. | Valid values:
|
| ScaleInEvaluationCount | Integer | No | Yes | The number of consecutive times the threshold must be met before a scale-in event-triggered task is triggered. | After you create a target tracking scaling rule, an event-triggered task is automatically created. Default value: 15. |
| ScaleOutEvaluationCount | Integer | No | Yes | The number of consecutive times the threshold must be met before a scale-out event-triggered task is triggered. | After you create a target tracking scaling rule, an event-triggered task is automatically created. Default value: 3. |
StepAdjustment syntax
"StepAdjustment": [
{
"MetricIntervalUpperBound": Number,
"ScalingAdjustment": Integer,
"MetricIntervalLowerBound": Number
}
]
StepAdjustment properties
| Property Name | Type | Required | Update allowed | Description | Constraints |
| MetricIntervalUpperBound | Number | No | No | The upper bound of the step. Applies only to step scaling rules. | Valid values: -9.999999E18 to 9.999999E18. |
| ScalingAdjustment | Integer | No | No | The number of instances to add in the step. Applies only to step scaling rules. | None |
| MetricIntervalLowerBound | Number | No | No | The lower bound of the step. Applies only to step scaling rules. | Valid values: -9.999999E18 to 9.999999E18. |
Return values
Fn::GetAtt
- ScalingRuleAri: The unique identifier of the scaling rule.
- ScalingRuleId: The system-generated, globally unique ID of the scaling rule.
Examples
-
JSONformat{ "ROSTemplateFormatVersion": "2015-09-01", "Description": "Test ESS ScalingRule", "Parameters": { "AutoScalingGroupId": { "Type": "String", "AssociationProperty": "ALIYUN::ESS::AutoScalingGroup::AutoScalingGroupId" } }, "Resources": { "ScalingRule": { "Type": "ALIYUN::ESS::ScalingRule", "Properties": { "AdjustmentType": "QuantityChangeInCapacity", "ScalingGroupId": { "Ref": "AutoScalingGroupId" }, "AdjustmentValue": 1 } } }, "Outputs": { } }
该文章对您有帮助吗?