1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. eci
  5. getZones
Alibaba Cloud v3.51.0 published on Saturday, Mar 23, 2024 by Pulumi

alicloud.eci.getZones

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.51.0 published on Saturday, Mar 23, 2024 by Pulumi

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

    NOTE: Available in v1.145.0+.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const default = alicloud.eci.getZones({});
    export const firstEciZonesId = _default.then(_default => _default.zones?.[0]?.zoneIds?.[0]);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    default = alicloud.eci.get_zones()
    pulumi.export("firstEciZonesId", default.zones[0].zone_ids[0])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/eci"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_default, err := eci.GetZones(ctx, nil, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("firstEciZonesId", _default.Zones[0].ZoneIds[0])
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var @default = AliCloud.Eci.GetZones.Invoke();
    
        return new Dictionary<string, object?>
        {
            ["firstEciZonesId"] = @default.Apply(@default => @default.Apply(getZonesResult => getZonesResult.Zones[0]?.ZoneIds[0])),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.eci.EciFunctions;
    import com.pulumi.alicloud.eci.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 = EciFunctions.getZones();
    
            ctx.export("firstEciZonesId", default_.zones()[0].zoneIds()[0]);
        }
    }
    
    variables:
      default:
        fn::invoke:
          Function: alicloud:eci:getZones
          Arguments: {}
    outputs:
      firstEciZonesId: ${default.zones[0].zoneIds[0]}
    

    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)
    }
    public static CompletableFuture<GetZonesResult> getZones(GetZonesArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:eci/getZones:getZones
      arguments:
        # arguments dictionary

    The following arguments are supported:

    OutputFile string
    File name where to save data source results (after running pulumi preview).
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    outputFile String
    File name where to save data source results (after running pulumi preview).
    outputFile string
    File name where to save data source results (after running pulumi preview).
    output_file str
    File name where to save data source results (after running pulumi preview).
    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.
    Zones List<Pulumi.AliCloud.Eci.Outputs.GetZonesZone>
    OutputFile string
    Id string
    The provider-assigned unique ID for this managed resource.
    Zones []GetZonesZone
    OutputFile string
    id String
    The provider-assigned unique ID for this managed resource.
    zones List<GetZonesZone>
    outputFile String
    id string
    The provider-assigned unique ID for this managed resource.
    zones GetZonesZone[]
    outputFile string
    id str
    The provider-assigned unique ID for this managed resource.
    zones Sequence[GetZonesZone]
    output_file str
    id String
    The provider-assigned unique ID for this managed resource.
    zones List<Property Map>
    outputFile String

    Supporting Types

    GetZonesZone

    RegionEndpoint string
    The endpoint of the region.
    ZoneIds List<string>
    The list of available zone ids.
    RegionEndpoint string
    The endpoint of the region.
    ZoneIds []string
    The list of available zone ids.
    regionEndpoint String
    The endpoint of the region.
    zoneIds List<String>
    The list of available zone ids.
    regionEndpoint string
    The endpoint of the region.
    zoneIds string[]
    The list of available zone ids.
    region_endpoint str
    The endpoint of the region.
    zone_ids Sequence[str]
    The list of available zone ids.
    regionEndpoint String
    The endpoint of the region.
    zoneIds List<String>
    The list of available zone ids.

    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.51.0 published on Saturday, Mar 23, 2024 by Pulumi