ALIYUN::ESS::ScalingConfiguration is used to create a scaling configuration for a scaling group.

Syntax

{
  "Type": "ALIYUN::ESS::ScalingConfiguration",
  "Properties": {
    "PasswordInherit": Boolean,
    "DiskMappings": List,
    "RamRoleName": String,
    "IoOptimized": String,
    "InternetChargeType": String,
    "KeyPairName": String,
    "InstanceId": String,
    "InstanceTypes": List,
    "ImageId": String,
    "ResourceGroupId": String,
    "SpotStrategy": String,
    "InstanceType": String,
    "SystemDiskCategory": String,
    "SystemDiskSize": Integer,
    "SystemDiskAutoSnapshotPolicyId": String,
    "SystemDiskPerformanceLevel": String,
    "InternetMaxBandwidthOut": Integer,
    "InstanceName": String,
    "InternetMaxBandwidthIn": Integer,
    "ScalingConfigurationName": String,
    "UserData": String,
    "DeploymentSetId": String,
    "SecurityGroupId": String,
    "SpotPriceLimit": Number,
    "HpcClusterId": String,
    "ScalingGroupId": String,
    "SpotPriceLimitForInstanceType": Map,
    "TagList": List,
    "Ipv6AddressCount": Integer,
    "LoadBalancerWeight": Integer,
    "CreditSpecification": String,
    "ImageFamily": String,
    "HostName": String,
    "Password": String
  }
}

Properties

PropertyTypeRequiredEditableDescriptionConstraint
ResourceGroupIdStringNoYesThe ID of the resource group to which the instance belongs. None.
DeploymentSetIdStringNoNoThe ID of the deployment set. None.
HpcClusterIdStringNoNoThe ID of the Elastic High Performance Computing (E-HPC) cluster to which the instance belongs. None.
ScalingGroupId String YesNo The ID of the scaling group to which the scaling configuration belongs. None.
DiskMappingsListNoYesThe disks that you want to attach to the instance. You can attach up to 16 disks.

For more information, see DiskMappings properties.

InternetChargeTypeStringNoYesThe billing method for Internet usage. Default value: PayByTraffic. Valid values:
  • PayByBandwidth
  • PayByTraffic
InternetMaxBandwidthInIntegerNoNoThe maximum inbound public bandwidth.

Unit: Mbit/s.

Valid values: 1 to 200.

If you leave this property empty, the system sets the maximum inbound public bandwidth to 200 Mbit/s. This property is not used for billing because the inbound traffic of instances is free of charge.

InternetMaxBandwidthOutIntegerNoYesThe maximum outbound public bandwidth. Valid values:
  • Valid values if you set the InternetChargeType property to PayByBandwidth: 0 to 100. Default value: 0.
  • Valid values if you set the InternetChargeType property to PayByTraffic: 0 to 100. In this case, this property is required.

Unit: Mbit/s.

InstanceId String No No The ID of the instance that is created based on the scaling configuration. None.
SystemDiskCategoryStringNoYesThe category of the system disk. Valid values:
  • cloud: basic disk
  • cloud_efficiency: ultra disk
  • cloud_ssd: standard SSD
  • ephemeral_ssd: local SSD
  • cloud_essd: enhanced SSD (ESSD)

For non-I/O optimized instances of Generation I instance families, the default value is cloud. For other types of instances, the default value is cloud_efficiency.

ImageIdStringNoYesThe ID of the image that is used to create the instance. You can use a public image, a custom image, or an Alibaba Cloud Marketplace image. For more information, see Overview.
InstanceTypeStringNoYesThe type of the instance. For more information, see Overview of instance families.
SecurityGroupId String NoYesThe ID of the security group to which the instance belongs. None.
IoOptimizedStringNoYesSpecifies whether to create an I/O optimized instance. Default value: none. Valid values:
  • none: does not create an I/O optimized instance.
  • optimized: creates an I/O optimized instance.
ScalingConfigurationName String No YesThe name of the scaling configuration.

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

The name of the scaling configuration must be unique within a scaling group in a region.

If you leave this property empty, the ID of the scaling configuration is used.

KeyPairNameStringNoYesThe name of the key pair that is used to connect to the instance.
  • For Windows instances, this property is ignored, and is empty by default.
  • For Linux instances, the password-based logon method is disabled during initialization.
RamRoleNameStringNoYesThe name of the RAM role for the instance. You can call the ListRoles operation of Resource Access Management (RAM) to query the role name. For more information, see CreateRole and ListRoles.
SystemDiskSizeIntegerNoYesThe size of the system disk.

Valid values: 20 to 500.

