On this page
alicloud_instance_types
The Instance Types data source list the ecs_instance_types of Alicloud.
NOTE: Default to provide upgraded instance types. If you want to get outdated instance types, you should set
is_outdated
to true.
NOTE: If one instance type is sold out, it will not be exported.
Example Usage
# Declare the data source
data "alicloud_instance_types" "1c2g" {
cpu_core_count = 1
memory_size = 2
}
# Create ecs instance with the first matched instance_type
resource "alicloud_instance" "instance" {
instance_type = "${data.alicloud_instance_types.1c2g.instance_types.0.id}"
# Other properties...
}
Argument Reference
The following arguments are supported:
availability_zone
- (Optional) The Zone that supports available instance types.cpu_core_count
- (Optional) Limit search to specific cpu core count.memory_size
- (Optional) Limit search to specific memory size.instance_type_family
- (Optional) Allows to filter list of Instance Types based on their family name, for example 'ecs.n4'.instance_charge_type
- (Optional) According to ECS instance charge type to filter all results. Valid values:PrePaid
andPostPaid
. Default toPostPaid
.network_type
- (Optional) According to network type to filter all results. Valid values:Classic
andVpc
.spot_strategy
- - (Optional) According to ECS spot type to filter all results. Valid values:NoSpot
,SpotWithPriceLimit
andSpotAsPriceGo
. Default toNoSpot
.is_outdated
- (Optional) Whether to export outdated instance types. Default to false.output_file
- (Optional) The name of file that can save instance types data source after runningterraform plan
.
Attributes Reference
A list of instance types will be exported and its every element contains the following attributes:
id
- ID of the instance type.cpu_core_count
- Number of CPU cores.memory_size
- Size of memory, measured in GB.family
- The instance type family.availability_zones
- List of availability zones which support the instance types.gpu
- The GPU attribution of an instance type:burstable_instance
- The burstable instance's attribution:initial_credit
- The initial CPU credit of a burstable instancebaseline_credit
- The compute performance benchmark CPU credit of a burstable instance
eni_amount
- The maximum number of network interface that an instance type can be attached to.local_storage
- Local storage of an instance type:
© 2018 HashiCorp
Licensed under the MPL 2.0 License.
https://www.terraform.io/docs/providers/alicloud/d/instance_types.html