ALIYUN::ECS::AutoProvisioningGroup is used to create an auto provisioning group.

Syntax

{
  "Type": "ALIYUN::ECS::AutoProvisioningGroup",
  "Properties": {
    "SpotInstancePoolsToUseCount": Integer,
    "AutoProvisioningGroupName": String,
    "ValidUntil": String,
    "Description": String,
    "PayAsYouGoAllocationStrategy": String,
    "MaxSpotPrice": Number,
    "LaunchTemplateId": String,
    "DefaultTargetCapacityType": String,
    "SpotInstanceInterruptionBehavior": String,
    "SpotTargetCapacity": String,
    "SpotAllocationStrategy": String,
    "PayAsYouGoTargetCapacity": String,
    "TotalTargetCapacity": String,
    "AutoProvisioningGroupType": String,
    "LaunchTemplateVersion": String,
    "ValidFrom": String,
    "ExcessCapacityTerminationPolicy": String,
    "TerminateInstances": Boolean,
    "TerminateInstancesWithExpiration": Boolean,
    "CheckExecutionStatus": Boolean,
    "LaunchConfiguration": Map
    "LaunchTemplateConfig": List
  }
}

Properties

Property Type Required Editable Description Constraint
SpotInstancePoolsToUseCount Integer No No The number of instances that the auto provisioning group creates by selecting the instance type of the lowest price. The value of this property must be smaller than the relevant number that you specify in the configurations of the launch template.

This property only takes effect when the SpotAllocationStrategy property is set to lowest-price.

AutoProvisioningGroupName String No No The name of the auto provisioning group. The name must be 2 to 128 characters in length, and can contain letters, digits, colons(:), underscores (_), and hyphens (-). The name must start with a letter but cannot start with http:// or https://.
ValidUntil String No No The point in time at which the auto provisioning group expires. The auto provisioning group is valid during the period of time between the point in time that is specified by the ValidFrom property and this point in time. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.
Description String No No The description of the auto provisioning group. None.
PayAsYouGoAllocationStrategy String No No The policy based on which the auto provisioning group creates pay-as-you-go instances. Default value: lowest-price. Valid values:
  • lowest-price: the cost optimization policy. The auto provisioning group selects the instance type of the lowest price to create pay-as-you-go instances.
  • prioritized: the priority-based policy. The auto provisioning group creates pay-as-you-go instances based on the priority that is specified by the LaunchTemplateConfig property.
MaxSpotPrice Number No Yes The highest price of preemptible instances in the auto provisioning group. If you specify the MaxPrice property in LaunchTemplateConfig and the MaxSpotPrice property, the smaller value between the values of both properties is used as the highest price.
LaunchTemplateId String No No The ID of the launch template that you associate with the auto provisioning group. You can call the DescribeLaunchTemplates operation to query available launch templates.

When you specify the LaunchTemplateId and LaunchConfiguration properties, the value of the LaunchTemplateId property takes precedence.

DefaultTargetCapacityType String No Yes The type of supplemental instances. When the sum of the values of PayAsYouGoTargetCapacity and SpotTargetCapacity properties is smaller than the value of the TotalTargetCapacity property, the auto provisioning group creates instances of the specified billing method to meet the capacity requirements. Default value: Spot. Valid values:
  • PayAsYouGo: pay-as-you-go instances
  • Spot: preemptible instances
SpotInstanceInterruptionBehavior String No No The next operation that the system performs after the excess preemptible instances are stopped. Default value: stop. Valid values:
  • stop: retains the excess preemptible instances in the stopped state.
  • terminate: releases the excess preemptible instances.
SpotTargetCapacity String No Yes The target capacity of preemptible instances in the auto provisioning group. This value must be smaller than the value of the TotalTargetCapacity property.
SpotAllocationStrategy String No No The policy based on which the auto provisioning group creates preemptible instances. Default value: lowest-price. Valid values:
  • lowest-price: the cost optimization policy. The auto provisioning group selects the instance type of the lowest price to create preemptible instances.
  • diversified: the balanced distribution policy. The auto provisioning group creates the instances in the zones that are specified in the launch template and evenly distributes the instances across the zones.