Default value: 40.

Unit: GiB.

If you use a custom image to create the system disk, make sure that the size of the system disk is greater than or equal to the size of the custom image.

SystemDiskPerformanceLevelStringNoYesThe performance level (PL) of the ESSD that is used as the system disk. Default value: PL1. Valid values:
  • PL1: An ESSD delivers up to 50,000 random read/write IOPS.
  • PL2: An ESSD delivers up to 100,000 random read/write IOPS.
  • PL3: An ESSD delivers up to 1,000,000 random read/write IOPS.
For more information about how to select the PLs of ESSDs, see ESSDs.
UserDataStringNoYesThe user data that you want to pass when you create the instance. The user data can be up to 16 KB in size. You do not need to convert the data into Base64-encoded strings. If the data contains special characters, you must add the escape character (\) before each special character.
InstanceTypesListNoYesThe instance types. If you specify this property, the system ignores the InstanceType property.

You can specify up to 10 instance types in a scaling configuration. The priority is determined in descending order of the instance types specified in the list. Auto Scaling creates instances based on the priorities of the instance types. If Auto Scaling cannot create instances of the instance type that has the highest priority, Auto Scaling creates instances of the instance type that has the next highest priority.

PasswordInheritBooleanNoYesSpecifies whether to use the preset password of the image. If you want to use the preset password, make sure that the specified image has a preset password.
TagListListNoYesThe tags of the instance. A tag is a key-value pair. You can specify up to five tags in the {"key1": "value1", "key2": "value2", ... "key5": "value5"} format.

For more information, see TagList properties.

Ipv6AddressCountIntegerNoYesThe number of randomly generated IPv6 addresses that you want to allocate to the elastic network interface (ENI). None.
LoadBalancerWeightIntegerNoYesThe weight of the Elastic Compute Service (ECS) instance that is used as the backend server of a Server Load Balancer (SLB) instance. Valid values: 1 to 100.

Default value: 50.

CreditSpecificationStringNoYesThe performance mode of the burstable instance. Default value: Unlimited. Valid values:
  • Unlimited
  • Standard
For more information about performance modes, see Performance modes.
ImageFamilyStringNoYesThe family name of the image that is used to create the instance. You can specify this property to obtain the latest available custom images that belong to the specified image family. If you specify the ImageId property, you cannot specify the ImageFamily property.
SpotStrategyStringNoYesThe preemption policy for the pay-as-you-go instance. Default value: NoSpot. Valid values:
  • NoSpot: The instance is created as a regular pay-as-you-go instance.
  • SpotWithPriceLimit: The instance is created as a preemptible instance for which you specify the maximum hourly price.
  • SpotAsPriceGo: The instance is created as a preemptible instance whose price is based on the market price at the time of purchase.
InstanceNameStringNoYesThe name of the instance that is created based on the scaling configuration. None.
SpotPriceLimitNumberNoYesThe maximum hourly price for the instance. The value of this property can contain up to three decimal places.

This property takes effect when you set the SpotStrategy property to SpotWithPriceLimit. If you specify both the SpotPriceLimit and SpotPriceLimitForInstanceType properties, the value of the SpotPriceLimit property is overwritten by the value of the SpotPriceLimitForInstanceType property.

