1. Packages
  2. Tencentcloud Provider
  3. API Docs
  4. getAvailabilityZones
tencentcloud 1.81.183 published on Wednesday, Apr 16, 2025 by tencentcloudstack

tencentcloud.getAvailabilityZones

Explore with Pulumi AI

Use this data source to get the available zones in current region. By default only AVAILABLE zones will be returned, but UNAVAILABLE zones can also be fetched when include_unavailable is specified.

NOTE: It has been deprecated and replaced by tencentcloud_availability_zones_by_product.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";

const myFavouriteZone = tencentcloud.getAvailabilityZones({
    name: "ap-guangzhou-3",
});
Copy
import pulumi
import pulumi_tencentcloud as tencentcloud

my_favourite_zone = tencentcloud.get_availability_zones(name="ap-guangzhou-3")
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := tencentcloud.GetAvailabilityZones(ctx, &tencentcloud.GetAvailabilityZonesArgs{
			Name: pulumi.StringRef("ap-guangzhou-3"),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Tencentcloud = Pulumi.Tencentcloud;

return await Deployment.RunAsync(() => 
{
    var myFavouriteZone = Tencentcloud.GetAvailabilityZones.Invoke(new()
    {
        Name = "ap-guangzhou-3",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.TencentcloudFunctions;
import com.pulumi.tencentcloud.inputs.GetAvailabilityZonesArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var myFavouriteZone = TencentcloudFunctions.getAvailabilityZones(GetAvailabilityZonesArgs.builder()
            .name("ap-guangzhou-3")
            .build());

    }
}
Copy
variables:
  myFavouriteZone:
    fn::invoke:
      function: tencentcloud:getAvailabilityZones
      arguments:
        name: ap-guangzhou-3
Copy

Using getAvailabilityZones

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getAvailabilityZones(args: GetAvailabilityZonesArgs, opts?: InvokeOptions): Promise<GetAvailabilityZonesResult>
function getAvailabilityZonesOutput(args: GetAvailabilityZonesOutputArgs, opts?: InvokeOptions): Output<GetAvailabilityZonesResult>
Copy
def get_availability_zones(id: Optional[str] = None,
                           include_unavailable: Optional[bool] = None,
                           name: Optional[str] = None,
                           result_output_file: Optional[str] = None,
                           opts: Optional[InvokeOptions] = None) -> GetAvailabilityZonesResult
def get_availability_zones_output(id: Optional[pulumi.Input[str]] = None,
                           include_unavailable: Optional[pulumi.Input[bool]] = None,
                           name: Optional[pulumi.Input[str]] = None,
                           result_output_file: Optional[pulumi.Input[str]] = None,
                           opts: Optional[InvokeOptions] = None) -> Output[GetAvailabilityZonesResult]
Copy
func GetAvailabilityZones(ctx *Context, args *GetAvailabilityZonesArgs, opts ...InvokeOption) (*GetAvailabilityZonesResult, error)
func GetAvailabilityZonesOutput(ctx *Context, args *GetAvailabilityZonesOutputArgs, opts ...InvokeOption) GetAvailabilityZonesResultOutput
Copy

> Note: This function is named GetAvailabilityZones in the Go SDK.

public static class GetAvailabilityZones 
{
    public static Task<GetAvailabilityZonesResult> InvokeAsync(GetAvailabilityZonesArgs args, InvokeOptions? opts = null)
    public static Output<GetAvailabilityZonesResult> Invoke(GetAvailabilityZonesInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetAvailabilityZonesResult> getAvailabilityZones(GetAvailabilityZonesArgs args, InvokeOptions options)
public static Output<GetAvailabilityZonesResult> getAvailabilityZones(GetAvailabilityZonesArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: tencentcloud:index/getAvailabilityZones:getAvailabilityZones
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Id string
An internal id for the zone, like 200003, usually not so useful.
IncludeUnavailable bool
A bool variable indicates that the query will include UNAVAILABLE zones.
Name string
When specified, only the zone with the exactly name match will be returned.
ResultOutputFile string
Used to save results.
Id string
An internal id for the zone, like 200003, usually not so useful.
IncludeUnavailable bool
A bool variable indicates that the query will include UNAVAILABLE zones.
Name string
When specified, only the zone with the exactly name match will be returned.
ResultOutputFile string
Used to save results.
id String
An internal id for the zone, like 200003, usually not so useful.
includeUnavailable Boolean
A bool variable indicates that the query will include UNAVAILABLE zones.
name String
When specified, only the zone with the exactly name match will be returned.
resultOutputFile String
Used to save results.
id string
An internal id for the zone, like 200003, usually not so useful.
includeUnavailable boolean
A bool variable indicates that the query will include UNAVAILABLE zones.
name string
When specified, only the zone with the exactly name match will be returned.
resultOutputFile string
Used to save results.
id str
An internal id for the zone, like 200003, usually not so useful.
include_unavailable bool
A bool variable indicates that the query will include UNAVAILABLE zones.
name str
When specified, only the zone with the exactly name match will be returned.
result_output_file str
Used to save results.
id String
An internal id for the zone, like 200003, usually not so useful.
includeUnavailable Boolean
A bool variable indicates that the query will include UNAVAILABLE zones.
name String
When specified, only the zone with the exactly name match will be returned.
resultOutputFile String
Used to save results.

getAvailabilityZones Result

The following output properties are available:

Id string
An internal id for the zone, like 200003, usually not so useful.
Zones List<GetAvailabilityZonesZone>
A list of zones will be exported and its every element contains the following attributes:
IncludeUnavailable bool
Name string
The name of the zone, like ap-guangzhou-3.
ResultOutputFile string
Id string
An internal id for the zone, like 200003, usually not so useful.
Zones []GetAvailabilityZonesZone
A list of zones will be exported and its every element contains the following attributes:
IncludeUnavailable bool
Name string
The name of the zone, like ap-guangzhou-3.
ResultOutputFile string
id String
An internal id for the zone, like 200003, usually not so useful.
zones List<GetAvailabilityZonesZone>
A list of zones will be exported and its every element contains the following attributes:
includeUnavailable Boolean
name String
The name of the zone, like ap-guangzhou-3.
resultOutputFile String
id string
An internal id for the zone, like 200003, usually not so useful.
zones GetAvailabilityZonesZone[]
A list of zones will be exported and its every element contains the following attributes:
includeUnavailable boolean
name string
The name of the zone, like ap-guangzhou-3.
resultOutputFile string
id str
An internal id for the zone, like 200003, usually not so useful.
zones Sequence[GetAvailabilityZonesZone]
A list of zones will be exported and its every element contains the following attributes:
include_unavailable bool
name str
The name of the zone, like ap-guangzhou-3.
result_output_file str
id String
An internal id for the zone, like 200003, usually not so useful.
zones List<Property Map>
A list of zones will be exported and its every element contains the following attributes:
includeUnavailable Boolean
name String
The name of the zone, like ap-guangzhou-3.
resultOutputFile String

Supporting Types

GetAvailabilityZonesZone

Description This property is required. string
The description of the zone, like Guangzhou Zone 3.
Id This property is required. string
An internal id for the zone, like 200003, usually not so useful.
Name This property is required. string
When specified, only the zone with the exactly name match will be returned.
State This property is required. string
The state of the zone, indicate availability using AVAILABLE and UNAVAILABLE values.
Description This property is required. string
The description of the zone, like Guangzhou Zone 3.
Id This property is required. string
An internal id for the zone, like 200003, usually not so useful.
Name This property is required. string
When specified, only the zone with the exactly name match will be returned.
State This property is required. string
The state of the zone, indicate availability using AVAILABLE and UNAVAILABLE values.
description This property is required. String
The description of the zone, like Guangzhou Zone 3.
id This property is required. String
An internal id for the zone, like 200003, usually not so useful.
name This property is required. String
When specified, only the zone with the exactly name match will be returned.
state This property is required. String
The state of the zone, indicate availability using AVAILABLE and UNAVAILABLE values.
description This property is required. string
The description of the zone, like Guangzhou Zone 3.
id This property is required. string
An internal id for the zone, like 200003, usually not so useful.
name This property is required. string
When specified, only the zone with the exactly name match will be returned.
state This property is required. string
The state of the zone, indicate availability using AVAILABLE and UNAVAILABLE values.
description This property is required. str
The description of the zone, like Guangzhou Zone 3.
id This property is required. str
An internal id for the zone, like 200003, usually not so useful.
name This property is required. str
When specified, only the zone with the exactly name match will be returned.
state This property is required. str
The state of the zone, indicate availability using AVAILABLE and UNAVAILABLE values.
description This property is required. String
The description of the zone, like Guangzhou Zone 3.
id This property is required. String
An internal id for the zone, like 200003, usually not so useful.
name This property is required. String
When specified, only the zone with the exactly name match will be returned.
state This property is required. String
The state of the zone, indicate availability using AVAILABLE and UNAVAILABLE values.

Package Details

Repository
tencentcloud tencentcloudstack/terraform-provider-tencentcloud
License
Notes
This Pulumi package is based on the tencentcloud Terraform Provider.