ucloud 1.39.1 published on Monday, Apr 14, 2025 by ucloud
ucloud.getZones
Explore with Pulumi AI
This data source provides a list of available zones in the current region.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as ucloud from "@pulumi/ucloud";
const example = ucloud.getZones({});
export const first = example.then(example => example.zones?.[0]?.id);
import pulumi
import pulumi_ucloud as ucloud
example = ucloud.get_zones()
pulumi.export("first", example.zones[0].id)
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/ucloud/ucloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := ucloud.GetZones(ctx, &ucloud.GetZonesArgs{}, nil)
if err != nil {
return err
}
ctx.Export("first", example.Zones[0].Id)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ucloud = Pulumi.Ucloud;
return await Deployment.RunAsync(() =>
{
var example = Ucloud.GetZones.Invoke();
return new Dictionary<string, object?>
{
["first"] = example.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.ucloud.UcloudFunctions;
import com.pulumi.ucloud.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 example = UcloudFunctions.getZones();
ctx.export("first", example.applyValue(getZonesResult -> getZonesResult.zones()[0].id()));
}
}
variables:
example:
fn::invoke:
function: ucloud:getZones
arguments: {}
outputs:
first: ${example.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(id: Optional[str] = None,
output_file: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetZonesResult
def get_zones_output(id: Optional[pulumi.Input[str]] = None,
output_file: 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: ucloud:index/getZones:getZones
arguments:
# arguments dictionary
The following arguments are supported:
- Id string
- The ID of availability zone.
- Output
File string - File name where to save data source results (after running
pulumi preview
).
- Id string
- The ID of availability zone.
- Output
File string - File name where to save data source results (after running
pulumi preview
).
- id String
- The ID of availability zone.
- output
File String - File name where to save data source results (after running
pulumi preview
).
- id string
- The ID of availability zone.
- output
File string - File name where to save data source results (after running
pulumi preview
).
- id str
- The ID of availability zone.
- output_
file str - File name where to save data source results (after running
pulumi preview
).
- id String
- The ID of availability zone.
- output
File String - File name where to save data source results (after running
pulumi preview
).
getZones Result
The following output properties are available:
- Id string
- The ID of availability zone.
- Total
Count double - Total number of zones that satisfy the condition.
- Zones
List<Get
Zones Zone> - It is a nested type which documented below.
- Output
File string
- Id string
- The ID of availability zone.
- Total
Count float64 - Total number of zones that satisfy the condition.
- Zones
[]Get
Zones Zone - It is a nested type which documented below.
- Output
File string
- id String
- The ID of availability zone.
- total
Count Double - Total number of zones that satisfy the condition.
- zones
List<Get
Zones Zone> - It is a nested type which documented below.
- output
File String
- id string
- The ID of availability zone.
- total
Count number - Total number of zones that satisfy the condition.
- zones
Get
Zones Zone[] - It is a nested type which documented below.
- output
File string
- id str
- The ID of availability zone.
- total_
count float - Total number of zones that satisfy the condition.
- zones
Sequence[Get
Zones Zone] - It is a nested type which documented below.
- output_
file str
- id String
- The ID of availability zone.
- total
Count Number - Total number of zones that satisfy the condition.
- zones List<Property Map>
- It is a nested type which documented below.
- output
File String
Supporting Types
GetZonesZone
- Id string
- The ID of availability zone.
- Id string
- The ID of availability zone.
- id String
- The ID of availability zone.
- id string
- The ID of availability zone.
- id str
- The ID of availability zone.
- id String
- The ID of availability zone.
Package Details
- Repository
- ucloud ucloud/terraform-provider-ucloud
- License
- Notes
- This Pulumi package is based on the
ucloud
Terraform Provider.