PayAsYouGoTargetCapacity String No Yes The target capacity of pay-as-you-go instances in the auto provisioning group. This value must be smaller than the value of the TotalTargetCapacity property.
TotalTargetCapacity String Yes Yes The total target capacity of the auto provisioning group. The value must be a positive integer. The total target capacity of the auto provisioning group must be at least the sum of the values of the PayAsYouGoTargetCapacity and SpotTargetCapacity properties.
AutoProvisioningGroupType String No No The delivery type of the auto provisioning group. Default value: maintain. Valid values:
  • request: the one-time delivery. When the auto provisioning group is started, the system delivers clusters only once. If the clusters fail to be distributed, the system does not retry the delivery.
  • maintain: the continuous delivery. When the auto provisioning group is started, the system delivers clusters until the target capacity is reached. The system also monitors the capacity in real time. If the target capacity of the auto provisioning group is not reached, the system continues creating ECS instances until the target capacity is reached.
LaunchTemplateVersion String No No The version of the launch template that is associated with the auto provisioning group. You can call the DescribeLaunchTemplateVersions operation to query available versions of the launch template.
ValidFrom String No No The point in time at which the auto provisioning group is started. The auto provisioning group is valid during the period of time between this point in time and the point in time that is specified by the ValidUntil property. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.
ExcessCapacityTerminationPolicy String No Yes Specifies whether to stop excess preemptible instances when the total target capacity of the auto provisioning group is reached. Default value: no-termination. Valid values:
  • no-termination: does not stop excess preemptible instances.
  • termination: stops excess preemptible instances. The SpotInstanceInterruptionBehavior property specifies the operation that the system performs on the stopped instances.
TerminateInstances Boolean No No Specifies whether to release the instances in the auto provisioning group when the auto provisioning group is deleted. Default value: false. Valid values:
  • true: releases the instances.
  • false: does not release the instances.
TerminateInstancesWithExpiration Boolean No Yes Specifies whether to stop preemptible instances when the auto provisioning group expires. Default value: false. Valid values:
  • true: stops preemptible instances. The SpotInstanceInterruptionBehavior property specifies the operation that the system performs on the stopped instances.
  • false: continues running preemptible instances.
CheckExecutionStatus Boolean No No Specifies whether to check the execution status. Valid values:
  • true: checks the execution status.
  • false: does not check the execution status.
LaunchConfiguration Map No No The launch configuration. When you specify the LaunchTemplateId and LaunchConfiguration properties, the value of the LaunchTemplateId property takes precedence.

For more information, see LaunchConfiguration properties.

LaunchTemplateConfig List No No The configurations of the launch template. You can specify up to 20 configurations.

For more information, see LaunchTemplateConfig properties.

LaunchTemplateConfig syntax

"LaunchTemplateConfig": [
  {
    "Priority": Integer,
    "WeightedCapacity": Integer,
    "VSwitchId": String,
    "InstanceType": String,
    "MaxPrice": Integer
  }
]

LaunchTemplateConfig properties

Property Type Required Editable Description Constraint
Priority Integer No No The priority of the instance type that is specified in the launch template. The value must be an integer that is greater than or equal to 0. The value 0 indicates the highest priority.
WeightedCapacity Integer No No The weight of the instance type that is specified in the launch template. The value must be an integer that is greater than 0. A larger value of this property indicates that a single instance has more computing power and fewer instances are required.

You can calculate the weight based on the computing power of the specified instance type and the minimum computing power of a single node in the cluster. For example, if the minimum computing power of a single node is 8 vCPUs and 60 GiB, you can set the weight of the instance type that has 8 vCPUs and 60 GiB to 1 and the weight of the instance type that has 16 vCPUs and 120 GiB to 2.

VSwitchId String Yes No The ID of the vSwitch that is specified in the launch template. The ECS instances in the launch template are connetced to the vSwitch. The zone of the ECS instances that are created from the launch template is determined by the vSwitch.
InstanceType String No No The instance type that is specified in the launch template. None.
MaxPrice Integer No No The highest price of preemptible instances that is specified in the launch template. None.

LaunchConfiguration syntax

"LaunchConfiguration": {
  "InstanceDescription": String,
  "SystemDiskName": String,
  "RamRoleName": String,
  "SystemDiskCategory": String,
  "SecurityGroupId": String,
  "CreditSpecification": String,
  "HostName": String,
  "SystemDiskDescription": String,
  "SystemDiskPerformanceLevel": String,
  "DataDisk": List,
  "InternetMaxBandwidthOut": Integer,
  "IoOptimized": String,
  "Tag": List,
  "ImageId": String,
  "ResourceGroupId": String,
  "KeyPairName": String,
  "PasswordInherit": Boolean,
  "UserData": String,
  "InstanceName": String,
  "SystemDiskSize": Integer,
  "InternetChargeType": String,
  "SecurityEnhancementStrategy": String
}

LaunchConfiguration properties

