GetZones
This data source provides availability zones that can be accessed by an Alibaba Cloud account within the region configured in the provider.
NOTE: If one zone is sold out, it will not be exported.
Example Usage
using Pulumi;
using AliCloud = Pulumi.AliCloud;
class MyStack : Stack
{
public MyStack()
{
var zonesDs = Output.Create(AliCloud.GetZones.InvokeAsync(new AliCloud.GetZonesArgs
{
AvailableDiskCategory = "cloud_ssd",
AvailableInstanceType = "ecs.n4.large",
}));
// Create an ECS instance with the first matched zone
var instance = new AliCloud.Ecs.Instance("instance", new AliCloud.Ecs.InstanceArgs
{
AvailabilityZone = zonesDs.Apply(zonesDs => zonesDs.Zones[0].Id),
});
}
}
Coming soon!
import pulumi
import pulumi_alicloud as alicloud
zones_ds = alicloud.get_zones(available_disk_category="cloud_ssd",
available_instance_type="ecs.n4.large")
# Create an ECS instance with the first matched zone
instance = alicloud.ecs.Instance("instance", availability_zone=zones_ds.zones[0]["id"])import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
// Declare the data source
const zonesDs = pulumi.output(alicloud.getZones({
availableDiskCategory: "cloud_ssd",
availableInstanceType: "ecs.n4.large",
}, { async: true }));
// Create an ECS instance with the first matched zone
const instance = new alicloud.ecs.Instance("instance", {
availabilityZone: zonesDs.zones[0].id,
});Using GetZones
function getZones(args: GetZonesArgs, opts?: InvokeOptions): Promise<GetZonesResult>function get_zones(available_disk_category=None, available_instance_type=None, available_resource_creation=None, available_slb_address_ip_version=None, available_slb_address_type=None, enable_details=None, instance_charge_type=None, multi=None, network_type=None, output_file=None, spot_strategy=None, opts=None)func GetZones(ctx *Context, args *GetZonesArgs, opts ...InvokeOption) (*GetZonesResult, error)public static class GetZones {
public static Task<GetZonesResult> InvokeAsync(GetZonesArgs args, InvokeOptions? opts = null)
}The following arguments are supported:
- Available
Disk stringCategory Filter the results by a specific disk category. Can be either
cloud,cloud_efficiency,cloud_ssd,ephemeral_ssd.- Available
Instance stringType Filter the results by a specific instance type.
- Available
Resource stringCreation Filter the results by a specific resource type. Valid values:
Instance,Disk,VSwitch,Rds,KVStore,FunctionCompute,Elasticsearch,Slb.- Available
Slb stringAddress Ip Version Filter the results by a slb instance address version. Can be either
ipv4, oripv6. > NOTE: The disk categorycloudhas been outdated and can only be used by non-I/O Optimized ECS instances. Many availability zones don’t support it. It is recommended to usecloud_efficiencyorcloud_ssd.- Available
Slb stringAddress Type Filter the results by a slb instance address type. Can be either
Vpc,classic_internetorclassic_intranet- Enable
Details bool Default to false and only output
idin thezonesblock. Set it to true can output more details.- Instance
Charge stringType Filter the results by a specific ECS instance charge type. Valid values:
PrePaidandPostPaid. Default toPostPaid.- Multi 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.- Network
Type string Filter the results by a specific network type. Valid values:
ClassicandVpc.- Output
File string - Spot
Strategy string - (Optional) Filter the results by a specific ECS spot type. Valid values:
NoSpot,SpotWithPriceLimitandSpotAsPriceGo. Default toNoSpot.
- (Optional) Filter the results by a specific ECS spot type. Valid values:
- Available
Disk stringCategory Filter the results by a specific disk category. Can be either
cloud,cloud_efficiency,cloud_ssd,ephemeral_ssd.- Available
Instance stringType Filter the results by a specific instance type.
- Available
Resource stringCreation Filter the results by a specific resource type. Valid values:
Instance,Disk,VSwitch,Rds,KVStore,FunctionCompute,Elasticsearch,Slb.- Available
Slb stringAddress Ip Version Filter the results by a slb instance address version. Can be either
ipv4, oripv6. > NOTE: The disk categorycloudhas been outdated and can only be used by non-I/O Optimized ECS instances. Many availability zones don’t support it. It is recommended to usecloud_efficiencyorcloud_ssd.- Available
Slb stringAddress Type Filter the results by a slb instance address type. Can be either
Vpc,classic_internetorclassic_intranet- Enable
Details bool Default to false and only output
idin thezonesblock. Set it to true can output more details.- Instance
Charge stringType Filter the results by a specific ECS instance charge type. Valid values:
PrePaidandPostPaid. Default toPostPaid.- Multi 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.- Network
Type string Filter the results by a specific network type. Valid values:
ClassicandVpc.- Output
File string - Spot
Strategy string - (Optional) Filter the results by a specific ECS spot type. Valid values:
NoSpot,SpotWithPriceLimitandSpotAsPriceGo. Default toNoSpot.
- (Optional) Filter the results by a specific ECS spot type. Valid values:
- available
Disk stringCategory Filter the results by a specific disk category. Can be either
cloud,cloud_efficiency,cloud_ssd,ephemeral_ssd.- available
Instance stringType Filter the results by a specific instance type.
- available
Resource stringCreation Filter the results by a specific resource type. Valid values:
Instance,Disk,VSwitch,Rds,KVStore,FunctionCompute,Elasticsearch,Slb.- available
Slb stringAddress Ip Version Filter the results by a slb instance address version. Can be either
ipv4, oripv6. > NOTE: The disk categorycloudhas been outdated and can only be used by non-I/O Optimized ECS instances. Many availability zones don’t support it. It is recommended to usecloud_efficiencyorcloud_ssd.- available
Slb stringAddress Type Filter the results by a slb instance address type. Can be either
Vpc,classic_internetorclassic_intranet- enable
Details boolean Default to false and only output
idin thezonesblock. Set it to true can output more details.- instance
Charge stringType Filter the results by a specific ECS instance charge type. Valid values:
PrePaidandPostPaid. Default toPostPaid.- multi boolean
Indicate whether the zones can be used in a multi AZ configuration. Default to
false. Multi AZ is usually used to launch RDS instances.- network
Type string Filter the results by a specific network type. Valid values:
ClassicandVpc.- output
File string - spot
Strategy string - (Optional) Filter the results by a specific ECS spot type. Valid values:
NoSpot,SpotWithPriceLimitandSpotAsPriceGo. Default toNoSpot.
- (Optional) Filter the results by a specific ECS spot type. Valid values:
- available_
disk_ strcategory Filter the results by a specific disk category. Can be either
cloud,cloud_efficiency,cloud_ssd,ephemeral_ssd.- available_
instance_ strtype Filter the results by a specific instance type.
- available_
resource_ strcreation Filter the results by a specific resource type. Valid values:
Instance,Disk,VSwitch,Rds,KVStore,FunctionCompute,Elasticsearch,Slb.- available_
slb_ straddress_ ip_ version Filter the results by a slb instance address version. Can be either
ipv4, oripv6. > NOTE: The disk categorycloudhas been outdated and can only be used by non-I/O Optimized ECS instances. Many availability zones don’t support it. It is recommended to usecloud_efficiencyorcloud_ssd.- available_
slb_ straddress_ type Filter the results by a slb instance address type. Can be either
Vpc,classic_internetorclassic_intranet- enable_
details bool Default to false and only output
idin thezonesblock. Set it to true can output more details.- instance_
charge_ strtype Filter the results by a specific ECS instance charge type. Valid values:
PrePaidandPostPaid. Default toPostPaid.- multi 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.- network_
type str Filter the results by a specific network type. Valid values:
ClassicandVpc.- output_
file str - spot_
strategy str - (Optional) Filter the results by a specific ECS spot type. Valid values:
NoSpot,SpotWithPriceLimitandSpotAsPriceGo. Default toNoSpot.
- (Optional) Filter the results by a specific ECS spot type. Valid values:
GetZones Result
The following output properties are available:
- Id string
The provider-assigned unique ID for this managed resource.
- Ids List<string>
A list of zone IDs.
- Zones
List<Pulumi.
Ali Cloud. Outputs. Get Zones Zone> A list of availability zones. Each element contains the following attributes:
- Available
Disk stringCategory - Available
Instance stringType - Available
Resource stringCreation Type of resources that can be created.
- Available
Slb stringAddress Ip Version - Available
Slb stringAddress Type - Enable
Details bool - Instance
Charge stringType - Multi bool
- Network
Type string - Output
File string - Spot
Strategy string
- Id string
The provider-assigned unique ID for this managed resource.
- Ids []string
A list of zone IDs.
- Zones
[]Get
Zones Zone A list of availability zones. Each element contains the following attributes:
- Available
Disk stringCategory - Available
Instance stringType - Available
Resource stringCreation Type of resources that can be created.
- Available
Slb stringAddress Ip Version - Available
Slb stringAddress Type - Enable
Details bool - Instance
Charge stringType - Multi bool
- Network
Type string - Output
File string - Spot
Strategy string
- id string
The provider-assigned unique ID for this managed resource.
- ids string[]
A list of zone IDs.
- zones
Get
Zones Zone[] A list of availability zones. Each element contains the following attributes:
- available
Disk stringCategory - available
Instance stringType - available
Resource stringCreation Type of resources that can be created.
- available
Slb stringAddress Ip Version - available
Slb stringAddress Type - enable
Details boolean - instance
Charge stringType - multi boolean
- network
Type string - output
File string - spot
Strategy string
- id str
The provider-assigned unique ID for this managed resource.
- ids List[str]
A list of zone IDs.
- zones
List[Get
Zones Zone] A list of availability zones. Each element contains the following attributes:
- available_
disk_ strcategory - available_
instance_ strtype - available_
resource_ strcreation Type of resources that can be created.
- available_
slb_ straddress_ ip_ version - available_
slb_ straddress_ type - enable_
details bool - instance_
charge_ strtype - multi bool
- network_
type str - output_
file str - spot_
strategy str
Supporting Types
GetZonesZone
See the output API doc for this type.
See the output API doc for this type.
See the output API doc for this type.
- Available
Disk List<string>Categories Set of supported disk categories.
- Available
Instance List<string>Types Allowed instance types.
- Available
Resource List<string>Creations Filter the results by a specific resource type. Valid values:
Instance,Disk,VSwitch,Rds,KVStore,FunctionCompute,Elasticsearch,Slb.- Id string
ID of the zone.
- Local
Name string Name of the zone in the local language.
- Multi
Zone List<string>Ids A list of zone ids in which the multi zone.
- Slb
Slave List<string>Zone Ids A list of slb slave zone ids in which the slb master zone.
- Available
Disk []stringCategories Set of supported disk categories.
- Available
Instance []stringTypes Allowed instance types.
- Available
Resource []stringCreations Filter the results by a specific resource type. Valid values:
Instance,Disk,VSwitch,Rds,KVStore,FunctionCompute,Elasticsearch,Slb.- Id string
ID of the zone.
- Local
Name string Name of the zone in the local language.
- Multi
Zone []stringIds A list of zone ids in which the multi zone.
- Slb
Slave []stringZone Ids A list of slb slave zone ids in which the slb master zone.
- available
Disk string[]Categories Set of supported disk categories.
- available
Instance string[]Types Allowed instance types.
- available
Resource string[]Creations Filter the results by a specific resource type. Valid values:
Instance,Disk,VSwitch,Rds,KVStore,FunctionCompute,Elasticsearch,Slb.- id string
ID of the zone.
- local
Name string Name of the zone in the local language.
- multi
Zone string[]Ids A list of zone ids in which the multi zone.
- slb
Slave string[]Zone Ids A list of slb slave zone ids in which the slb master zone.
- available
Disk List[str]Categories Set of supported disk categories.
- available
Instance List[str]Types Allowed instance types.
- available
Resource List[str]Creations Filter the results by a specific resource type. Valid values:
Instance,Disk,VSwitch,Rds,KVStore,FunctionCompute,Elasticsearch,Slb.- id str
ID of the zone.
- local
Name str Name of the zone in the local language.
- multi
Zone List[str]Ids A list of zone ids in which the multi zone.
- slb
Slave List[str]Zone Ids A list of slb slave zone ids in which the slb master zone.
Package Details
- Repository
- https://github.com/pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloudTerraform Provider.