1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. pvtz
  5. getZones
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

alicloud.pvtz.getZones

Explore with Pulumi AI

Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

This data source lists a number of Private Zones resource information owned by an Alibaba Cloud account.

Example Usage

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

const pvtzZonesDs = alicloud.pvtz.getZones({
    keyword: basic.zoneName,
});
export const firstZoneId = pvtzZonesDs.then(pvtzZonesDs => pvtzZonesDs.zones?.[0]?.id);
Copy
import pulumi
import pulumi_alicloud as alicloud

pvtz_zones_ds = alicloud.pvtz.get_zones(keyword=basic["zoneName"])
pulumi.export("firstZoneId", pvtz_zones_ds.zones[0].id)
Copy
package main

import (
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/pvtz"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		pvtzZonesDs, err := pvtz.GetZones(ctx, &pvtz.GetZonesArgs{
			Keyword: pulumi.StringRef(basic.ZoneName),
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("firstZoneId", pvtzZonesDs.Zones[0].Id)
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;

return await Deployment.RunAsync(() => 
{
    var pvtzZonesDs = AliCloud.Pvtz.GetZones.Invoke(new()
    {
        Keyword = basic.ZoneName,
    });

    return new Dictionary<string, object?>
    {
        ["firstZoneId"] = pvtzZonesDs.Apply(getZonesResult => getZonesResult.Zones[0]?.Id),
    };
});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.pvtz.PvtzFunctions;
import com.pulumi.alicloud.pvtz.inputs.GetZonesArgs;
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 pvtzZonesDs = PvtzFunctions.getZones(GetZonesArgs.builder()
            .keyword(basic.zoneName())
            .build());

        ctx.export("firstZoneId", pvtzZonesDs.applyValue(getZonesResult -> getZonesResult.zones()[0].id()));
    }
}
Copy
variables:
  pvtzZonesDs:
    fn::invoke:
      function: alicloud:pvtz:getZones
      arguments:
        keyword: ${basic.zoneName}
outputs:
  firstZoneId: ${pvtzZonesDs.zones[0].id}
Copy

Using getZones

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 getZones(args: GetZonesArgs, opts?: InvokeOptions): Promise<GetZonesResult>
function getZonesOutput(args: GetZonesOutputArgs, opts?: InvokeOptions): Output<GetZonesResult>
Copy
def get_zones(enable_details: Optional[bool] = None,
              ids: Optional[Sequence[str]] = None,
              keyword: Optional[str] = None,
              lang: Optional[str] = None,
              name_regex: Optional[str] = None,
              output_file: Optional[str] = None,
              query_region_id: Optional[str] = None,
              query_vpc_id: Optional[str] = None,
              resource_group_id: Optional[str] = None,
              search_mode: Optional[str] = None,
              opts: Optional[InvokeOptions] = None) -> GetZonesResult
def get_zones_output(enable_details: Optional[pulumi.Input[bool]] = None,
              ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
              keyword: Optional[pulumi.Input[str]] = None,
              lang: Optional[pulumi.Input[str]] = None,
              name_regex: Optional[pulumi.Input[str]] = None,
              output_file: Optional[pulumi.Input[str]] = None,
              query_region_id: Optional[pulumi.Input[str]] = None,
              query_vpc_id: Optional[pulumi.Input[str]] = None,
              resource_group_id: Optional[pulumi.Input[str]] = None,
              search_mode: Optional[pulumi.Input[str]] = None,
              opts: Optional[InvokeOptions] = None) -> Output[GetZonesResult]
Copy
func GetZones(ctx *Context, args *GetZonesArgs, opts ...InvokeOption) (*GetZonesResult, error)
func GetZonesOutput(ctx *Context, args *GetZonesOutputArgs, opts ...InvokeOption) GetZonesResultOutput
Copy

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