Property Type Required Editable Description Constraint
InstanceDescription String No No The description of the instance. The description must be 2 to 256 characters in length. The description cannot start with http:// or https://.
SystemDiskName String No No The name of the system disk. The name must be 2 to 128 characters in length, and can contain letters, digits, periods (.), colons (:), underscores (_), and hyphens (-). The name must start with a letter but cannot start with http:// or https://.
RamRoleName String No No The name of the RAM role for the instance. None.
SystemDiskCategory String No No The category of the system disk. Valid values:
  • cloud_efficiency: ultra disk
  • cloud_ssd: SSD
  • cloud_essd: enhanced SSD (ESSD)
  • cloud: basic disk
For non-I/O optimized instances of a retired instance type, the default value is cloud. For other types of instances, the default value is cloud_efficiency.
SecurityGroupId String Yes No The ID of the security group to which the instance belongs. None.
CreditSpecification String No No The performance mode of burstable instances. Valid values:
  • Standard: standard mode
  • Unlimited: unlimited mode
HostName String No No The hostname of the instance. The hostname cannot start or end with a period (.) or hyphen (-). The hostname cannot contain consecutive periods (.) or hyphens (-). The hostname must meet the following requirements:
  • For 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 only digits.
  • For instances that run a different OS, such as Linux, the hostname must be 2 to 64 characters in length. You can use periods (.) to separate the hostname into multiple segments. Each segment can contain letters, digits, and hyphens (-).
SystemDiskDescription String No No The description of the system disk. The description must be 2 to 256 characters in length. The description cannot start with http:// or https://.
SystemDiskPerformanceLevel String No No The performance level (PL) of the ESSD that is used as a system disk. Default value: PL0. Valid values:
  • PL0: A single ESSD can deliver up to 10,000 random read/write IOPS.
  • PL1: A single ESSD can deliver up to 50,000 random read/write IOPS.
  • PL2: A single ESSD can deliver up to 100,000 random read/write IOPS.
  • PL3: A single ESSD can deliver up to 1,000,000 random read/write IOPS.
DataDisk List No No The configurations of the data disk. You can specify up to 16 data disks.

For more information, see DataDisk properties.

InternetMaxBandwidthOut Integer No No The maximum outbound public bandwidth. Valid values: 0 to 100.

Default value: 0.

Unit: Mbit/s.

IoOptimized String No No Specifies whether the instance is an I/O optimized instance. Valid values:
  • none: a non-I/O optimized instance
  • optimized: an I/O optimized instance
Tag List No No The tags of the instance. You can specify up to 20 tags.

For more information, see Tag properties.

ImageId String Yes No The ID of the image. None.
ResourceGroupId String No No The ID of the enterprise resource group to which the instance belongs. None.
KeyPairName String No No The name of the key pair.

For Windows instances, you can leave this property empty. By default, this property is empty.

By default, password-based logon is disabled for Linux instances.

PasswordInherit Boolean No No Specifies whether to use the preset password of an image. Valid values:
  • true: uses the preset password.
  • false: does not use the preset password.
UserData String No No The user data of the instance. User data must be encoded in Base64. The maximum size of raw data is 16 KB.
InstanceName String No No The name of the instance. The default value of this property is the value of the InstanceId property.

The name must be 2 to 128 characters in length, and can contain letters, digits, colons (:), underscores (_), periods (.), and hyphens (-). The name must start with a letter but cannot start with http:// or https://.

SystemDiskSize Integer No No The size of the system disk. Valid values: 20 to 500. The size of the system disk must be greater than or equal to the size of the image.

Default value: 40 or the image size.

Unit: GiB.

InternetChargeType String No No The metering method of the network. Valid values:
  • PayByBandwidth: pay-by-bandwidth
  • PayByTraffic: pay-by-data-transfer
Note When the pay-by-data-transfer metering method is used, the maximum inbound and outbound bandwidths are used as the maximum bandwidths instead of guaranteed bandwidths. When demands outstrip resource supplies, the maximum bandwidths may be affected. If you require guaranteed bandwidths for your instance, use the pay-by-bandwidth metering method.
SecurityEnhancementStrategy String No No Specifies whether to enable security hardening. Valid values:
  • Active: enables security hardening. This value takes effect only for public images.
  • Deactive: disables security hardening. This value takes effect for all types of images.

DataDisk syntax

"DataDisk": [
  {
    "DiskName": String,
    "Size": Integer,
    "Category": String,
    "Description": String,
    "DeleteWithInstance": Boolean,
    "SnapshotId": String,
    "Encrypted": Boolean,
    "KmsKeyId": String,
    "InternetChargeType": String,
    "PerformanceLevel": String
  }
]

