Alibaba Cloud v3.79.0 published on Friday, May 30, 2025 by Pulumi
alicloud.pvtz.getZones
Explore with Pulumi AI
This data source provides the Private Zones of the current Alibaba Cloud user.
NOTE: Available since v1.13.0.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const config = new pulumi.Config();
const name = config.get("name") || "terraform-example.com";
const _default = new alicloud.pvtz.Zone("default", {zoneName: name});
const ids = alicloud.pvtz.getZonesOutput({
ids: [_default.id],
});
export const pvtzZonesId0 = ids.apply(ids => ids.zones?.[0]?.id);
import pulumi
import pulumi_alicloud as alicloud
config = pulumi.Config()
name = config.get("name")
if name is None:
name = "terraform-example.com"
default = alicloud.pvtz.Zone("default", zone_name=name)
ids = alicloud.pvtz.get_zones_output(ids=[default.id])
pulumi.export("pvtzZonesId0", ids.zones[0].id)
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/pvtz"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
cfg := config.New(ctx, "")
name := "terraform-example.com"
if param := cfg.Get("name"); param != "" {
name = param
}
_default, err := pvtz.NewZone(ctx, "default", &pvtz.ZoneArgs{
ZoneName: pulumi.String(name),
})
if err != nil {
return err
}
ids := pvtz.GetZonesOutput(ctx, pvtz.GetZonesOutputArgs{
Ids: pulumi.StringArray{
_default.ID(),
},
}, nil)
ctx.Export("pvtzZonesId0", ids.ApplyT(func(ids pvtz.GetZonesResult) (*string, error) {
return &ids.Zones[0].Id, nil
}).(pulumi.StringPtrOutput))
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var config = new Config();
var name = config.Get("name") ?? "terraform-example.com";
var @default = new AliCloud.Pvtz.Zone("default", new()
{
ZoneName = name,
});
var ids = AliCloud.Pvtz.GetZones.Invoke(new()
{
Ids = new[]
{
@default.Id,
},
});
return new Dictionary<string, object?>
{
["pvtzZonesId0"] = ids.Apply(getZonesResult => getZonesResult.Zones[0]?.Id),
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.pvtz.Zone;
import com.pulumi.alicloud.pvtz.ZoneArgs;
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 config = ctx.config();
final var name = config.get("name").orElse("terraform-example.com");
var default_ = new Zone("default", ZoneArgs.builder()
.zoneName(name)
.build());
final var ids = PvtzFunctions.getZones(GetZonesArgs.builder()
.ids(default_.id())
.build());
ctx.export("pvtzZonesId0", ids.applyValue(_ids -> _ids.zones()[0].id()));
}
}
configuration:
name:
type: string
default: terraform-example.com
resources:
default:
type: alicloud:pvtz:Zone
properties:
zoneName: ${name}
variables:
ids:
fn::invoke:
function: alicloud:pvtz:getZones
arguments:
ids:
- ${default.id}
outputs:
pvtzZonesId0: ${ids.zones[0].id}
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>
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]
func GetZones(ctx *Context, args *GetZonesArgs, opts ...InvokeOption) (*GetZonesResult, error)
func GetZonesOutput(ctx *Context, args *GetZonesOutputArgs, opts ...InvokeOption) GetZonesResultOutput
> 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)
}
public static CompletableFuture<GetZonesResult> getZones(GetZonesArgs args, InvokeOptions options)
public static Output<GetZonesResult> getZones(GetZonesArgs args, InvokeOptions options)
fn::invoke:
function: alicloud:pvtz/getZones:getZones
arguments:
# arguments dictionary
The following arguments are supported:
- Enable
Details bool - Whether to query the detailed list of resource attributes. Default value:
false
. - Ids List<string>
- A list of Zones IDs.
- Keyword string
- The keyword of the zone name.
- Lang string
- The language of the response. Default value:
en
. Valid values:en
,zh
. - Name
Regex string - A regex string to filter results by Zone name.
- Output
File string - File name where to save data source results (after running
pulumi preview
). - Query
Region stringId - The region ID of the virtual private cloud (VPC) associated with the zone.
- Query
Vpc stringId - The ID of the VPC associated with the zone.
- Resource
Group stringId - The ID of the resource group to which the zone belongs.
- Search
Mode string - The search mode. The value of Keyword is the search scope. Default value:
LIKE
. Valid values:LIKE
: Fuzzy search.EXACT
: Exact search.
- Enable
Details bool - Whether to query the detailed list of resource attributes. Default value:
false
. - Ids []string
- A list of Zones IDs.
- Keyword string
- The keyword of the zone name.
- Lang string
- The language of the response. Default value:
en
. Valid values:en
,zh
. - Name
Regex string - A regex string to filter results by Zone name.
- Output
File string - File name where to save data source results (after running
pulumi preview
). - Query
Region stringId - The region ID of the virtual private cloud (VPC) associated with the zone.
- Query
Vpc stringId - The ID of the VPC associated with the zone.
- Resource
Group stringId - The ID of the resource group to which the zone belongs.
- Search
Mode string - The search mode. The value of Keyword is the search scope. Default value:
LIKE
. Valid values:LIKE
: Fuzzy search.EXACT
: Exact search.
- enable
Details Boolean - Whether to query the detailed list of resource attributes. Default value:
false
. - ids List<String>
- A list of Zones IDs.
- keyword String
- The keyword of the zone name.
- lang String
- The language of the response. Default value:
en
. Valid values:en
,zh
. - name
Regex String - A regex string to filter results by Zone name.
- output
File String - File name where to save data source results (after running
pulumi preview
). - query
Region StringId - The region ID of the virtual private cloud (VPC) associated with the zone.
- query
Vpc StringId - The ID of the VPC associated with the zone.
- resource
Group StringId - The ID of the resource group to which the zone belongs.
- search
Mode String - The search mode. The value of Keyword is the search scope. Default value:
LIKE
. Valid values:LIKE
: Fuzzy search.EXACT
: Exact search.
- enable
Details boolean - Whether to query the detailed list of resource attributes. Default value:
false
. - ids string[]
- A list of Zones IDs.
- keyword string
- The keyword of the zone name.
- lang string
- The language of the response. Default value:
en
. Valid values:en
,zh
. - name
Regex string - A regex string to filter results by Zone name.
- output
File string - File name where to save data source results (after running
pulumi preview
). - query
Region stringId - The region ID of the virtual private cloud (VPC) associated with the zone.
- query
Vpc stringId - The ID of the VPC associated with the zone.
- resource
Group stringId - The ID of the resource group to which the zone belongs.
- search
Mode string - The search mode. The value of Keyword is the search scope. Default value:
LIKE
. Valid values:LIKE
: Fuzzy search.EXACT
: Exact search.
- enable_
details bool - Whether to query the detailed list of resource attributes. Default value:
false
. - ids Sequence[str]
- A list of Zones IDs.
- keyword str
- The keyword of the zone name.
- lang str
- The language of the response. Default value:
en
. Valid values:en
,zh
. - name_
regex str - A regex string to filter results by Zone name.
- output_
file str - File name where to save data source results (after running
pulumi preview
). - query_
region_ strid - The region ID of the virtual private cloud (VPC) associated with the zone.
- query_
vpc_ strid - The ID of the VPC associated with the zone.
- resource_
group_ strid - The ID of the resource group to which the zone belongs.
- search_
mode str - The search mode. The value of Keyword is the search scope. Default value:
LIKE
. Valid values:LIKE
: Fuzzy search.EXACT
: Exact search.
- enable
Details Boolean - Whether to query the detailed list of resource attributes. Default value:
false
. - ids List<String>
- A list of Zones IDs.
- keyword String
- The keyword of the zone name.
- lang String
- The language of the response. Default value:
en
. Valid values:en
,zh
. - name
Regex String - A regex string to filter results by Zone name.
- output
File String - File name where to save data source results (after running
pulumi preview
). - query
Region StringId - The region ID of the virtual private cloud (VPC) associated with the zone.
- query
Vpc StringId - The ID of the VPC associated with the zone.
- resource
Group StringId - The ID of the resource group to which the zone belongs.
- search
Mode String - The search mode. The value of Keyword is the search scope. Default value:
LIKE
. Valid values:LIKE
: Fuzzy search.EXACT
: Exact search.
getZones Result
The following output properties are available:
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids List<string>
- Names List<string>
- A list of Zone names.
- Zones
List<Pulumi.
Ali Cloud. Pvtz. Outputs. Get Zones Zone> - A list of Zone. Each element contains the following attributes:
- Enable
Details bool - Keyword string
- Lang string
- Name
Regex string - Output
File string - Query
Region stringId - Query
Vpc stringId - Resource
Group stringId - The ID of the resource group to which the zone belongs.
- Search
Mode string
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids []string
- Names []string
- A list of Zone names.
- Zones
[]Get
Zones Zone - A list of Zone. Each element contains the following attributes:
- Enable
Details bool - Keyword string
- Lang string
- Name
Regex string - Output
File string - Query
Region stringId - Query
Vpc stringId - Resource
Group stringId - The ID of the resource group to which the zone belongs.
- Search
Mode string
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- names List<String>
- A list of Zone names.
- zones
List<Get
Zones Zone> - A list of Zone. Each element contains the following attributes:
- enable
Details Boolean - keyword String
- lang String
- name
Regex String - output
File String - query
Region StringId - query
Vpc StringId - resource
Group StringId - The ID of the resource group to which the zone belongs.
- search
Mode String
- id string
- The provider-assigned unique ID for this managed resource.
- ids string[]
- names string[]
- A list of Zone names.
- zones
Get
Zones Zone[] - A list of Zone. Each element contains the following attributes:
- enable
Details boolean - keyword string
- lang string
- name
Regex string - output
File string - query
Region stringId - query
Vpc stringId - resource
Group stringId - The ID of the resource group to which the zone belongs.
- search
Mode string
- id str
- The provider-assigned unique ID for this managed resource.
- ids Sequence[str]
- names Sequence[str]
- A list of Zone names.
- zones
Sequence[Get
Zones Zone] - A list of Zone. Each element contains the following attributes:
- enable_
details bool - keyword str
- lang str
- name_
regex str - output_
file str - query_
region_ strid - query_
vpc_ strid - resource_
group_ strid - The ID of the resource group to which the zone belongs.
- search_
mode str
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- names List<String>
- A list of Zone names.
- zones List<Property Map>
- A list of Zone. Each element contains the following attributes:
- enable
Details Boolean - keyword String
- lang String
- name
Regex String - output
File String - query
Region StringId - query
Vpc StringId - resource
Group StringId - The ID of the resource group to which the zone belongs.
- search
Mode String
Supporting Types
GetZonesZone
- Bind
Vpcs List<Pulumi.Ali Cloud. Pvtz. Inputs. Get Zones Zone Bind Vpc> - The VPCs associated with the zone. Note:
bind_vpcs
takes effect only ifenable_details
is set totrue
. - Create
Timestamp int - The time when the zone was created.
- Creation
Time string - Id string
- The ID of the Private Zone.
- Is
Ptr bool - Indicates whether the zone is a reverse lookup zone.
- Name string
- The Name of the Zone.
- Proxy
Pattern string - Indicates whether the recursive resolution proxy for subdomain names is enabled.
- Record
Count int - The number of Domain Name System (DNS) records added in the zone.
- Remark string
- The description of the zone.
- Resource
Group stringId - The ID of the resource group to which the zone belongs.
- Slave
Dns bool - Indicates whether the secondary Domain Name System (DNS) feature is enabled for the zone. Note:
slave_dns
takes effect only ifenable_details
is set totrue
. - Update
Time string - Update
Timestamp int - The time when the DNS record was updated.
- Zone
Id string - The ID of the Zone.
- Zone
Name string - The Name of the Private Zone.
- Bind
Vpcs []GetZones Zone Bind Vpc - The VPCs associated with the zone. Note:
bind_vpcs
takes effect only ifenable_details
is set totrue
. - Create
Timestamp int - The time when the zone was created.
- Creation
Time string - Id string
- The ID of the Private Zone.
- Is
Ptr bool - Indicates whether the zone is a reverse lookup zone.
- Name string
- The Name of the Zone.
- Proxy
Pattern string - Indicates whether the recursive resolution proxy for subdomain names is enabled.
- Record
Count int - The number of Domain Name System (DNS) records added in the zone.
- Remark string
- The description of the zone.
- Resource
Group stringId - The ID of the resource group to which the zone belongs.
- Slave
Dns bool - Indicates whether the secondary Domain Name System (DNS) feature is enabled for the zone. Note:
slave_dns
takes effect only ifenable_details
is set totrue
. - Update
Time string - Update
Timestamp int - The time when the DNS record was updated.
- Zone
Id string - The ID of the Zone.
- Zone
Name string - The Name of the Private Zone.
- bind
Vpcs List<GetZones Zone Bind Vpc> - The VPCs associated with the zone. Note:
bind_vpcs
takes effect only ifenable_details
is set totrue
. - create
Timestamp Integer - The time when the zone was created.
- creation
Time String - id String
- The ID of the Private Zone.
- is
Ptr Boolean - Indicates whether the zone is a reverse lookup zone.
- name String
- The Name of the Zone.
- proxy
Pattern String - Indicates whether the recursive resolution proxy for subdomain names is enabled.
- record
Count Integer - The number of Domain Name System (DNS) records added in the zone.
- remark String
- The description of the zone.
- resource
Group StringId - The ID of the resource group to which the zone belongs.
- slave
Dns Boolean - Indicates whether the secondary Domain Name System (DNS) feature is enabled for the zone. Note:
slave_dns
takes effect only ifenable_details
is set totrue
. - update
Time String - update
Timestamp Integer - The time when the DNS record was updated.
- zone
Id String - The ID of the Zone.
- zone
Name String - The Name of the Private Zone.
- bind
Vpcs GetZones Zone Bind Vpc[] - The VPCs associated with the zone. Note:
bind_vpcs
takes effect only ifenable_details
is set totrue
. - create
Timestamp number - The time when the zone was created.
- creation
Time string - id string
- The ID of the Private Zone.
- is
Ptr boolean - Indicates whether the zone is a reverse lookup zone.
- name string
- The Name of the Zone.
- proxy
Pattern string - Indicates whether the recursive resolution proxy for subdomain names is enabled.
- record
Count number - The number of Domain Name System (DNS) records added in the zone.
- remark string
- The description of the zone.
- resource
Group stringId - The ID of the resource group to which the zone belongs.
- slave
Dns boolean - Indicates whether the secondary Domain Name System (DNS) feature is enabled for the zone. Note:
slave_dns
takes effect only ifenable_details
is set totrue
. - update
Time string - update
Timestamp number - The time when the DNS record was updated.
- zone
Id string - The ID of the Zone.
- zone
Name string - The Name of the Private Zone.
- bind_
vpcs Sequence[GetZones Zone Bind Vpc] - The VPCs associated with the zone. Note:
bind_vpcs
takes effect only ifenable_details
is set totrue
. - create_
timestamp int - The time when the zone was created.
- creation_
time str - id str
- The ID of the Private Zone.
- is_
ptr bool - Indicates whether the zone is a reverse lookup zone.
- name str
- The Name of the Zone.
- proxy_
pattern str - Indicates whether the recursive resolution proxy for subdomain names is enabled.
- record_
count int - The number of Domain Name System (DNS) records added in the zone.
- remark str
- The description of the zone.
- resource_
group_ strid - The ID of the resource group to which the zone belongs.
- slave_
dns bool - Indicates whether the secondary Domain Name System (DNS) feature is enabled for the zone. Note:
slave_dns
takes effect only ifenable_details
is set totrue
. - update_
time str - update_
timestamp int - The time when the DNS record was updated.
- zone_
id str - The ID of the Zone.
- zone_
name str - The Name of the Private Zone.
- bind
Vpcs List<Property Map> - The VPCs associated with the zone. Note:
bind_vpcs
takes effect only ifenable_details
is set totrue
. - create
Timestamp Number - The time when the zone was created.
- creation
Time String - id String
- The ID of the Private Zone.
- is
Ptr Boolean - Indicates whether the zone is a reverse lookup zone.
- name String
- The Name of the Zone.
- proxy
Pattern String - Indicates whether the recursive resolution proxy for subdomain names is enabled.
- record
Count Number - The number of Domain Name System (DNS) records added in the zone.
- remark String
- The description of the zone.
- resource
Group StringId - The ID of the resource group to which the zone belongs.
- slave
Dns Boolean - Indicates whether the secondary Domain Name System (DNS) feature is enabled for the zone. Note:
slave_dns
takes effect only ifenable_details
is set totrue
. - update
Time String - update
Timestamp Number - The time when the DNS record was updated.
- zone
Id String - The ID of the Zone.
- zone
Name String - The Name of the Private Zone.
GetZonesZoneBindVpc
- Region
Id string - The region ID of the VPC.
- Region
Name string - The name of the region where the VPC resides.
- Vpc
Id string - The ID of the VPC.
- Vpc
Name string - The Name of the VPC.
- Region
Id string - The region ID of the VPC.
- Region
Name string - The name of the region where the VPC resides.
- Vpc
Id string - The ID of the VPC.
- Vpc
Name string - The Name of the VPC.
- region
Id String - The region ID of the VPC.
- region
Name String - The name of the region where the VPC resides.
- vpc
Id String - The ID of the VPC.
- vpc
Name String - The Name of the VPC.
- region
Id string - The region ID of the VPC.
- region
Name string - The name of the region where the VPC resides.
- vpc
Id string - The ID of the VPC.
- vpc
Name string - The Name of the VPC.
- region_
id str - The region ID of the VPC.
- region_
name str - The name of the region where the VPC resides.
- vpc_
id str - The ID of the VPC.
- vpc_
name str - The Name of the VPC.
- region
Id String - The region ID of the VPC.
- region
Name String - The name of the region where the VPC resides.
- vpc
Id String - The ID of the VPC.
- vpc
Name String - The Name of the VPC.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloud
Terraform Provider.