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,
    "LaunchTemplateConfig": List
  }
}

Properties

Parameter Type Required Editable Description Constraint
SpotInstancePoolsToUseCount Integer Erased Released The maximum number of instances that the auto provisioning group can create for the instance type with the lowest price. This parameter takes effect when the SpotAllocationStrategy is set to lowest-price. Value: The number of instances, which is less than the number of extended launch templates specified by the LaunchTemplateConfig.
AutoProvisioningGroupName String No Released The name of the auto provisioning group. The description must be 2 to 128 characters in length. It must start with a letter in uppercase or lowercase. http:// and https:// the beginning. It can contain digits, colons (:), underscores (_), and hyphen (-).
ValidUntil String No Released 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. The time format follows the ISO8601 standard, and the UTC +0 time is used. yyy-MM-ddTHH:mm:ssZ.
Description String No Released The description of the auto provisioning group. None
PayAsYouGoAllocationStrategy String No Released Policy for creating pay-as-you-go instances Valid values:
  • lowest-price (default): Cost optimization policy Select the instance type with the lowest price.
  • prioritized Create an ECS instance with the specified priority as LaunchTemplateConfig.
MaxSpotPrice Number Not supported Supported Maximum price for preemptible instances in the auto provisioning Group If both the MaxSpotPrice parameter and the MaxPrice extended parameter are specified, the minimum value is the lowest.
LaunchTemplateId String Yes Not supported The ID of the launch template associated with the auto provisioning group. You can call DescribeLaunchTemplates queries available instance launch templates. None
DefaultTargetCapacityType String Not supported Supported Specifies the billing method of the capacity difference when the sum of the values of the PayAsYouGoTargetCapacity and SpotTargetCapacity parameters is less than the value of the TotalTargetCapacity parameter. Valid values:
  • PayAsYouGo: pay per volume instance
  • Spot (default): preemptible instance
SpotInstanceInterruptionBehavior String No Released Next action after over-preemptible instances have been stopped Valid values:
  • stop (default): The device stays in the stopped state.
  • terminate: releases the instance.
SpotTargetCapacity String Not supported Supported Target capacity of preemptible instances in the auto provisioning Group Value: The value of the parameter less than TotalTargetCapacity.
SpotAllocationStrategy String No Released The policy for creating preemptible instances. Valid values:
  • lowest-price (default): Cost optimization policy Select the instance type with the lowest price.
  • diversified: the zone distribution strategy. Create instances in the zones specified in extended configurations, and evenly distribute the instances to each zone.
PayAsYouGoTargetCapacity String Not supported Supported Target capacity of pay-as-you-go instances in the auto provisioning Group Value: The value of the parameter less than TotalTargetCapacity.
TotalTargetCapacity String Yes Yes Total capacity of the auto provisioning Group Values (positive integers): The total capacity must be greater than or equal to the sum of the PayAsYouGoTargetCapacity (the specified target capacity of pay-as-you-go instances) and SpotTargetCapacity (the specified target capacity of preemptible instances).
AutoProvisioningGroupType String No Released The delivery type of the auto provisioning group. Valid values:
  • request: one-time request The auto provisioning group delivers instance clusters only upon startup and does not retry after scheduling failure.
  • maintain (default): continuous supply When the auto provisioning group is started, it attempts to deliver a cluster and monitor its real-time capacity. The auto provisioning group does not meet the target capacity and continues to create ECS instances.
LaunchTemplateVersion String No Released The version of the launch template associated with the auto provisioning group. You can call DescribeLaunchTemplateVersions queries available instance launch template versions. None
ValidFrom String No Released 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. The time is displayed in the format specified in the ISO8601 standard, and the UTC time is used. yyyy-MM-ddTHH:mm:ssZ.
ExcessCapacityTerminationPolicy String Not supported Supported Specifies whether to terminate excess preemptible instances when the target total capacity of the specified auto provisioning group is reached. Valid values:
  • no-termination (default): continue running.
  • termination: The system terminates excess preemptible instances. The next action after termination is specified by the SpotInstanceInterruptionBehavior parameter.
TerminateInstances Boolean Erased Released Specifies whether to release the instances in the auto provisioning group when the group is deleted. Valid values:
  • true
  • false
TerminateInstancesWithExpiration Boolean Not supported Supported Specifies whether to terminate preemptible instances when the auto provisioning group expires. Valid values:
  • true: The system terminates preemptible instances. The next action after termination is specified by the SpotInstanceInterruptionBehavior parameter.
  • false (default): continue.