DataDisk properties

Property Type Required Editable Description Constraint
DiskName String No No The name of the data disk. The name must be 2 to 128 characters in length, and can contain letters, digits, periods (.), colons (:), underscores (_), and hyphens (-). The name must start with a letter but cannot start with http:// or https://.
Size Integer No No The size of the data disk. Valid values:
  • Valid values if you set the Size property to cloud_efficiency: 20 to 32768.
  • Valid values if you set the Size property to cloud_ssd: 20 to 32768.
  • Valid values if you set the Size property to cloud_essd: 20 to 32768.
  • Valid values if you set the Size property to cloud: 5 to 2000.

Unit: GiB.

Category String No No The category of the data disk. Valid values:
  • cloud_efficiency: ultra disk
  • cloud_ssd: SSD
  • cloud_essd: ESSD
  • cloud: basic disk
For I/O optimized instances, the default value is cloud_efficiency. For non-I/O optimized instances, the default value is cloud.
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://.
DeleteWithInstance Boolean No No Specifies whether to release the data disk when the instance is released. Default value: true. Valid values:
  • true: releases the data disk when the instance is released.
  • false: does not release the data disk when the instance is released.
SnapshotId String No No The ID of the snapshot that is used to create the data disk. If you specify this property, the size of the data disk that is specified by the Size property is ignored. The size of the snapshot that is specified by the SnapshotId property is used as the actual size of the data disk.
Note If you use snapshots that are created before July 15, 2013, the system reports an error and rejects your request. Therefore, we recommend that you do not use these snapshots.
Encrypted Boolean No No Specifies whether to encrypt the data disk. Default value: false. Valid values:
  • true: encrypts the data disk.
  • false: does not encrypt the data disk.
KmsKeyId String No No The ID of the Key Management Service (KMS) key that is used for the data disk. None.
InternetChargeType String No No The metering method of the network. Valid values:
  • PayByBandwidth: pay-by-bandwidth
  • PayByTraffic: pay-by-data-transfer
Note When the pay-by-data-transfer metering method is used, the maximum inbound and outbound bandwidths are used as the maximum bandwidths instead of guaranteed bandwidths. When demands outstrip resource supplies, the maximum bandwidths may be affected. If you require guaranteed bandwidths for your instance, use the pay-by-bandwidth metering method.
PerformanceLevel String No No The PL of the ESSD that is used as the data disk. Default value: PL0. Valid values:
  • PL0: A single ESSD can deliver up to 10,000 random read/write IOPS.
  • PL1: A single ESSD can deliver up to 50,000 random read/write IOPS.
  • PL2: A single ESSD can deliver up to 100,000 random read/write IOPS.
  • PL3: A single ESSD can deliver up to 1,000,000 random read/write IOPS.

Tag syntax

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

Tag properties

Property Type Required Editable Description Constraint
Key String Yes No The tag key. The tag key must be 1 to 128 characters in length, and cannot contain http:// or https://. The tag key cannot start with acs: or aliyun.
Value String No No The tag value. The tag value must be 0 to 128 characters in length, and cannot contain http:// or https://. The tag value cannot start with acs: or aliyun.

Return values

Fn::GetAtt

  • AutoProvisioningGroupId: the ID of the auto provisioning group.
  • AutoProvisioningGroupName: the name of the auto provisioning group.

Examples

