1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. gwlb
  5. getZones
Alibaba Cloud v3.75.0 published on Friday, Mar 7, 2025 by Pulumi

alicloud.gwlb.getZones

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.75.0 published on Friday, Mar 7, 2025 by Pulumi

    This data source provides Gwlb Zone available to the user.What is Zone

    NOTE: Available since v1.236.0.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const _default = alicloud.gwlb.getZones({});
    export const alicloudGwlbZoneExampleId = _default.then(_default => _default.zones?.[0]?.id);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    default = alicloud.gwlb.get_zones()
    pulumi.export("alicloudGwlbZoneExampleId", default.zones[0].id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/gwlb"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_default, err := gwlb.GetZones(ctx, &gwlb.GetZonesArgs{}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("alicloudGwlbZoneExampleId", _default.Zones[0].Id)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var @default = AliCloud.Gwlb.GetZones.Invoke();
    
        return new Dictionary<string, object?>
        {
            ["alicloudGwlbZoneExampleId"] = @default.Apply(@default => @default.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.gwlb.GwlbFunctions;
    import com.pulumi.alicloud.gwlb.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 default = GwlbFunctions.getZones();
    
            ctx.export("alicloudGwlbZoneExampleId", default_.zones()[0].id());
        }
    }
    
    variables:
      default:
        fn::invoke:
          function: alicloud:gwlb:getZones
          arguments: {}
    outputs:
      alicloudGwlbZoneExampleId: ${default.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(accept_language: Optional[str] = None,
                  ids: Optional[Sequence[str]] = None,
                  output_file: Optional[str] = None,
                  opts: Optional[InvokeOptions] = None) -> GetZonesResult
    def get_zones_output(accept_language: Optional[pulumi.Input[str]] = None,
                  ids: Optional[pulumi.Input[Sequence[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: alicloud:gwlb/getZones:getZones
      arguments:
        # arguments dictionary

    The following arguments are supported:

    AcceptLanguage string
    The supported language. Valid values:

    • zh-CN: Chinese
    • en-US (default): English
    • ja: Japanese
    Ids List<string>
    A list of Zone IDs.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    AcceptLanguage string
    The supported language. Valid values:

    • zh-CN: Chinese
    • en-US (default): English
    • ja: Japanese
    Ids []string
    A list of Zone IDs.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    acceptLanguage String
    The supported language. Valid values:

    • zh-CN: Chinese
    • en-US (default): English
    • ja: Japanese
    ids List<String>
    A list of Zone IDs.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    acceptLanguage string
    The supported language. Valid values:

    • zh-CN: Chinese
    • en-US (default): English
    • ja: Japanese
    ids string[]
    A list of Zone IDs.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    accept_language str
    The supported language. Valid values:

    • zh-CN: Chinese
    • en-US (default): English
    • ja: Japanese
    ids Sequence[str]
    A list of Zone IDs.
    output_file str
    File name where to save data source results (after running pulumi preview).
    acceptLanguage String
    The supported language. Valid values:

    • zh-CN: Chinese
    • en-US (default): English
    • ja: Japanese
    ids List<String>
    A list of Zone IDs.
    outputFile String
    File name where to save data source results (after running pulumi preview).

    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.
    Zones List<Pulumi.AliCloud.Gwlb.Outputs.GetZonesZone>
    A list of Zone Entries. Each element contains the following attributes:
    AcceptLanguage string
    OutputFile string
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    A list of Zone IDs.
    Zones []GetZonesZone
    A list of Zone Entries. Each element contains the following attributes:
    AcceptLanguage string
    OutputFile string
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    A list of Zone IDs.
    zones List<GetZonesZone>
    A list of Zone Entries. Each element contains the following attributes:
    acceptLanguage String
    outputFile String
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    A list of Zone IDs.
    zones GetZonesZone[]
    A list of Zone Entries. Each element contains the following attributes:
    acceptLanguage string
    outputFile string
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    A list of Zone IDs.
    zones Sequence[GetZonesZone]
    A list of Zone Entries. Each element contains the following attributes:
    accept_language str
    output_file str
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    A list of Zone IDs.
    zones List<Property Map>
    A list of Zone Entries. Each element contains the following attributes:
    acceptLanguage String
    outputFile String

    Supporting Types

    GetZonesZone

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

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.75.0 published on Friday, Mar 7, 2025 by Pulumi