LaunchTemplateConfig List Erased Released Extended launch Template Valid values: up to 20

LaunchTemplateConfig syntax

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

LaunchTemplateConfig properties

Parameter Type Required Editable Description Constraint
Priority Integer Erased Released The priority of the extended configurations. A value of 0 indicates the highest priority. Value: greater than or equal to 0
WeightedCapacity Integer Erased Released The weight of the instance type in extended configurations. A higher value indicates that the instance has more computing power, and a smaller number of instances are required. Value: greater than 0. You can obtain weight values based on the computing power of a specified instance type and the minimum computing power of a single node of the cluster. For example, if the minimum computing power of a single node is 8 vCPUs and 60GiB of memory, the weight of the instance type can be set to 1. If the minimum computing power of a single node is 16 vCPUs and 120GiB of memory, the weight of the instance type can be set to 2.
VSwitchId String Yes Not supported The ID of the vSwitch to which the ECS instance is added in the extended launch template. The zone of the ECS instance started in the extension template is determined by the vSwitch. None
InstanceType String No Released Instance type specified in extended configurations None
MaxPrice Integer Yes Not supported The maximum price of preemptible instances in the extended launch template. None

Return value

Fn::GetAtt

AutoProvisioningGroupId: The ID of the auto provisioning group.

Examples

JSON format

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Resources": {
    "AutoProvisioningGroup": {
      "Type": "ALIYUN::ECS::AutoProvisioningGroup",
      "Properties": {
        "SpotInstancePoolsToUseCount": {
          "Ref": "SpotInstancePoolsToUseCount"
        },
        "AutoProvisioningGroupName": {
          "Ref": "AutoProvisioningGroupName"
        },
        "ValidUntil": {
          "Ref": "ValidUntil"
        },
        "Description": {
          "Ref": "Description"
        },
        "PayAsYouGoAllocationStrategy": {
          "Ref": "PayAsYouGoAllocationStrategy"
        },
        "MaxSpotPrice": {
          "Ref": "MaxSpotPrice"
        },
        "LaunchTemplateId": {
          "Ref": "LaunchTemplateId"
        },
        "DefaultTargetCapacityType": {
          "Ref": "DefaultTargetCapacityType"
        },
        "SpotInstanceInterruptionBehavior": {
          "Ref": "SpotInstanceInterruptionBehavior"
        },
        "SpotTargetCapacity": {
          "Ref": "SpotTargetCapacity"
        },
        "SpotAllocationStrategy": {
          "Ref": "SpotAllocationStrategy"
        },
        "PayAsYouGoTargetCapacity": {
          "Ref": "PayAsYouGoTargetCapacity"
        },
        "TotalTargetCapacity": {
          "Ref": "TotalTargetCapacity"
        },
        "AutoProvisioningGroupType": {
          "Ref": "AutoProvisioningGroupType"
        },
        "LaunchTemplateVersion": {
          "Ref": "LaunchTemplateVersion"
        },
        "ValidFrom": {
          "Ref": "ValidFrom"
        },
        "ExcessCapacityTerminationPolicy": {
          "Ref": "ExcessCapacityTerminationPolicy"
        },
        "TerminateInstances": {
          "Ref": "TerminateInstances"
        },
        "TerminateInstancesWithExpiration": {
          "Ref": "TerminateInstancesWithExpiration"
        },
        "LaunchTemplateConfig": {
          "Ref": "LaunchTemplateConfig"
        }
      }
    }
  },
  "Parameters": {
    "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."
    },
    "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 (-)."
    },
    "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."
    },
    "Description": {
      "Type": "String",
      "Description": "The description of the auto provisioning group."
    },
    "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"
      ]
    },
    "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."
    },
    "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."
    },
    "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"
      ]
    },
    "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"
      ]
    },
    "SpotTargetCapacity": {
      "Type": "String",
      "Description": "The target capacity of preemptible instances in the auto provisioning group."
    },
    "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"
      ]
    },
    "PayAsYouGoTargetCapacity": {
      "Type": "String",
      "Description": "The target capacity of pay-as-you-go instances in the auto provisioning group."
    },
    "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"
    },
    "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"
      ]
    },
    "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."
    },
    "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"
      ]
    },
    "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"
      ]
    },
    "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"
      ]
    },
    "LaunchTemplateConfig": {
      "Type": "Json",
      "Description": ""
    }
  },
  "Outputs": {
    "AutoProvisioningGroupId": {
      "Description": "The ID of the auto provisioning group.",
      "Value": {
        "Fn::GetAtt": [
          "AutoProvisioningGroup",
          "AutoProvisioningGroupId"
        ]
      }
    }
  }
}

