DATASOURCE::ECS::RecommendInstanceTypes is used to query the recommended Elastic Compute Service (ECS) instance types.

Syntax

{
  "Type": "DATASOURCE::ECS::RecommendInstanceTypes",
  "Properties": {
    "ZoneMatchMode": String,
    "IoOptimized": String,
    "ZoneId": String,
    "InstanceChargeType": String,
    "Memory": Number,
    "Scene": String,
    "SystemDiskCategory": String,
    "Cores": Integer,
    "PriorityStrategy": String,
    "InstanceFamilyLevel": String,
    "MaxPrice": Number,
    "InstanceType": String,
    "InstanceTypeFamilies": List,
    "SpotStrategy": String
  }
}

Properties

Property Type Required Editable Description Constraint
ZoneMatchMode String No Yes Specifies whether to recommend instance types that are available only in the specified zone. Valid values:
  • Strict: recommends instance types that are available only in the specified zone.
  • Include: recommends instance types that are available in other zones within the same region as the specified zone.
Note If you specify the ZoneId property, the default value of the ZoneMatchMode property is Strict.
IoOptimized String No Yes Specifies whether the instance is an I/O optimized instance. Default value: optimized. Valid values:
  • optimized: an I/O optimized instance
  • none: a non-I/O optimized instance
Note If you query retired instance types, the default value of the IoOptimized property is none.
ZoneId String No Yes The ID of the zone. You can call the DescribeZones operation to query zones.
InstanceChargeType String No Yes The billing method of the instance. Default value: PostPaid. Valid values:
  • PrePaid: subscription
  • PostPaid: pay-as-you-go
Memory Number No Yes The memory size of the instance. Unit: GiB.

If you specify the Cores and Memory properties, the system returns all instance types that match the values of both properties.

Scene String No Yes The scenario in which you want to use the instance type. Default value: CREATE. Valid values:
  • UPGRADE: You want to upgrade or downgrade instance types.
  • CREATE: You want to create instances.
SystemDiskCategory String No Yes The category of the system disk. Valid values:
  • cloud_efficiency: ultra disk
  • cloud_ssd: standard SSD
  • cloud_essd: enhanced SSD (ESSD)
  • cloud: basic disk
Note For non-I/O optimized instances, the default value of the SystemDiskCategory property is cloud. For I/O optimized instances, the default value of the SystemDiskCategory property is cloud_efficiency.
Cores Integer No Yes The number of vCPUs of the instance. If you specify the Cores and Memory properties, the system returns all instance types that match the values of both properties.
PriorityStrategy String No Yes The policy based on which the system recommends the instance type. Default value: InventoryFirst. Valid values:
  • InventoryFirst: recommends the most sufficient instance type in the inventory.
  • PriceFirst: recommends the most cost-effective instance type. Recommended instance types appear based on the hourly prices of vCPUs in ascending order.
  • NewProductFirst: recommends the latest instance type.
InstanceFamilyLevel String No Yes The level of the instance family. Valid values:
  • EntryLevel.
  • EnterpriseLevel.
  • CreditEntryLevel. For more information, see Overview.
MaxPrice Number No Yes The maximum hourly price for a pay-as-you-go instance or preemptible instance. This property takes effect when you set the SpotStrategy property to SpotWithPriceLimit.
InstanceType String No No The instance type. For more information, see Overview of instance families and DescribeInstanceTypes.
Note You cannot specify the InstanceType property and the Cores or Memory property at the same time.
InstanceTypeFamilies List No Yes The instance families. You can call the DescribeInstanceTypeFamilies operation to query instance families.
SpotStrategy String No Yes The bidding policy for the preemptible instance. Default value: NoSpot. Valid values:
  • NoSpot: The instance is created as a regular pay-as-you-go instance.
  • SpotWithPriceLimit: The instance is created as a preemptible instance for which you specify the maximum hourly price.
  • SpotAsPriceGo: The instance is created as a preemptible instance whose price is based on the market price at the time of purchase. The market price can be equal to the price of a pay-as-you-go instance.
Note This property takes effect when you set the InstanceChargeType property to Postpaid.

Return values (Fn::GetAtt)

  • InstanceTypeIds: the instance types.
  • InstanceTypes: details of the instance types.
Property Type Description Constraint
InstanceTypeIds List The instance types. None.
InstanceTypes List Details of the instance types. None.
CommodityCode String The commodity code of the instance type. None.
ZoneId String The ID of the zone in which the instance type is available. None.
Priority Integer The priority based on which the system sorts the instance types. None.
NetworkType String The network type of the instance. Valid values:
  • classic: classic network
  • vpc: virtual private cloud (VPC)
Scene String The scenario in which the instance type is used. None.
SpotStrategy String The bidding policy for the preemptible instance. None.
InstanceChargeType String The billing method of the instance. None.
InstanceType String The instance type. None.

Examples

JSON format

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "Cores": {
      "Type": "String",
      "Description": "The number of vCPUs of the instance.\nNote If the Cores and Memory parameters are both specified, all instance types that offer the vCPUs and memory size specified by the parameters are matched.",
      "Default": 1
    },
    "Memory": {
      "Type": "String",
      "Description": "The memory size of the instance. Unit: GiB.\nNote If the Cores and Memory parameters are both specified, all instance types that offer the vCPUs and memory size specified by the parameters are matched.",
      "Default": 1
    }
  },
  "Resources": {
    "RecommendInstanceTypes": {
      "Type": "DATASOURCE::ECS::RecommendInstanceTypes",
      "Properties": {
        "Cores": 1,
        "Memory": 1
      }
    }
  },
  "Outputs": {
    "RecommendInstanceTypes": {
      "Value": {
        "Ref": "RecommendInstanceTypes"
      }
    }
  }
}