All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::ESS::ScalingConfiguration

Last Updated:Jun 04, 2026

ALIYUN::ESS::ScalingConfiguration creates a scaling configuration for an Auto 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,
    "SystemDiskBurstingEnabled": Boolean,
    "ImageOptionsLoginAsNonRoot": Boolean,
    "SystemDiskEncrypted": Boolean,
    "SystemDiskEncryptAlgorithm": String,
    "ZoneId": String,
    "Cpu": Integer,
    "SystemDiskProvisionedIops": Integer,
    "SystemDiskKMSKeyId": String,
    "InstancePatternInfos": List,
    "SpotInterruptionBehavior": String,
    "ImageName": String,
    "SystemDiskDescription": String,
    "SystemDiskDiskName": String,
    "InstanceTypeOverrides": List,
    "SystemDiskCategories": List,
    "Memory": Integer,
    "InstanceDescription": String,
    "SecurityGroupIds": List,
    "SpotDuration": Integer,
    "SecurityEnhancementStrategy": String,
    "Affinity": String,
    "Tenancy": String,
    "PrivatePoolOptions": Map,
    "DedicatedHostId": String
  }
}

Properties

Property

Type

Required

Editable

Description

Constraint

ResourceGroupId

String

No

Yes

The ID of the resource group to which the instances belong.

None.

DeploymentSetId

String

No

No

The ID of the deployment set.

None.

HpcClusterId

String

No

No

The ID of the E-HPC cluster to which the instances belong.

None.

ScalingGroupId

String

Yes

No

The scaling group ID.

None.

DiskMappings

List

No

Yes

The data disks to attach.

You can attach up to 16 disks.

For more information, see DiskMappings properties.

InternetChargeType

String

No

Yes

The metering method for Internet usage.

Valid values:

  • PayByBandwidth: pay-by-bandwidth

  • PayByTraffic (default): pay-by-data-transfer

InternetMaxBandwidthIn

Integer

No

No

The maximum inbound public bandwidth.

Unit: Mbit/s.

Valid values: 1 to 200.

Default: 200 Mbit/s. Inbound traffic is free of charge.

InternetMaxBandwidthOut

Integer

No

Yes

The maximum outbound public bandwidth.

  • Valid values when InternetChargeType is set to PayByBandwidth: 0 to 100. Default value: 0.

  • Valid values when InternetChargeType is set to PayByTraffic: 0 to 100. You must specify this property when InternetChargeType is set to PayByTraffic.

Unit: Mbit/s.

InstanceId

String

No

No

The ID of the instance that the system creates based on the scaling configuration.

None.

SystemDiskCategory

String

No

Yes

The system disk category.

Valid values:

  • cloud: basic disk

  • cloud_efficiency: ultra disk

  • cloud_ssd: standard SSD

  • ephemeral_ssd: local SSD

  • cloud_essd: Enterprise SSD (ESSD)

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

ImageId

String

No

Yes

The image ID. Supports public, custom, and Marketplace images.

For more information, see Public images.

InstanceType

String

No

Yes

The instance type.

For more information, see Instance family overview.

SecurityGroupId

String

No

Yes

The security group of the instances.

None.

IoOptimized

String

No

Yes

Specifies whether to create I/O-optimized instances.

Valid values:

  • none (default): does not create I/O optimized instances.

  • optimized: creates I/O optimized instances.

ScalingConfigurationName

String

No

Yes

The name of the scaling configuration.

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

Must be unique within a scaling group in a region.

Default: the scaling configuration ID.

KeyPairName

String

No

Yes

The key pair name for instance logon.

  • For Windows instances, this property is ignored and is empty by default.

  • For Linux instances, password-based logons are disabled during initialization when this property is specified.

RamRoleName

String

No

Yes

The RAM role name for the instances.

You can call the ListRoles operation of RAM to query the role name. For more information, see CreateRole and 获取角色列表.

SystemDiskSize

Integer

No

Yes

The system disk size.

Valid values: 20 to 500.

Default value: 40.

Unit: GiB.

The size must be at least the size of the custom image.

SystemDiskPerformanceLevel

String

No

Yes