JSON format

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "TotalTargetCapacity": {
      "Type": "String",
      "Description": "The total target capacity of the auto provisioning group. The target capacity consists\nof the following three parts:\nThe target capacity of pay-as-you-go instances specified by the PayAsYouGoTargetCapacity parameter\nThe target capacity of preemptible instances specified by the SpotTargetCapacity parameter\nThe supplemental capacity besides PayAsYouGoTargetCapacity and SpotTargetCapacity"
    },
    "AutoProvisioningGroupName": {
      "Type": "String",
      "Description": "The name of the auto provisioning group to be created. It must be 2 to 128 characters\nin length. It must start with a letter but cannot start with http:// or https://.\nIt can contain letters, digits, colons (:), underscores (_), and hyphens (-)."
    },
    "Description": {
      "Type": "String",
      "Description": "The description of the auto provisioning group."
    },
    "ExcessCapacityTerminationPolicy": {
      "Type": "String",
      "Description": "The shutdown policy for excess preemptible instances followed when the capacity of\nthe auto provisioning group exceeds the target capacity. Valid values:\nno-termination: Excess preemptible instances are not shut down.\ntermination: Excess preemptible instances are to be shut down. The action to be performed on these\nshutdown instances is specified by the SpotInstanceInterruptionBehavior parameter.\nDefault value: no-termination",
      "AllowedValues": [
        "no-termination",
        "termination"
      ]
    },
    "LaunchTemplateConfig": {
      "Type": "Json",
      "Description": ""
    },
    "LaunchTemplateId": {
      "Type": "String",
      "Description": "The ID of the instance launch template associated with the auto provisioning group.\nYou can call the DescribeLaunchTemplates operation to query available instance launch templates.\nAn auto provisioning group can be associated with only one instance launch template.\nBut you can configure multiple extended configurations for the launch template through\nthe LaunchTemplateConfig parameter."
    },
    "CheckExecutionStatus": {
      "Type": "Boolean",
      "Description": "Whether check execution status. If set true, ROS will check the state of AutoProvisioningGroup to be fulfilled. Otherwise ROS will regard AutoProvisioningGroup create failed.",
      "AllowedValues": [
        "True",
        "true",
        "False",
        "false"
      ]
    },
    "PayAsYouGoTargetCapacity": {
      "Type": "String",
      "Description": "The target capacity of pay-as-you-go instances in the auto provisioning group."
    },
    "AutoProvisioningGroupType": {
      "Type": "String",
      "Description": "The type of the auto provisioning group. Valid values:\nrequest: One-time delivery. After the auto provisioning group is started, it only attempts\nto create an instance cluster once. If the cluster fails to be created, the group\ndoes not try again.\nmaintain: The continuous delivery and maintain capacity type. After the auto provisioning group\nis started, it continuously attempts to create and maintain the instance cluster.\nThe auto provisioning group compares the real-time and target capacity of the cluster.\nIf the cluster does not meet the target capacity, the group will create instances\nuntil the cluster meets the target capacity.\nDefault value: maintain",
      "AllowedValues": [
        "maintain",
        "request"
      ]
    },
    "SpotInstanceInterruptionBehavior": {
      "Type": "String",
      "Description": "The default behavior after preemptible instances are shut down. Value values:\nstop: stops preemptible instances.\nterminate: releases preemptible instances.\nDefault value: stop",
      "AllowedValues": [
        "stop",
        "terminate"
      ]
    },
    "ValidUntil": {
      "Type": "String",
      "Description": "The time when the auto provisioning group expires. The period of time between this\npoint in time and the point in time specified by the ValidFrom parameter is the effective time period of the auto provisioning group.\nBy default, an auto provisioning group never expires."
    },
    "TerminateInstancesWithExpiration": {
      "Type": "Boolean",
      "Description": "The shutdown policy for preemptible instances when the auto provisioning group expires.\nValid values:\ntrue: shuts down preemptible instances. The action to be performed on these shutdown instances\nis specified by the SpotInstanceInterruptionBehavior parameter.\nfalse: does not shut down preemptible instances.\nDefault: false",
      "AllowedValues": [
        "True",
        "true",
        "False",
        "false"
      ]
    },
    "DefaultTargetCapacityType": {
      "Type": "String",
      "Description": "The type of supplemental instances. When the total value of PayAsYouGoTargetCapacity and SpotTargetCapacity is smaller than the value of TotalTargetCapacity, the auto provisioning group will create instances of the specified type to meet\nthe capacity requirements. Valid values:\nPayAsYouGo: Pay-as-you-go instances.\nSpot: Preemptible instances.\nDefault value: Spot",
      "AllowedValues": [
        "PayAsYouGo",
        "Spot"
      ]
    },
    "LaunchConfiguration": {
      "Type": "Json",
      "Description": ""
    },
    "SpotInstancePoolsToUseCount": {
      "Type": "Number",
      "Description": "This parameter takes effect when the SpotAllocationStrategy parameter is set to lowest-price. The auto provisioning group selects instance types of the lowest cost to create\ninstances."
    },
    "SpotTargetCapacity": {
      "Type": "String",
      "Description": "The target capacity of preemptible instances in the auto provisioning group."
    },
    "LaunchTemplateVersion": {
      "Type": "String",
      "Description": "The version of the instance launch template associated with the auto provisioning\ngroup. You can call the DescribeLaunchTemplateVersions operation to query the versions of available instance launch templates."
    },
    "ValidFrom": {
      "Type": "String",
      "Description": "The time when the auto provisioning group is started. The period of time between this\npoint in time and the point in time specified by the ValidUntil parameter is the effective time period of the auto provisioning group.\nBy default, an auto provisioning group is immediately started after creation."
    },
    "MaxSpotPrice": {
      "Type": "Number",
      "Description": "The global maximum price for preemptible instances in the auto provisioning group.\nIf both the MaxSpotPrice and LaunchTemplateConfig.N.MaxPrice parameters are specified, the maximum price is the lower value of the two."
    },
    "SpotAllocationStrategy": {
      "Type": "String",
      "Description": "The scale-out policy for preemptible instances. Valid values:\nlowest-price: The cost optimization policy the auto provisioning group follows to select instance\ntypes of the lowest cost to create instances.\ndiversified: The distribution balancing policy the auto provisioning group follows to evenly create\ninstances across zones specified in multiple extended template configurations.\nDefault value: lowest-price",
      "AllowedValues": [
        "diversified",
        "lowest-price"
      ]
    },
    "TerminateInstances": {
      "Type": "Boolean",
      "Description": "Specifies whether to release instances of the auto provisioning group. Valid values:\ntrue\nfalse\nDefault: false",
      "AllowedValues": [
        "True",
        "true",
        "False",
        "false"
      ]
    },
    "PayAsYouGoAllocationStrategy": {
      "Type": "String",
      "Description": "The scale-out policy for pay-as-you-go instances. Valid values:\nlowest-price: The cost optimization policy the auto provisioning group follows to select instance\ntypes of the lowest cost to create instances.\nprioritized: The priority-based policy the auto provisioning group follows to create instances.\nThe priority of an instance type is specified by the LaunchTemplateConfig.N.Priority parameter.\nDefault value: lowest-price",
      "AllowedValues": [
        "lowest-price",
        "prioritized"
      ]
    }
  },
  "Resources": {
    "AutoProvisioningGroup": {
      "Type": "ALIYUN::ECS::AutoProvisioningGroup",
      "Properties": {
        "TotalTargetCapacity": {
          "Ref": "TotalTargetCapacity"
        },
        "AutoProvisioningGroupName": {
          "Ref": "AutoProvisioningGroupName"
        },
        "Description": {
          "Ref": "Description"
        },
        "ExcessCapacityTerminationPolicy": {
          "Ref": "ExcessCapacityTerminationPolicy"
        },
        "LaunchTemplateConfig": {
          "Ref": "LaunchTemplateConfig"
        },
        "LaunchTemplateId": {
          "Ref": "LaunchTemplateId"
        },
        "CheckExecutionStatus": {
          "Ref": "CheckExecutionStatus"
        },
        "PayAsYouGoTargetCapacity": {
          "Ref": "PayAsYouGoTargetCapacity"
        },
        "AutoProvisioningGroupType": {
          "Ref": "AutoProvisioningGroupType"
        },
        "SpotInstanceInterruptionBehavior": {
          "Ref": "SpotInstanceInterruptionBehavior"
        },
        "ValidUntil": {
          "Ref": "ValidUntil"
        },
        "TerminateInstancesWithExpiration": {
          "Ref": "TerminateInstancesWithExpiration"
        },
        "DefaultTargetCapacityType": {
          "Ref": "DefaultTargetCapacityType"
        },
        "LaunchConfiguration": {
          "Ref": "LaunchConfiguration"
        },
        "SpotInstancePoolsToUseCount": {
          "Ref": "SpotInstancePoolsToUseCount"
        },
        "SpotTargetCapacity": {
          "Ref": "SpotTargetCapacity"
        },
        "LaunchTemplateVersion": {
          "Ref": "LaunchTemplateVersion"
        },
        "ValidFrom": {
          "Ref": "ValidFrom"
        },
        "MaxSpotPrice": {
          "Ref": "MaxSpotPrice"
        },
        "SpotAllocationStrategy": {
          "Ref": "SpotAllocationStrategy"
        },
        "TerminateInstances": {
          "Ref": "TerminateInstances"
        },
        "PayAsYouGoAllocationStrategy": {
          "Ref": "PayAsYouGoAllocationStrategy"
        }
      }
    }
  },
  "Outputs": {
    "AutoProvisioningGroupName": {
      "Description": "The name of the auto provisioning group.",
      "Value": {
        "Fn::GetAtt": [
          "AutoProvisioningGroup",
          "AutoProvisioningGroupName"
        ]
      }
    },
    "AutoProvisioningGroupId": {
      "Description": "The ID of the auto provisioning group.",
      "Value": {
        "Fn::GetAtt": [
          "AutoProvisioningGroup",
          "AutoProvisioningGroupId"
        ]
      }
    }
  }
}