public static class GetZones 
{
    public static Task<GetZonesResult> InvokeAsync(GetZonesArgs args, InvokeOptions? opts = null)
    public static Output<GetZonesResult> Invoke(GetZonesInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetZonesResult> getZones(GetZonesArgs args, InvokeOptions options)
public static Output<GetZonesResult> getZones(GetZonesArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: alicloud:pvtz/getZones:getZones
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

EnableDetails bool
Default to false. Set it to true can output more details.
Ids Changes to this property will trigger replacement. List<string>
A list of zone IDs.
Keyword Changes to this property will trigger replacement. string
keyword for zone name.
Lang Changes to this property will trigger replacement. string
User language.
NameRegex Changes to this property will trigger replacement. string
OutputFile string
File name where to save data source results (after running pulumi preview).
QueryRegionId Changes to this property will trigger replacement. string
query_region_id for zone regionId.
QueryVpcId Changes to this property will trigger replacement. string
query_vpc_id for zone vpcId.
ResourceGroupId Changes to this property will trigger replacement. string
resource_group_id for zone resourceGroupId.
SearchMode Changes to this property will trigger replacement. string
Search mode. Value:

  • LIKE: fuzzy search.
  • EXACT: precise search. It is not filled in by default.
EnableDetails bool
Default to false. Set it to true can output more details.
Ids Changes to this property will trigger replacement. []string
A list of zone IDs.
Keyword Changes to this property will trigger replacement. string
keyword for zone name.
Lang Changes to this property will trigger replacement. string
User language.
NameRegex Changes to this property will trigger replacement. string
OutputFile string
File name where to save data source results (after running pulumi preview).
QueryRegionId Changes to this property will trigger replacement. string
query_region_id for zone regionId.
QueryVpcId Changes to this property will trigger replacement. string
query_vpc_id for zone vpcId.
ResourceGroupId Changes to this property will trigger replacement. string
resource_group_id for zone resourceGroupId.
SearchMode Changes to this property will trigger replacement. string
Search mode. Value:

  • LIKE: fuzzy search.
  • EXACT: precise search. It is not filled in by default.
enableDetails Boolean
Default to false. Set it to true can output more details.
ids Changes to this property will trigger replacement. List<String>
A list of zone IDs.
keyword Changes to this property will trigger replacement. String
keyword for zone name.
lang Changes to this property will trigger replacement. String
User language.
nameRegex Changes to this property will trigger replacement. String
outputFile String
File name where to save data source results (after running pulumi preview).
queryRegionId Changes to this property will trigger replacement. String
query_region_id for zone regionId.
queryVpcId Changes to this property will trigger replacement. String
query_vpc_id for zone vpcId.
resourceGroupId Changes to this property will trigger replacement. String
resource_group_id for zone resourceGroupId.
searchMode Changes to this property will trigger replacement. String
Search mode. Value:

  • LIKE: fuzzy search.
  • EXACT: precise search. It is not filled in by default.
enableDetails boolean
Default to false. Set it to true can output more details.
ids Changes to this property will trigger replacement. string[]
A list of zone IDs.
keyword Changes to this property will trigger replacement. string
keyword for zone name.
lang Changes to this property will trigger replacement. string
User language.
nameRegex Changes to this property will trigger replacement. string
outputFile string
File name where to save data source results (after running pulumi preview).
queryRegionId Changes to this property will trigger replacement. string
query_region_id for zone regionId.
queryVpcId Changes to this property will trigger replacement. string
query_vpc_id for zone vpcId.
resourceGroupId Changes to this property will trigger replacement. string
resource_group_id for zone resourceGroupId.
searchMode Changes to this property will trigger replacement. string
Search mode. Value:

  • LIKE: fuzzy search.
  • EXACT: precise search. It is not filled in by default.
enable_details bool
Default to false. Set it to true can output more details.
ids Changes to this property will trigger replacement. Sequence[str]
A list of zone IDs.
keyword Changes to this property will trigger replacement. str
keyword for zone name.
lang Changes to this property will trigger replacement. str
User language.
name_regex Changes to this property will trigger replacement. str
output_file str
File name where to save data source results (after running pulumi preview).
query_region_id Changes to this property will trigger replacement. str
query_region_id for zone regionId.
query_vpc_id Changes to this property will trigger replacement. str
query_vpc_id for zone vpcId.
resource_group_id Changes to this property will trigger replacement. str
resource_group_id for zone resourceGroupId.
search_mode Changes to this property will trigger replacement. str
Search mode. Value:

  • LIKE: fuzzy search.
  • EXACT: precise search. It is not filled in by default.
enableDetails Boolean
Default to false. Set it to true can output more details.
ids Changes to this property will trigger replacement. List<String>
A list of zone IDs.
keyword Changes to this property will trigger replacement. String
keyword for zone name.
lang Changes to this property will trigger replacement. String
User language.
nameRegex Changes to this property will trigger replacement. String
outputFile String
File name where to save data source results (after running pulumi preview).
queryRegionId Changes to this property will trigger replacement. String
query_region_id for zone regionId.
queryVpcId Changes to this property will trigger replacement. String
query_vpc_id for zone vpcId.
resourceGroupId Changes to this property will trigger replacement. String
resource_group_id for zone resourceGroupId.
searchMode Changes to this property will trigger replacement. String
Search mode. Value:

  • LIKE: fuzzy search.
  • EXACT: precise search. It is not filled in by default.

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.
Names List<string>
A list of zone names.
Zones List<Pulumi.AliCloud.Pvtz.Outputs.GetZonesZone>
A list of zones. Each element contains the following attributes:
EnableDetails bool
Keyword string
Lang string
NameRegex string
OutputFile string
QueryRegionId string
QueryVpcId string
ResourceGroupId string
The Id of resource group which the Private Zone belongs.
SearchMode string
Id string
The provider-assigned unique ID for this managed resource.
Ids []string
A list of zone IDs.
Names []string
A list of zone names.
Zones []GetZonesZone
A list of zones. Each element contains the following attributes:
EnableDetails bool
Keyword string
Lang string
NameRegex string
OutputFile string
QueryRegionId string
QueryVpcId string
ResourceGroupId string
The Id of resource group which the Private Zone belongs.
SearchMode string
id String
The provider-assigned unique ID for this managed resource.
ids List<String>
A list of zone IDs.
names List<String>
A list of zone names.
zones List<GetZonesZone>
A list of zones. Each element contains the following attributes:
enableDetails Boolean
keyword String
lang String
nameRegex String
outputFile String
queryRegionId String
queryVpcId String
resourceGroupId String
The Id of resource group which the Private Zone belongs.
searchMode String
id string
The provider-assigned unique ID for this managed resource.
ids string[]
A list of zone IDs.
names string[]
A list of zone names.
zones GetZonesZone[]
A list of zones. Each element contains the following attributes:
enableDetails boolean
keyword string
lang string
nameRegex string
outputFile string
queryRegionId string
queryVpcId string
resourceGroupId string
The Id of resource group which the Private Zone belongs.
searchMode string
id str
The provider-assigned unique ID for this managed resource.
ids Sequence[str]
A list of zone IDs.
names Sequence[str]
A list of zone names.
zones Sequence[GetZonesZone]
A list of zones. Each element contains the following attributes:
enable_details bool
keyword str
lang str
name_regex str
output_file str
query_region_id str
query_vpc_id str
resource_group_id str
The Id of resource group which the Private Zone belongs.
search_mode str
id String
The provider-assigned unique ID for this managed resource.
ids List<String>
A list of zone IDs.
names List<String>
A list of zone names.
zones List<Property Map>
A list of zones. Each element contains the following attributes:
enableDetails Boolean
keyword String
lang String
nameRegex String
outputFile String
queryRegionId String
queryVpcId String
resourceGroupId String
The Id of resource group which the Private Zone belongs.
searchMode String

Supporting Types

GetZonesZone

BindVpcs This property is required. List<Pulumi.AliCloud.Pvtz.Inputs.GetZonesZoneBindVpc>
List of the VPCs is bound to the Private Zone:
CreateTimestamp This property is required. int
Time of create of the Private Zone.
CreationTime This property is required. string
Id This property is required. string
ID of the Private Zone.
IsPtr This property is required. bool
Whether the Private Zone is ptr.
Name This property is required. string
Name of the Private Zone.
ProxyPattern This property is required. string
The recursive DNS proxy.
RecordCount This property is required. int
Count of the Private Zone Record.
Remark This property is required. string
Remark of the Private Zone.
ResourceGroupId This property is required. string
resource_group_id for zone resourceGroupId.
SlaveDns This property is required. bool
Whether to turn on secondary DNS.
UpdateTime This property is required. string
UpdateTimestamp This property is required. int
Time of update of the Private Zone.
ZoneId This property is required. string
ZoneId of the Private Zone.
ZoneName This property is required. string
ZoneName of the Private Zone.
BindVpcs This property is required. []GetZonesZoneBindVpc
List of the VPCs is bound to the Private Zone:
CreateTimestamp This property is required. int
Time of create of the Private Zone.
CreationTime This property is required. string
Id This property is required. string
ID of the Private Zone.
IsPtr This property is required. bool
Whether the Private Zone is ptr.
Name This property is required. string
Name of the Private Zone.
ProxyPattern This property is required. string
The recursive DNS proxy.
RecordCount This property is required. int
Count of the Private Zone Record.
Remark This property is required. string
Remark of the Private Zone.
ResourceGroupId This property is required. string
resource_group_id for zone resourceGroupId.
SlaveDns This property is required. bool
Whether to turn on secondary DNS.
UpdateTime This property is required. string
UpdateTimestamp This property is required. int
Time of update of the Private Zone.
ZoneId This property is required. string
ZoneId of the Private Zone.
ZoneName This property is required. string
ZoneName of the Private Zone.
bindVpcs This property is required. List<GetZonesZoneBindVpc>
List of the VPCs is bound to the Private Zone:
createTimestamp This property is required. Integer
Time of create of the Private Zone.
creationTime This property is required. String
id This property is required. String
ID of the Private Zone.
isPtr This property is required. Boolean
Whether the Private Zone is ptr.
name This property is required. String
Name of the Private Zone.
proxyPattern This property is required. String
The recursive DNS proxy.
recordCount This property is required. Integer
Count of the Private Zone Record.
remark This property is required. String
Remark of the Private Zone.
resourceGroupId This property is required. String
resource_group_id for zone resourceGroupId.
slaveDns This property is required. Boolean
Whether to turn on secondary DNS.
updateTime This property is required. String
updateTimestamp This property is required. Integer
Time of update of the Private Zone.
zoneId This property is required. String
ZoneId of the Private Zone.
zoneName This property is required. String
ZoneName of the Private Zone.
bindVpcs This property is required. GetZonesZoneBindVpc[]
List of the VPCs is bound to the Private Zone:
createTimestamp This property is required. number
Time of create of the Private Zone.
creationTime This property is required. string
id This property is required. string
ID of the Private Zone.
isPtr This property is required. boolean
Whether the Private Zone is ptr.
name This property is required. string
Name of the Private Zone.
proxyPattern This property is required. string
The recursive DNS proxy.
recordCount This property is required. number
Count of the Private Zone Record.
remark This property is required. string
Remark of the Private Zone.
resourceGroupId This property is required. string
resource_group_id for zone resourceGroupId.
slaveDns This property is required. boolean
Whether to turn on secondary DNS.
updateTime This property is required. string
updateTimestamp This property is required. number
Time of update of the Private Zone.
zoneId This property is required. string
ZoneId of the Private Zone.
zoneName This property is required. string
ZoneName of the Private Zone.
bind_vpcs This property is required. Sequence[GetZonesZoneBindVpc]
List of the VPCs is bound to the Private Zone:
create_timestamp This property is required. int
Time of create of the Private Zone.
creation_time This property is required. str
id This property is required. str
ID of the Private Zone.
is_ptr This property is required. bool
Whether the Private Zone is ptr.
name This property is required. str
Name of the Private Zone.
proxy_pattern This property is required. str
The recursive DNS proxy.
record_count This property is required. int
Count of the Private Zone Record.
remark This property is required. str
Remark of the Private Zone.
resource_group_id This property is required. str
resource_group_id for zone resourceGroupId.
slave_dns This property is required. bool
Whether to turn on secondary DNS.
update_time This property is required. str
update_timestamp This property is required. int
Time of update of the Private Zone.
zone_id This property is required. str
ZoneId of the Private Zone.
zone_name This property is required. str
ZoneName of the Private Zone.
bindVpcs This property is required. List<Property Map>
List of the VPCs is bound to the Private Zone:
createTimestamp This property is required. Number
Time of create of the Private Zone.
creationTime This property is required. String
id This property is required. String
ID of the Private Zone.
isPtr This property is required. Boolean
Whether the Private Zone is ptr.
name This property is required. String
Name of the Private Zone.
proxyPattern This property is required. String
The recursive DNS proxy.
recordCount This property is required. Number
Count of the Private Zone Record.
remark This property is required. String
Remark of the Private Zone.
resourceGroupId This property is required. String
resource_group_id for zone resourceGroupId.
slaveDns This property is required. Boolean
Whether to turn on secondary DNS.
updateTime This property is required. String
updateTimestamp This property is required. Number
Time of update of the Private Zone.
zoneId This property is required. String
ZoneId of the Private Zone.
zoneName This property is required. String
ZoneName of the Private Zone.

GetZonesZoneBindVpc

RegionId This property is required. string
Binding the regionId of VPC.
RegionName This property is required. string
Binding the regionName of VPC.
VpcId This property is required. string
Binding the vpcId of VPC.
VpcName This property is required. string
RegionId This property is required. string
Binding the regionId of VPC.
RegionName This property is required. string
Binding the regionName of VPC.
VpcId This property is required. string
Binding the vpcId of VPC.
VpcName This property is required. string
regionId This property is required. String
Binding the regionId of VPC.
regionName This property is required. String
Binding the regionName of VPC.
vpcId This property is required. String
Binding the vpcId of VPC.
vpcName This property is required. String
regionId This property is required. string
Binding the regionId of VPC.
regionName This property is required. string
Binding the regionName of VPC.
vpcId This property is required. string
Binding the vpcId of VPC.
vpcName This property is required. string
region_id This property is required. str
Binding the regionId of VPC.
region_name This property is required. str
Binding the regionName of VPC.
vpc_id This property is required. str
Binding the vpcId of VPC.
vpc_name This property is required. str
regionId This property is required. String
Binding the regionId of VPC.
regionName This property is required. String
Binding the regionName of VPC.
vpcId This property is required. String
Binding the vpcId of VPC.
vpcName This property is required. String

Package Details

Repository
Alibaba Cloud pulumi/pulumi-alicloud
License
Apache-2.0
Notes
This Pulumi package is based on the alicloud Terraform Provider.
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi