1. Packages
  2. Alicloud Provider
  3. API Docs
  4. hbase
  5. getZones
Alibaba Cloud v3.62.1 published on Monday, Sep 16, 2024 by Pulumi

alicloud.hbase.getZones

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.62.1 published on Monday, Sep 16, 2024 by Pulumi

    This data source provides availability zones for HBase that can be accessed by an Alibaba Cloud account within the region configured in the provider.

    NOTE: Available in v1.73.0+.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const zonesIds = alicloud.hbase.getZones({});
    const hbase = new alicloud.hbase.Instance("hbase", {zoneId: zonesIds.then(zonesIds => zonesIds.zones?.[0]?.id)});
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    zones_ids = alicloud.hbase.get_zones()
    hbase = alicloud.hbase.Instance("hbase", zone_id=zones_ids.zones[0].id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/hbase"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		zonesIds, err := hbase.GetZones(ctx, nil, nil)
    		if err != nil {
    			return err
    		}
    		_, err = hbase.NewInstance(ctx, "hbase", &hbase.InstanceArgs{
    			ZoneId: pulumi.String(zonesIds.Zones[0].Id),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var zonesIds = AliCloud.Hbase.GetZones.Invoke();
    
        var hbase = new AliCloud.Hbase.Instance("hbase", new()
        {
            ZoneId = zonesIds.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.hbase.HbaseFunctions;
    import com.pulumi.alicloud.hbase.inputs.GetZonesArgs;
    import com.pulumi.alicloud.hbase.Instance;
    import com.pulumi.alicloud.hbase.InstanceArgs;
    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 zonesIds = HbaseFunctions.getZones();
    
            var hbase = new Instance("hbase", InstanceArgs.builder()
                .zoneId(zonesIds.applyValue(getZonesResult -> getZonesResult.zones()[0].id()))
                .build());
    
        }
    }
    
    resources:
      hbase:
        type: alicloud:hbase:Instance
        properties:
          zoneId: ${zonesIds.zones[0].id}
    variables:
      zonesIds:
        fn::invoke:
          Function: alicloud:hbase:getZones
          Arguments: {}
    

    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:hbase/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.
    Ids List<string>
    A list of zone IDs.
    Zones List<Pulumi.AliCloud.Hbase.Outputs.GetZonesZone>
    A list of availability zones. Each element contains the following attributes:
    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 availability zones. Each element contains the following attributes:
    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 availability zones. Each element contains the following attributes:
    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 availability zones. Each element contains the following attributes:
    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 availability zones. Each element contains the following attributes:
    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 availability zones. Each element contains the following attributes:
    outputFile String

    Supporting Types

    GetZonesZone

    Id string
    ID of the zone.
    MultiZoneIds List<string>
    A list of zone ids in which the multi zone. Removed from v1.99.0.
    Id string
    ID of the zone.
    MultiZoneIds []string
    A list of zone ids in which the multi zone. Removed from v1.99.0.
    id String
    ID of the zone.
    multiZoneIds List<String>
    A list of zone ids in which the multi zone. Removed from v1.99.0.
    id string
    ID of the zone.
    multiZoneIds string[]
    A list of zone ids in which the multi zone. Removed from v1.99.0.
    id str
    ID of the zone.
    multi_zone_ids Sequence[str]
    A list of zone ids in which the multi zone. Removed from v1.99.0.
    id String
    ID of the zone.
    multiZoneIds List<String>
    A list of zone ids in which the multi zone. Removed from v1.99.0.

    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.62.1 published on Monday, Sep 16, 2024 by Pulumi