YAML format

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  AutoProvisioningGroupName:
    Description: 'The name of the auto provisioning group to be created. It must be
      2 to 128 characters

      in length. It must start with a letter but cannot start with http:// or https://.

      It can contain letters, digits, colons (:), underscores (_), and hyphens (-).'
    Type: String
  AutoProvisioningGroupType:
    AllowedValues:
    - maintain
    - request
    Description: 'The type of the auto provisioning group. Valid values:

      request: One-time delivery. After the auto provisioning group is started, it
      only attempts

      to create an instance cluster once. If the cluster fails to be created, the
      group

      does not try again.

      maintain: The continuous delivery and maintain capacity type. After the auto
      provisioning group

      is started, it continuously attempts to create and maintain the instance cluster.

      The auto provisioning group compares the real-time and target capacity of the
      cluster.

      If the cluster does not meet the target capacity, the group will create instances

      until the cluster meets the target capacity.

      Default value: maintain'
    Type: String
  CheckExecutionStatus:
    AllowedValues:
    - 'True'
    - 'true'
    - 'False'
    - 'false'
    Description: Whether check execution status. If set true, ROS will check the state
      of AutoProvisioningGroup to be fulfilled. Otherwise ROS will regard AutoProvisioningGroup
      create failed.
    Type: Boolean
  DefaultTargetCapacityType:
    AllowedValues:
    - PayAsYouGo
    - Spot
    Description: 'The type of supplemental instances. When the total value of PayAsYouGoTargetCapacity
      and SpotTargetCapacity is smaller than the value of TotalTargetCapacity, the
      auto provisioning group will create instances of the specified type to meet

      the capacity requirements. Valid values:

      PayAsYouGo: Pay-as-you-go instances.

      Spot: Preemptible instances.

      Default value: Spot'
    Type: String
  Description:
    Description: The description of the auto provisioning group.
    Type: String
  ExcessCapacityTerminationPolicy:
    AllowedValues:
    - no-termination
    - termination
    Description: 'The shutdown policy for excess preemptible instances followed when
      the capacity of

      the auto provisioning group exceeds the target capacity. Valid values:

      no-termination: Excess preemptible instances are not shut down.

      termination: Excess preemptible instances are to be shut down. The action to
      be performed on these

      shutdown instances is specified by the SpotInstanceInterruptionBehavior parameter.

      Default value: no-termination'
    Type: String
  LaunchConfiguration:
    Description: ''
    Type: Json
  LaunchTemplateConfig:
    Description: ''
    Type: Json
  LaunchTemplateId:
    Description: 'The ID of the instance launch template associated with the auto
      provisioning group.

      You can call the DescribeLaunchTemplates operation to query available instance
      launch templates.

      An auto provisioning group can be associated with only one instance launch template.

      But you can configure multiple extended configurations for the launch template
      through

      the LaunchTemplateConfig parameter.'
    Type: String
  LaunchTemplateVersion:
    Description: 'The version of the instance launch template associated with the
      auto provisioning

      group. You can call the DescribeLaunchTemplateVersions operation to query the
      versions of available instance launch templates.'
    Type: String
  MaxSpotPrice:
    Description: 'The global maximum price for preemptible instances in the auto provisioning
      group.

      If both the MaxSpotPrice and LaunchTemplateConfig.N.MaxPrice parameters are
      specified, the maximum price is the lower value of the two.'
    Type: Number
  PayAsYouGoAllocationStrategy:
    AllowedValues:
    - lowest-price
    - prioritized
    Description: 'The scale-out policy for pay-as-you-go instances. Valid values:

      lowest-price: The cost optimization policy the auto provisioning group follows
      to select instance

      types of the lowest cost to create instances.

      prioritized: The priority-based policy the auto provisioning group follows to
      create instances.

      The priority of an instance type is specified by the LaunchTemplateConfig.N.Priority
      parameter.

      Default value: lowest-price'
    Type: String
  PayAsYouGoTargetCapacity:
    Description: The target capacity of pay-as-you-go instances in the auto provisioning
      group.
    Type: String
  SpotAllocationStrategy:
    AllowedValues:
    - diversified
    - lowest-price
    Description: 'The scale-out policy for preemptible instances. Valid values:

      lowest-price: The cost optimization policy the auto provisioning group follows
      to select instance

      types of the lowest cost to create instances.

      diversified: The distribution balancing policy the auto provisioning group follows
      to evenly create

      instances across zones specified in multiple extended template configurations.

      Default value: lowest-price'
    Type: String
  SpotInstanceInterruptionBehavior:
    AllowedValues:
    - stop
    - terminate
    Description: 'The default behavior after preemptible instances are shut down.
      Value values:

      stop: stops preemptible instances.

      terminate: releases preemptible instances.

      Default value: stop'
    Type: String
  SpotInstancePoolsToUseCount:
    Description: 'This parameter takes effect when the SpotAllocationStrategy parameter
      is set to lowest-price. The auto provisioning group selects instance types of
      the lowest cost to create

      instances.'
    Type: Number
  SpotTargetCapacity:
    Description: The target capacity of preemptible instances in the auto provisioning
      group.
    Type: String
  TerminateInstances:
    AllowedValues:
    - 'True'
    - 'true'
    - 'False'
    - 'false'
    Description: 'Specifies whether to release instances of the auto provisioning
      group. Valid values:

      true

      false

      Default: false'
    Type: Boolean
  TerminateInstancesWithExpiration:
    AllowedValues:
    - 'True'
    - 'true'
    - 'False'
    - 'false'
    Description: 'The shutdown policy for preemptible instances when the auto provisioning
      group expires.

      Valid values:

      true: shuts down preemptible instances. The action to be performed on these
      shutdown instances

      is specified by the SpotInstanceInterruptionBehavior parameter.

      false: does not shut down preemptible instances.

      Default: false'
    Type: Boolean
  TotalTargetCapacity:
    Description: 'The total target capacity of the auto provisioning group. The target
      capacity consists

      of the following three parts:

      The target capacity of pay-as-you-go instances specified by the PayAsYouGoTargetCapacity
      parameter

      The target capacity of preemptible instances specified by the SpotTargetCapacity
      parameter

      The supplemental capacity besides PayAsYouGoTargetCapacity and SpotTargetCapacity'
    Type: String
  ValidFrom:
    Description: 'The time when the auto provisioning group is started. The period
      of time between this

      point in time and the point in time specified by the ValidUntil parameter is
      the effective time period of the auto provisioning group.

      By default, an auto provisioning group is immediately started after creation.'
    Type: String
  ValidUntil:
    Description: 'The time when the auto provisioning group expires. The period of
      time between this

      point in time and the point in time specified by the ValidFrom parameter is
      the effective time period of the auto provisioning group.

      By default, an auto provisioning group never expires.'
    Type: String
