» alicloud_zones

This data source provides availability zones that can be accessed by an Alibaba Cloud account within the region configured in the provider.

» Example Usage

# Declare the data source
data "alicloud_zones" "zones_ds" {
  "available_instance_type" = "ecs.n4.large"
  "available_disk_category" = "cloud_ssd"

# Create an ECS instance with the first matched zone
resource "alicloud_instance" "instance" {
  availability_zone = "${data.alicloud_zones.zones_ds.zones.0.id}"

  # Other properties...

» Argument Reference

The following arguments are supported:

  • available_instance_type - (Optional) Filter the results by a specific instance type.
  • available_resource_creation - (Optional) Filter the results by a specific resource type. Valid values: Instance, Disk, VSwitch, Rds, KVStore, FunctionCompute, Elasticsearch, Slb.
  • available_disk_category - (Optional) Filter the results by a specific disk category. Can be either cloud, cloud_efficiency, cloud_ssd, ephemeral_ssd.
  • multi - (Optional, type: bool) Indicate whether the zones can be used in a multi AZ configuration. Default to false. Multi AZ is usually used to launch RDS instances.
  • instance_charge_type - (Optional) Filter the results by a specific ECS instance charge type. Valid values: PrePaid and PostPaid. Default to PostPaid.
  • network_type - (Optional) Filter the results by a specific network type. Valid values: Classic and Vpc.
  • spot_strategy - - (Optional) Filter the results by a specific ECS spot type. Valid values: NoSpot, SpotWithPriceLimit and SpotAsPriceGo. Default to NoSpot.
  • output_file - (Optional) File name where to save data source results (after running terraform plan).
  • enable_details - (Optional, Available in 1.36.0+) Default to false and only output id in the zones block. Set it to true can output more details.

» Attributes Reference

The following attributes are exported in addition to the arguments listed above: