alicloud_zones
The Zones data source allows access to the list of Alicloud Zones which can be accessed by an Alicloud account within the region configured in the provider.
NOTE: If one zone is sold out, it will not be exported.
Example Usage
# Declare the data source
data "alicloud_zones" "default" {
"available_instance_type"= "ecs.n4.large"
"available_disk_category"= "cloud_ssd"
}
# Create ecs instance with the first matched zone
resource "alicloud_instance" "instance" {
availability_zone = "${data.alicloud_zones.default.zones.0.id}"
# Other properties...
}
Argument Reference
The following arguments are supported:
-
available_instance_type- (Optional) Limit search to specific instance type. -
available_resource_creation- (Optional) Limit search to specific resource type. The following values are allowedInstance,Disk,VSwitchandRds. -
available_disk_category- (Optional) Limit search to specific disk category. Can be eithercloud,cloud_efficiency,cloud_ssd. -
multi- (Optional) Whether to retrieve multiple availability. Default tofalse. Multiple zone usually is used to launch RDS. -
instance_charge_type- (Optional) According to ECS instance charge type to filter all availability zones. Valid values:PrePaidandPostPaid. Default toPostPaid. -
network_type- (Optional) According to network type to filter all availability zones. Valid values:ClassicandVpc. -
spot_strategy- - (Optional) According to ECS spot type to filter all availability zones. Valid values:NoSpot,SpotWithPriceLimitandSpotAsPriceGo. Default toNoSpot. -
output_file- (Optional) The name of file that can save zones data source after runningterraform plan.
NOTE: Available disk category
cloudhas been outdated and it only can be used none I/O Optimized ECS instances. So many available zones haven't support it. Recommendcloud_efficiencyandcloud_ssd.
Attributes Reference
A list of zones will be exported and its every element contains the following attributes:
-
id- ID of the zone. -
local_name- Name of the zone in the local language. -
available_instance_types- Instance types allowed. -
available_resource_creation- Type of resource that can be created. -
available_disk_categories- Set of supported disk categories.
© 2018 HashiCorpLicensed under the MPL 2.0 License.
https://www.terraform.io/docs/providers/alicloud/d/zones.html