Resources:
  AutoProvisioningGroup:
    Properties:
      AutoProvisioningGroupName:
        Ref: AutoProvisioningGroupName
      AutoProvisioningGroupType:
        Ref: AutoProvisioningGroupType
      CheckExecutionStatus:
        Ref: CheckExecutionStatus
      DefaultTargetCapacityType:
        Ref: DefaultTargetCapacityType
      Description:
        Ref: Description
      ExcessCapacityTerminationPolicy:
        Ref: ExcessCapacityTerminationPolicy
      LaunchConfiguration:
        Ref: LaunchConfiguration
      LaunchTemplateConfig:
        Ref: LaunchTemplateConfig
      LaunchTemplateId:
        Ref: LaunchTemplateId
      LaunchTemplateVersion:
        Ref: LaunchTemplateVersion
      MaxSpotPrice:
        Ref: MaxSpotPrice
      PayAsYouGoAllocationStrategy:
        Ref: PayAsYouGoAllocationStrategy
      PayAsYouGoTargetCapacity:
        Ref: PayAsYouGoTargetCapacity
      SpotAllocationStrategy:
        Ref: SpotAllocationStrategy
      SpotInstanceInterruptionBehavior:
        Ref: SpotInstanceInterruptionBehavior
      SpotInstancePoolsToUseCount:
        Ref: SpotInstancePoolsToUseCount
      SpotTargetCapacity:
        Ref: SpotTargetCapacity
      TerminateInstances:
        Ref: TerminateInstances
      TerminateInstancesWithExpiration:
        Ref: TerminateInstancesWithExpiration
      TotalTargetCapacity:
        Ref: TotalTargetCapacity
      ValidFrom:
        Ref: ValidFrom
      ValidUntil:
        Ref: ValidUntil
    Type: ALIYUN::ECS::AutoProvisioningGroup
Outputs:
  AutoProvisioningGroupId:
    Description: The ID of the auto provisioning group.
    Value:
      Fn::GetAtt:
      - AutoProvisioningGroup
      - AutoProvisioningGroupId
  AutoProvisioningGroupName:
    Description: The name of the auto provisioning group.
    Value:
      Fn::GetAtt:
      - AutoProvisioningGroup
      - AutoProvisioningGroupName

To view more examples, visit LaunchTemplate.json and LaunchTemplate.yml. In the examples, the ALIYUN::ECS::LaunchTemplate and ALIYUN::ECS::AutoProvisioningGroup resource types are used.