SpotPriceLimitForInstanceTypeMapNoYesThe instance types and the bid prices for preemptible instances. Specify the value in the {"<instance_type_1>": <price_limit_1>, ..., {"<instance_type_10>": <price_limit_10>} format.

This property takes effect when you set the SpotStrategy property to SpotWithPriceLimit.

You can configure up to 10 sets of instance types and bid prices.

SystemDiskAutoSnapshotPolicyIdStringNoYesThe ID of the automatic snapshot policy that you want to apply to the system disk. None.
HostNameStringNoYesThe hostname of the ECS instance. The hostname cannot start or end with a period (.) or a hyphen (-). The hostname cannot contain consecutive periods (.) or hyphens (-).

The hostname that you can specify for an ECS instance varies based on the type of the instance:

  • Windows instances: The hostname must be 2 to 15 characters in length, and can contain letters, digits, and hyphens (-). The hostname cannot contain periods (.) or contain only digits.
  • Other instances such as Linux instances: The hostname must be 2 to 64 characters in length. You can use periods (.) to separate a hostname into multiple segments. Each segment can contain letters, digits, and hyphens (-).
PasswordStringNoYesThe password that you want to use to log on to the ECS instance. The password must be 8 to 30 characters in length. The password must contain at least three of the following character types: uppercase letters, lowercase letters, digits, and special characters. The following special characters are supported:
()` ~!@#$%^&*-_+=\|{}[]:;'<>,.?/
Passwords of Windows instances cannot start with a forward slash (/).
Note To ensure security, we recommend that you use HTTPS to send requests if the Password parameter is specified.

DiskMappings syntax

"DiskMappings": [
  {
    "Category": String,
    "DiskName": String,
    "Description": String,
    "AutoSnapshotPolicyId": String,
    "PerformanceLevel": String,
    "Encrypted": String,
    "KMSKeyId": String,
    "Device": String,
    "SnapshotId": String,
    "Size": String
  }
]

DiskMappings properties

PropertyTypeRequiredEditableDescriptionConstraint
Size String NoNo The size of the data disk. Valid values:
  • Valid values if you set the Category property to cloud: 5 to 2000
  • Valid values if you set the Category property to cloud_efficiency: 20 to 32768
  • Valid values if you set the Category property to cloud_ssd: 20 to 32768
  • Valid values if you set the Category property to cloud_essd: 20 to 32768
  • Valid values if you set the Category property to ephemeral_ssd: 5 to 800

Unit: GB.

The value of this property must be greater than or equal to the size of the snapshot specified by SnapshotId.

Category String No No The category of the data disk. Default value: cloud_efficiency. Valid values:
  • cloud: basic disk
  • cloud_efficiency: ultra disk
  • cloud_ssd: standard SSD
  • ephemeral_ssd: local SSD
  • cloud_essd: ESSD

For I/O optimized instances, the default value is cloud_efficiency. For non-I/O optimized instances, the default value is cloud.

DiskName String No No The name of the data disk. The name must be 2 to 128 characters in length, and can contain digits, letters, colons (:), underscores (_), and hyphens (-).

The name must start with a letter but cannot start with http:// or https://.

PerformanceLevelStringNoNoThe PL of the ESSD that is used as the data disk. Default value: PL1. Valid values:
  • PL1: An ESSD delivers up to 50,000 random read/write IOPS.
  • PL2: An ESSD delivers up to 100,000 random read/write IOPS.
  • PL3: An ESSD delivers up to 1,000,000 random read/write IOPS.
For more information about how to select the PLs of ESSDs, see ESSDs.
Description String No No The description of the data disk. The description must be 2 to 256 characters in length. The description cannot start with http:// or https://.
Device String No No The mount target of the data disk. If you do not specify this property, the system assigns a mount target in alphabetical order from /dev/xvdb to /dev/xvdz when the system creates the ECS instance.
SnapshotId String No No The ID of the snapshot that is used to create the data disk. If you specify this property, the Size property is ignored. The actual size of the created data disk is the size of the specified snapshot. If you specify a snapshot that was created on or before July 15, 2013, the snapshot cannot be requested and the InvalidSnapshot.TooOld error message is returned.
EncryptedStringNoNoSpecifies whether to encrypt the data disk. Default value: false. Valid values:
  • true
  • false
KMSKeyIdStringNoNoThe ID of the Key Management Service (KMS) key that is used to encrypt the data disk. None.
AutoSnapshotPolicyIdStringNoNoThe ID of the automatic snapshot policy that you want to apply to the data disk. None.

TagList syntax

"TagList": [
  {
    "Key": String,
    "Value": String
  }
]

TagList properties

PropertyTypeRequiredEditableDescriptionConstraint
KeyStringYesNoThe key of the tag. The tag key must be 1 to 64 characters in length, and cannot contain http:// or https://. The tag key cannot start with aliyun or acs:.
ValueStringNoNoThe value of the tag. The tag value can be up to 128 characters in length, and cannot contain http:// or https://. The tag value cannot start with aliyun or acs:.

Return values

Fn::GetAtt

ScalingConfigurationId: the ID of the scaling configuration. The ID is a GUID that is generated by the system for the scaling configuration.

Examples

  • YAML format

    ROSTemplateFormatVersion: '2015-09-01'
    Description: Test ESS ScalingConfiguration
    Parameters:
      AutoScalingGroupId:
        Type: String
        AssociationProperty: ALIYUN::ESS::AutoScalingGroup::AutoScalingGroupId
      SecurityGroupId:
        Type: String
        AssociationProperty: ALIYUN::ECS::SecurityGroup::SecurityGroupId
        Label:
           
          en: Security Group ID
      ImageId:
        Type: String
        AssociationProperty: ALIYUN::ECS::Image::ImageId
        AssociationPropertyMetadata:
          SupportedImageOwnerAlias:
            - system
            - self
            - others
    Resources:
      ScalingConfiguration:
        Type: ALIYUN::ESS::ScalingConfiguration
        Properties:
          InstanceType: ecs.c5.large
          ImageId:
            Ref: ImageId
          SystemDiskCategory: cloud_essd
          SystemDiskSize: 40
          ScalingConfigurationName: mytest
          ScalingGroupId:
            Ref: AutoScalingGroupId
          SecurityGroupId:
            Ref: SecurityGroupId
    Outputs: {}
  • JSON format

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Description": "Test ESS ScalingConfiguration",
      "Parameters": {
        "AutoScalingGroupId": {
          "Type": "String",
          "AssociationProperty": "ALIYUN::ESS::AutoScalingGroup::AutoScalingGroupId"
        },
        "SecurityGroupId": {
          "Type": "String",
          "AssociationProperty": "ALIYUN::ECS::SecurityGroup::SecurityGroupId",
          "Label": {
             
            "en": "Security Group ID"
          }
        },
        "ImageId": {
          "Type": "String",
          "AssociationProperty": "ALIYUN::ECS::Image::ImageId",
          "AssociationPropertyMetadata": {
            "SupportedImageOwnerAlias": ["system", "self", "others"]
          }
        }
      },
      "Resources": {
        "ScalingConfiguration": {
          "Type": "ALIYUN::ESS::ScalingConfiguration",
          "Properties": {
            "InstanceType": "ecs.c5.large",
            "ImageId": {
              "Ref": "ImageId"
            },
            "SystemDiskCategory": "cloud_essd",
            "SystemDiskSize": 40,
            "ScalingConfigurationName": "mytest",
            "ScalingGroupId": {
              "Ref": "AutoScalingGroupId"
            },
            "SecurityGroupId": {
              "Ref": "SecurityGroupId"
            }
          }
        }
      },
      "Outputs": {
      }
    }

If you want to define only one scaling configuration that has a dependency for a scaling group, you must use the DependsOn property for the scaling group when you configure the Resources section of a template. The DependsOn property is used to associate the scaling configuration with the dependency in the template.

In this example, the DependsOn property in ScalingGroup is set to SecurityGroup because SecurityGroup is the dependency of ScalingConfiguration.

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  VpcId:
    AssociationProperty: ALIYUN::ECS::VPC::VPCId
    Type: String
  VSwitchId:
    AssociationProperty: ALIYUN::ECS::VSwitch::VSwitchId
    Type: String
    AssociationPropertyMetadata:
      VpcId: VpcId
Resources:
  ScalingGroupEnable:
    Type: ALIYUN::ESS::ScalingGroupEnable
    Properties:
      ScalingConfigurationId:
        Ref: ScalingConfiguration
      ScalingGroupId:
        Ref: ScalingGroup
      ScalingRuleArisExecuteVersion: 0
  SecurityGroup:
    Type: ALIYUN::ECS::SecurityGroup
    Properties:
      SecurityGroupName:
        Ref: ALIYUN::StackName
      VpcId:
        Ref: VpcId
      SecurityGroupIngress:
        - PortRange: '-1/-1'
          Priority: 1
          SourceCidrIp: 0.0.X.X/0
          IpProtocol: all
          NicType: internet
      SecurityGroupEgress:
        - PortRange: '-1/-1'
          Priority: 1
          IpProtocol: all
          DestCidrIp: 0.0.X.X/0
          NicType: internet
        - PortRange: '-1/-1'
          Priority: 1
          IpProtocol: all
          DestCidrIp: 0.0.X.X/0
          NicType: intranet
  ScalingConfiguration:
    Type: ALIYUN::ESS::ScalingConfiguration
    DependsOn: ScalingGroup
    Properties:
      InstanceType: ecs.g6e.large
      ImageId: centos_7_04_64_20G_alibase_201701015.vhd
      SystemDiskCategory: cloud_essd
      SystemDiskSize: 100
      ScalingConfigurationName:
        Ref: ALIYUN::StackName
      ScalingGroupId:
        Ref: ScalingGroup
      SecurityGroupId:
        Ref: SecurityGroup
  ScalingGroup:
    Type: ALIYUN::ESS::ScalingGroup
    DependsOn: SecurityGroup
    Properties:
      MaxSize: 3
      MinSize: 0
      DefaultCooldown: 15
      VpcId:
        Ref: VpcId
      VSwitchId:
        Ref: VSwitchId
Outputs: {}

For more examples, visit ScalingGroupEnable.json and ScalingGroupEnable.yml. In the examples, the ALIYUN::ESS::ScalingConfiguration and ALIYUN::ESS::ScalingGroupEnable resource types are used.