The PL of the ESSD used as the system disk.

Valid values:

  • PL1 (default): An ESSD can deliver up to 50,000 random read/write IOPS.

  • PL2: An ESSD can deliver up to 100,000 random read/write IOPS.

  • PL3: An ESSD can deliver up to 1,000,000 random read/write IOPS.

For more information about how to select the PL of the ESSD, see ESSDs.

UserData

String

No

Yes

The user data for instance initialization.

Maximum size: 16 KB. No Base64 encoding required. Escape special characters with a backslash (\).

InstanceTypes

List

No

Yes

The instance types.

If you specify InstanceTypes, InstanceType is ignored.

You can specify up to 10 instance types, prioritized in the specified order. Auto Scaling tries each type in sequence until an instance is created.

PasswordInherit

Boolean

No

Yes

Specifies whether to use the preset password of the image.

The specified image must have a preset password.

TagList

List

No

Yes

The instance tags.

Up to five tags in key-value format:{"key1": "value1", "key2": "value2", ... "key5": "value5"}.

For more information, see TagList properties.

Ipv6AddressCount

Integer

No

Yes

The number of randomly assigned IPv6 addresses for the elastic network interface (ENI).

None.

LoadBalancerWeight

Integer

No

Yes

The weight of the ECS instance as a Server Load Balancer (SLB) backend server.

Valid values: 1 to 100.

Default value: 50.

CreditSpecification

String

No

Yes

The performance mode of burstable instances.

Valid values:

  • Unlimited (default)

  • Standard

For more information about performance modes, see Burstable instances.

ImageFamily

String

No

Yes

The image family name.

Queries the latest available image in the specified family. Mutually exclusive with ImageId.

SpotStrategy

String

No

Yes

The preemption policy for the pay-as-you-go instance.

Valid values:

  • NoSpot (default): The instance is created as a regular pay-as-you-go instance.

  • SpotWithPriceLimit: The instance is created as a preemptible instance that has a user-defined maximum hourly price.

  • SpotAsPriceGo: The instance is created as a preemptible instance whose bidding price is based on the market price at the time of purchase.

InstanceName

String

No

Yes

The name of the instance that the system creates based on the scaling configuration.

None.

SpotPriceLimit

Number

No

Yes

The maximum hourly price of the instance.

Supports up to three decimal places.

Takes effect when SpotStrategy is set to SpotWithPriceLimit. SpotPriceLimitForInstanceType overrides this value if both are specified.

SpotPriceLimitForInstanceType

Map

No

Yes

The instance types and bidding 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 SpotStrategy is set to SpotWithPriceLimit.

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

SystemDiskAutoSnapshotPolicyId

String

No

Yes

The automatic snapshot policy ID for the system disk.

None.

HostName

String

No

Yes

The ECS instance hostname.

The hostname cannot start or end with a period (.) or hyphen (-). It cannot contain consecutive periods (.) or consecutive hyphens (-).

The requirements on the hostname of an ECS instance vary based on the OS of the instance:

  • Windows: The hostname must be 2 to 15 characters in length, and can contain letters, digits, and hyphens (-). It cannot contain periods (.) or contain only digits.

  • Other OSs such as Linux: The hostname must be 2 to 64 characters in length, and can contain periods (.). Separate multiple segments in a hostname with periods (.). Each segment can contain letters, digits, and hyphens (-).

Password

String

No

Yes

The ECS instance password.

The password must be 8 to 30 characters in length. It must contain at least three of the following character types: uppercase letters, lowercase letters, digits, and special characters. It can contain the following special characters:

