Alibaba Cloud

v3.15.0 published on Thursday, Jan 13, 2022 by Pulumi

getZones

This data source provides the available zones with the Application Load Balancer (ALB) Instance of the current Alibaba Cloud user.

NOTE: Available in v1.132.0+.

Example Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var example = Output.Create(AliCloud.Alb.GetZones.InvokeAsync());
        this.FirstAlbZonesId = example.Apply(example => example.Zones?[0]?.ZoneId);
    }

    [Output("firstAlbZonesId")]
    public Output<string> FirstAlbZonesId { get; set; }
}
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := alb.GetZones(ctx, nil, nil)
		if err != nil {
			return err
		}
		ctx.Export("firstAlbZonesId", example.Zones[0].ZoneId)
		return nil
	})
}
import pulumi
import pulumi_alicloud as alicloud

example = alicloud.alb.get_zones()
pulumi.export("firstAlbZonesId", example.zones[0].zone_id)
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const example = alicloud.alb.getZones({});
export const firstAlbZonesId = example.then(example => example.zones?[0]?.zoneId);

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(output_file: Optional[str] = None,
              opts: Optional[InvokeOptions] = None) -> GetZonesResult
def get_zones_output(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)
}

The following arguments are supported:

OutputFile string
OutputFile string
outputFile string

getZones Result

The following output properties are available:

Id string
The provider-assigned unique ID for this managed resource.
Ids List<string>
Zones List<Pulumi.AliCloud.Alb.Outputs.GetZonesZone>
OutputFile string
Id string
The provider-assigned unique ID for this managed resource.
Ids []string
Zones []GetZonesZone
OutputFile string
id string
The provider-assigned unique ID for this managed resource.
ids string[]
zones GetZonesZone[]
outputFile string
id str
The provider-assigned unique ID for this managed resource.
ids Sequence[str]
zones Sequence[GetZonesZone]
output_file str

Supporting Types

GetZonesZone

Id string
The ID of zone.
LocalName string
The local name.
ZoneId string
The zone ID.
Id string
The ID of zone.
LocalName string
The local name.
ZoneId string
The zone ID.
id string
The ID of zone.
localName string
The local name.
zoneId string
The zone ID.
id str
The ID of zone.
local_name str
The local name.
zone_id str
The zone ID.

Package Details

Repository
https://github.com/pulumi/pulumi-alicloud
License
Apache-2.0
Notes
This Pulumi package is based on the alicloud Terraform Provider.