ALIYUN::ESS::ScalingRule is used to create a scaling rule.

Syntax

{
  "Type": "ALIYUN::ESS::ScalingRule",
  "Properties": {
    "AdjustmentValue": Integer,
    "Cooldown": Integer,
    "ScalingGroupId": String,
    "AdjustmentType": String,
    "ScalingRuleName": String
  }
}

Properties

Name Type Required Editable Description Validity
AdjustmentValue Integer No Yes

The number of ECS instances that are added or released when scaling occurs.

The number of ECS instances per adjustment cannot exceed 500.

Valid values in different adjustment modes:
  • QuantityChangeInCapacity: -500 to 500
  • PercentChangeInCapacity: -100 to 10,000
  • TotalCapacity: 0 to 1,000
Cooldown Integer No Yes The length of the cooldown period of the scaling rule.

Valid values: 0 to 86,400. Unit: second.

This parameter is empty by default.

ScalingGroupId String Yes No The ID of the scaling group to which the scaling rule belongs. None
AdjustmentType String Yes Yes The adjustment mode of the scaling rule. Valid values:
  • QuantityChangeInCapacity: It is used to increase or decrease ECS instances by a specified number.
  • PercentChangeInCapacity: It is used to increase or decrease ECS instances by a specified percentage of the current amount.
  • TotalCapacity: It is used to increase or decrease the total number of ECS instances in the current scaling group to a specified value.
ScalingRuleName String No Yes The display name of the scaling rule.

The name must be 2 to 40 characters in length and can contain letters, digits, underscores (_), hyphens (-), and periods (.). It must start with a letter or digit. The name of a scaling rule must be unique within the scaling group that it belongs to.

The default value is the ID of the scaling rule.

Response parameters

Fn::GetAtt

  • ScalingRuleAri: the unique identifier of the scaling rule.
  • ScalingRuleId: the ID of the scaling rule. It is a globally unique identifier (GUID) generated by the system.

Examples

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Resources": {
    "ScalingRule": {
      "Type": "ALIYUN::ESS::ScalingRule",
      "Properties": {
        "ScalingRuleName": {
          "Ref": "ScalingRuleName"
        },
        "Cooldown": {
          "Ref": "Cooldown"
        },
        "ScalingGroupId": {
          "Ref": "ScalingGroupId"
        },
        "AdjustmentType": {
          "Ref": "AdjustmentType"
        },
        "AdjustmentValue": {
          "Ref": "AdjustmentValue"
        }
      }
    }
  },
  "Parameters": {
    "ScalingRuleName": {
      "AllowedPattern": "^[a-zA-Z0-9\\u4e00-\\u9fa5][-_.a-zA-Z0-9\\u4e00-\\u9fa5]{1,63}$",
      "Type": "String",
      "Description": "Name shown for the scaling group, which is a string containing 2 to 40 characters. It must begin with a number, a letter (case-insensitive) or a letter and can contain numbers, \"_\", \"-\" or \". \". The account name in the same scaling group is unique in the same region. If this parameter value is not specified, the default value is ScalingRuleId."
    },
    "Cooldown": {
      "Type": "Number",
      "Description": "Cool-down time of a scaling rule. Value range: [0, 86,400], in seconds. The default value is empty.",
      "MaxValue": 86400,
      "MinValue": 0
    },
    "ScalingGroupId": {
      "Type": "String",
      "Description": "ID of the scaling group of a scaling rule."
    },
    "AdjustmentType": {
      "Type": "String",
      "Description": "Adjustment mode of a scaling rule. Optional values:\n- QuantityChangeInCapacity: It is used to increase or decrease a specified number of ECS instances.\n- PercentChangeInCapacity: It is used to increase or decrease a specified proportion of ECS instances.\n- TotalCapacity: It is used to adjust the quantity of ECS instances in the current scaling group to a specified value.",
      "AllowedValues": [
        "QuantityChangeInCapacity",
        "PercentChangeInCapacity",
        "TotalCapacity"
      ]
    },
    "AdjustmentValue": {
      "Type": "Number",
      "Description": "Adjusted value of a scaling rule. Value range:\n- QuantityChangeInCapacity: [-500, 500]\n- PercentChangeInCapacity: [-100, 10000]\n- TotalCapacity: [0, 1000]",
      "MaxValue": 10000,
      "MinValue": -500
    }
  },
  "Outputs": {
    "ScalingRuleAri": {
      "Description": "Unique identifier of a scaling rule.",
      "Value": {
        "Fn::GetAtt": [
          "ScalingRule",
          "ScalingRuleAri"
        ]
      }
    },
    "ScalingRuleId": {
      "Description": "ID of a scaling rule, generated by the system and globally unique.",
      "Value": {
        "Fn::GetAtt": [
          "ScalingRule",
          "ScalingRuleId"
        ]
      }
    }
  }
}