YAML format

ROSTemplateFormatVersion: '2015-09-01'
Resources:
  AutoProvisioningGroup:
    Type: 'ALIYUN::ECS::AutoProvisioningGroup'
    Properties:
      SpotInstancePoolsToUseCount:
        Ref: SpotInstancePoolsToUseCount
      AutoProvisioningGroupName:
        Ref: AutoProvisioningGroupName
      ValidUntil:
        Ref: ValidUntil
      Description:
        Ref: Description
      PayAsYouGoAllocationStrategy:
        Ref: PayAsYouGoAllocationStrategy
      MaxSpotPrice:
        Ref: MaxSpotPrice
      LaunchTemplateId:
        Ref: LaunchTemplateId
      DefaultTargetCapacityType:
        Ref: DefaultTargetCapacityType
      SpotInstanceInterruptionBehavior:
        Ref: SpotInstanceInterruptionBehavior
      SpotTargetCapacity:
        Ref: SpotTargetCapacity
      SpotAllocationStrategy:
        Ref: SpotAllocationStrategy
      PayAsYouGoTargetCapacity:
        Ref: PayAsYouGoTargetCapacity
      TotalTargetCapacity:
        Ref: TotalTargetCapacity
      AutoProvisioningGroupType:
        Ref: AutoProvisioningGroupType
      LaunchTemplateVersion:
        Ref: LaunchTemplateVersion
      ValidFrom:
        Ref: ValidFrom
      ExcessCapacityTerminationPolicy:
        Ref: ExcessCapacityTerminationPolicy
      TerminateInstances:
        Ref: TerminateInstances
      TerminateInstancesWithExpiration:
        Ref: TerminateInstancesWithExpiration
      LaunchTemplateConfig:
        Ref: LaunchTemplateConfig
Parameters:
  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

      instances.
  AutoProvisioningGroupName:
    Type: String
    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
      (-).
  ValidUntil:
    Type: String
    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.
  Description:
    Type: String
    Description: The description of the auto provisioning group.
  PayAsYouGoAllocationStrategy:
    Type: String
    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
    AllowedValues:
      -lowest-price
      -prioritized
  MaxSpotPrice:
    Type: Number
    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.
  LaunchTemplateId:
    Type: String
    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.
  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

      the capacity requirements. Valid values:

      PayAsYouGo: Pay-as-you-go instances.

      Spot: Preemptible instances.

      Default value: Spot
    AllowedValues:
      -PayAsYouGo
      -Spot
  SpotInstanceInterruptionBehavior:
    Type: String
    Description: >-
      The default behavior after preemptible instances are shut down. Value
      values:

      stop: stops preemptible instances.

      terminate: releases preemptible instances.

      Default value: stop
    AllowedValues:
      -Stop
      -terminate
  SpotTargetCapacity:
    Type: String
    Description: >-
      The target capacity of preemptible instances in the auto provisioning
      group.
  SpotAllocationStrategy:
    Type: String
    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
    AllowedValues:
      -diversified
      -lowest-price
  PayAsYouGoTargetCapacity:
    Type: String
    Description: >-
      The target capacity of pay-as-you-go instances in the auto provisioning
      group.
  TotalTargetCapacity:
    Type: String
    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
  AutoProvisioningGroupType:
    Type: String
    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 and the group will create
      instances

      until the cluster meets the target capacity.

      Default value: maintain
    AllowedValues:
      -maintain
      -request
  LaunchTemplateVersion:
    Type: String
    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.
  ValidFrom:
    Type: String
    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.
  ExcessCapacityTerminationPolicy:
    Type: String
    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
    AllowedValues:
      -no-termination
      -termination
  TerminateInstances:
    Type: Boolean
    Description: >-
      Specifies whether to release instances of the auto provisioning group.
      Valid values:

      true

      false

      Default: false
    AllowedValues:
      - 'True'
      - 'true'
      - 'False'
      - 'false'
  TerminateInstancesWithExpiration:
    Type: Boolean
    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
    AllowedValues:
      - 'True'
      - 'true'
      - 'False'
      - 'false'
  LaunchTemplateConfig:
    Type: Json
    Description: ''
Outputs:
  AutoProvisioningGroupId:
    Description: The ID of the auto provisioning group.
    Value:
      'Fn::GetAtt':
        -AutoProvisioningGroup
        -AutoProvisioningGroupId