()` ~!@#$%^&*-_+=\|{}[]:;'<>,.?/

The password of a Windows instance cannot start with a forward slash (/).

Note

If you specify Password, use HTTPS to prevent exposure.

SystemDiskBurstingEnabled

Boolean

No

No

Specifies whether to enable the performance burst feature for the system disk.

Valid values:

  • true

  • false

ImageOptionsLoginAsNonRoot

Boolean

No

No

Specifies whether to use ecs-user to log on to ECS instances.

Valid values:

  • true

  • false

SystemDiskEncrypted

Boolean

No

Yes

Specifies whether to encrypt the system disk.

Valid values:

  • true

  • false

SystemDiskEncryptAlgorithm

String

No

Yes

The system disk encryption algorithm.

Valid values:

  • AES-256

  • SM4-128

ZoneId

String

No

Yes

The zone ID of the instances.

None.

Cpu

Integer

No

Yes

The number of vCPUs.

Use Cpu and Memory to specify instance type ranges. For example, set Cpu to 2 and Memory to 16 to match instance types with 2 vCPUs and 16 GiB of memory. Auto Scaling selects available types based on I/O optimization and zones, then creates instances of the lowest-priced type.

SystemDiskProvisionedIops

Integer

No

Yes

The provisioned IOPS of the system disk.

None.

SystemDiskKMSKeyId

String

No

Yes

The KMS key ID for the system disk.

None.

InstancePatternInfos

List

No

Yes

The intelligent configuration mode settings.

See InstancePatternInfos properties below.

SpotInterruptionBehavior

String

No

Yes

The interruption mode of preemptible instances.

None.

ImageName

String

No

Yes

The image name.

None.

SystemDiskDescription

String

No

Yes

The description of the system disk.

None.

SystemDiskDiskName

String

No

Yes

The system disk name.

None.

InstanceTypeOverrides

List

No

Yes

The instance type overrides.

See InstanceTypeOverrides properties below.

SystemDiskCategories

List

No

Yes

The system disk categories.

If auto-fallback is needed, the system selects lower-priority disk categories when the highest-priority one is unavailable. Valid values:

  • cloud: basic disk

  • cloud_efficiency: ultra disk

  • cloud_ssd: standard SSD

  • cloud_essd: ESSD

Memory

Integer

No

Yes

The memory size.

Unit: GiB.

Use Cpu and Memory to specify instance type ranges. For example, set Cpu to 2 and Memory to 16 to match instance types with 2 vCPUs and 16 GiB of memory. Auto Scaling selects available types based on I/O optimization and zones, then creates instances of the lowest-priced type.

InstanceDescription

String

No

Yes

The ECS instance description.

The description must be 2 to 256 characters in length. It can contain letters and cannot start with http:// or https://.

SecurityGroupIds

List

No

Yes

The security groups for the ECS instances.

Note

You cannot specify both SecurityGroupId and SecurityGroupIds.

SpotDuration

Integer

No

Yes

The protection period of preemptible instances.

Unit: hour. Valid values:

  • 1: Protected from automatic release for 1 hour after creation. After the protection period, Alibaba Cloud checks the bidding price against the market price and resource inventory to determine whether to release the instance.

  • 0: No protection period. Alibaba Cloud checks the bidding price against the market price and resource inventory immediately to determine whether to release the instance.

SecurityEnhancementStrategy

String

No

No

Specifies whether to enable security hardening.

Valid values:

  • Active: enables security hardening. This value is valid only for public images.

  • Deactive: disables security hardening. This value is valid only for all types of images.

Affinity

String

No

Yes

Specifies whether to associate the instance with a dedicated host.

Valid values:

  • default: no host affinity. If you restart a stopped instance (economical mode) and the original dedicated host has insufficient resources, the instance is deployed to another host in the automatic deployment pool.

  • host: maintains host affinity. If you restart a stopped instance (economical mode) and the original dedicated host has insufficient resources, the instance fails to start.

Tenancy

String

No

Yes

Specifies whether to create the instance on a dedicated host.

Valid values:

  • default: does not use a dedicated host.

  • host: uses a dedicated host. If DedicatedHostId is empty, Alibaba Cloud automatically selects one.

PrivatePoolOptions

Map

No

Yes

The private pool options for starting instances.

See PrivatePoolOptions properties below.

DedicatedHostId

String

No

Yes

The dedicated host ID for the ECS instances.

Preemptible instances cannot be created on dedicated hosts. If DedicatedHostId is specified, SpotStrategy and SpotPriceLimit are ignored.

You can call the DescribeDedicatedHosts operation to query dedicated host IDs.

DiskMappings syntax

"DiskMappings": [
  {
    "Category": String,
    "DiskName": String,
    "Description": String,
    "AutoSnapshotPolicyId": String,
    "PerformanceLevel": String,
    "Encrypted": String,
    "KMSKeyId": String,
    "Device": String,
    "SnapshotId": String,
    "Size": String,
    "DeleteWithInstance": Boolean,
    "ProvisionedIops": Integer,
    "Categories": List,
    "BurstingEnabled": Boolean
  }
]

DiskMappings properties

Property

Type

Required

Editable

Description

Constraint

Size

String

No

No

The data disk size.

  • Valid values when Category is set to cloud: 5 to 2000.

  • Valid values when Category is set to cloud_efficiency: 20 to 32768.

  • Valid values when Category is set to cloud_ssd: 20 to 32768.

  • Valid values when Category is set to cloud_essd: 20 to 32768.

  • Valid values when Category is set 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. The snapshot is specified by SnapshotId.

Category

String

No

No

The data disk category.

Valid values:

  • cloud: basic disk

  • cloud_efficiency (default): 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 data disk name.

The name must be 2 to 128 characters in length.

It must start with a letter and cannot start with http:// or https://.

It can contain digits, letters, colons (:), underscores (_), and hyphens (-).

PerformanceLevel

String

No

No

The PL of the ESSD used as the data disk.

Valid values:

  • PL1 (default): An ESSD can deliver up to 50,000 random read/write IOPS.

  • PL2: An ESSD can deliver up to 100,000 random read/write IOPS.

  • PL3: An ESSD can deliver up to 1,000,000 random read/write IOPS.

For more information about how to select the PL of the ESSD, see ESSDs.

Description

String

No

No

The description of the data disk.

The description must be 2 to 256 characters in length. It cannot start with http:// or https://.

Device

String

No

No

The mount target of the data disk.

If empty, the system assigns mount points alphabetically from /dev/xvdb to /dev/xvdz.

SnapshotId

String

No

No

The snapshot that you want to use to create the data disk.

If specified, Size is ignored and the disk size equals the snapshot size. Snapshots created on or before July 15, 2013 cannot be used.

Encrypted

String

No

No

Specifies whether to encrypt the data disk.

Valid values:

  • true

  • false (default)

KMSKeyId

String

No

No

The ID of the KMS key that you want to use for the data disk.

None.

AutoSnapshotPolicyId

String

No

No

The automatic snapshot policy ID for the data disk.

None.

DeleteWithInstance

Boolean

No

No

Specifies whether to release the data disk when the attached instance is released.

Valid values:

  • true

  • false

ProvisionedIops

Integer

No

No

The provisioned IOPS of the data disk.

Note

IOPS measures the number of read and write operations that can be performed per second.

Categories

List

No

No

The data disk categories.

Prioritized in the specified order. Falls back to lower-priority categories when the highest is unavailable. Valid values:

  • cloud: basic disk. The DeleteWithInstance property value of a basic disk created along with the ECS instance is true.

  • cloud_efficiency: ultra disk.

  • cloud_ssd: standard SSD.

  • cloud_essd: ESSD.

BurstingEnabled

Boolean

No

No

Specifies whether to enable the performance burst feature for the data disk.

Valid values:

  • true

  • false

PrivatePoolOptions syntax

"PrivatePoolOptions": 
  {
    "MatchCriteria": String,
    "Id": String
  }

PrivatePoolOptions properties

Property

Type

Required

Editable

Description

Constraint

MatchCriteria

String

No

Yes

The private pool type for starting instances.

Generated from an elasticity assurance or capacity reservation. Valid values:

  • Open: uses matching open private pools. Falls back to public pools if no match. PrivatePoolOptions.Id is not required.

  • Target: uses a specified private pool. Fails if no capacity is available. PrivatePoolOptions.Id is required.

  • None: does not use private pools.

Id

String

No

Yes

The ID of the private pool.

The private pool ID matches the ID of the corresponding elasticity assurance or capacity reservation.

InstanceTypeOverrides syntax

"InstanceTypeOverrides": [
  {
    "InstanceType": String,
    "WeightedCapacity": Integer
  }
]

InstanceTypeOverrides properties

Property

Type

Required

Editable

Description

Constraint

InstanceType

String

No

Yes

The instance type.

To scale by instance type weight, specify both InstanceType and WeightedCapacity.

WeightedCapacity

Integer

No

Yes

The weight of the instance type.

Assign different weights based on instance type performance (vCPUs, memory).

Sample capacity configurations:

  • Current capacity: 0

  • Expected capacity: 6

  • Capacity of ecs.c5.xlarge: 4

To meet the expected capacity, the system adds two ecs.c5.xlarge instances to the scaling group.

InstancePatternInfos syntax

"InstancePatternInfos": [
  {
    "BurstablePerformance": String,
    "Architectures": List,
    "InstanceFamilyLevel": String,
    "Memory": Number,
    "MaxPrice": Number,
    "ExcludedInstanceTypes": List,
    "Cores": Integer
  }
]

InstancePatternInfos properties

Property

Type

Required

Editable

Description

Constraint

BurstablePerformance

String

No

No

Specifies whether to include burstable instance types.

Valid values:

  • Exclude: does not include burstable instance types.

  • Include: includes burstable instance types.

  • Required: includes only burstable instance types.

Default value: Include.

Architectures

List

No

Yes

The architectures of the instance types.

Valid values:

  • X86: x86

  • Heterogeneous: heterogeneous computing, such as GPU-accelerated or FPGA-accelerated

  • BareMental: ECS Bare Metal Instance

  • Arm: Arm

By default, all values are included.

InstanceFamilyLevel

String

No

Yes

The level of the instance family.

Filters instance types when CostOptimization is enabled. Valid values:

  • EntryLevel: entry level (shared instance type). Instance types of this level are the most cost-effective, but may not provide stable computing performance. Instance types of this level are suitable for business scenarios in which CPU utilization is low. For more information, see Shared instance families.

  • EnterpriseLevel: enterprise level. Instance types of this level provide stable performance and dedicated resources, and are suitable for business scenarios that require high stability. For more information, see Instance family overview.

  • CreditEntryLevel: credit-based entry level (burstable instance types). CPU credits are used to ensure computing performance. Instance types of this level are suitable for business scenarios in which CPU utilization is usually low but suddenly increases. For more information, see Burstable instances.

Memory

Number

No

Yes

The memory size in intelligent configuration mode.

Filters instance types by memory size. Unit: GiB.

MaxPrice

Number

No

Yes

The maximum hourly price in intelligent configuration mode.

None.

ExcludedInstanceTypes

List

No

Yes

The instance types to exclude.

Supports wildcards (*) to exclude an instance type or family. Examples:

  • ecs.c6.large: excludes the ecs.c6.large instance type.

  • ecs.c6.*: excludes the c6 instance family.

Cores

Integer

No

Yes

The number of vCPUs in intelligent configuration mode.

You can use this property to filter the instance types that meet your requirements. For more information, see Instance family overview.

Take note of the following items:

  • InstancePatternInfos applies only to VPC-based scaling groups.

  • If you specify InstancePatternInfos, you must specify InstancePatternInfos.Cores and InstancePatternInfos.Memory.

  • If InstanceType or InstanceTypes is also specified, Auto Scaling uses those types first. When those types are unavailable, Auto Scaling falls back to the lowest-priced type matching InstancePatternInfos.

TagList syntax

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

TagList properties

Property

Type

Required

Editable

Description

Constraint

Key

String

Yes

No

The tag key.

The tag key must be 1 to 64 characters in length, and cannot contain http:// or https://. It cannot start with aliyun or acs:.

Value

String

No

No

The tag value.

The tag value can be up to 128 characters in length, and cannot contain http:// or https://. It cannot start with aliyun or acs:.

Return values

Fn::GetAtt

  • ScalingConfigurationId: the globally unique ID of the scaling configuration, generated by the system.

  • ScalingGroupId: the ID of the scaling group to which the scaling configuration belongs.

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 a scaling group has only one scaling configuration with dependencies, specify DependsOn in the scaling group resource to create the dependencies first.

In this example, ScalingGroup depends on SecurityGroup because SecurityGroup is a 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: {}