getZones

suspend fun getZones(argument: GetZonesPlainArgs): GetZonesResult

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)
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&#46;Apply(getZonesResult => getZonesResult&#46;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
})
}
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}

Return

A collection of values returned by getZones.

Parameters

argument

A collection of arguments for invoking getZones.


suspend fun getZones(enableDetails: Boolean? = null, ids: List<String>? = null, keyword: String? = null, lang: String? = null, nameRegex: String? = null, outputFile: String? = null, queryRegionId: String? = null, queryVpcId: String? = null, resourceGroupId: String? = null, searchMode: String? = null): GetZonesResult

Return

A collection of values returned by getZones.

Parameters

enableDetails

Whether to query the detailed list of resource attributes. Default value: false.

ids

A list of Zones IDs.

keyword

The keyword of the zone name.

lang

The language of the response. Default value: en. Valid values: en, zh.

nameRegex

A regex string to filter results by Zone name.

outputFile

File name where to save data source results (after running pulumi preview).

queryRegionId

The region ID of the virtual private cloud (VPC) associated with the zone.

queryVpcId

The ID of the VPC associated with the zone.

resourceGroupId

The ID of the resource group to which the zone belongs.

searchMode

The search mode. The value of Keyword is the search scope. Default value: LIKE. Valid values:

  • LIKE: Fuzzy search.

  • EXACT: Exact search.

See also


suspend fun getZones(argument: suspend GetZonesPlainArgsBuilder.() -> Unit): GetZonesResult

Return

A collection of values returned by getZones.

Parameters

argument

Builder for com.pulumi.alicloud.pvtz.kotlin.inputs.GetZonesPlainArgs.

See also