1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. ebs
  5. getRegions
Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi

alicloud.ebs.getRegions

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi

    This data source provides the Ebs Regions of the current Alibaba Cloud user.

    NOTE: Available in v1.187.0+.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const default = alicloud.ebs.getRegions({
        regionId: "cn-hangzhou",
    });
    export const regions = _default.then(_default => _default.regions);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    default = alicloud.ebs.get_regions(region_id="cn-hangzhou")
    pulumi.export("regions", default.regions)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ebs"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_default, err := ebs.GetRegions(ctx, &ebs.GetRegionsArgs{
    			RegionId: pulumi.StringRef("cn-hangzhou"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("regions", _default.Regions)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var @default = AliCloud.Ebs.GetRegions.Invoke(new()
        {
            RegionId = "cn-hangzhou",
        });
    
        return new Dictionary<string, object?>
        {
            ["regions"] = @default.Apply(@default => @default.Apply(getRegionsResult => getRegionsResult.Regions)),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.ebs.EbsFunctions;
    import com.pulumi.alicloud.ebs.inputs.GetRegionsArgs;
    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 = EbsFunctions.getRegions(GetRegionsArgs.builder()
                .regionId("cn-hangzhou")
                .build());
    
            ctx.export("regions", default_.regions());
        }
    }
    
    variables:
      default:
        fn::invoke:
          Function: alicloud:ebs:getRegions
          Arguments:
            regionId: cn-hangzhou
    outputs:
      regions: ${default.regions}
    

    Using getRegions

    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 getRegions(args: GetRegionsArgs, opts?: InvokeOptions): Promise<GetRegionsResult>
    function getRegionsOutput(args: GetRegionsOutputArgs, opts?: InvokeOptions): Output<GetRegionsResult>
    def get_regions(output_file: Optional[str] = None,
                    region_id: Optional[str] = None,
                    opts: Optional[InvokeOptions] = None) -> GetRegionsResult
    def get_regions_output(output_file: Optional[pulumi.Input[str]] = None,
                    region_id: Optional[pulumi.Input[str]] = None,
                    opts: Optional[InvokeOptions] = None) -> Output[GetRegionsResult]
    func GetRegions(ctx *Context, args *GetRegionsArgs, opts ...InvokeOption) (*GetRegionsResult, error)
    func GetRegionsOutput(ctx *Context, args *GetRegionsOutputArgs, opts ...InvokeOption) GetRegionsResultOutput

    > Note: This function is named GetRegions in the Go SDK.

    public static class GetRegions 
    {
        public static Task<GetRegionsResult> InvokeAsync(GetRegionsArgs args, InvokeOptions? opts = null)
        public static Output<GetRegionsResult> Invoke(GetRegionsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetRegionsResult> getRegions(GetRegionsArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:ebs/getRegions:getRegions
      arguments:
        # arguments dictionary

    The following arguments are supported:

    OutputFile string
    File name where to save data source results (after running pulumi preview).
    RegionId string
    A list of Disk Replica Group IDs.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    RegionId string
    A list of Disk Replica Group IDs.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    regionId String
    A list of Disk Replica Group IDs.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    regionId string
    A list of Disk Replica Group IDs.
    output_file str
    File name where to save data source results (after running pulumi preview).
    region_id str
    A list of Disk Replica Group IDs.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    regionId String
    A list of Disk Replica Group IDs.

    getRegions Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Regions List<Pulumi.AliCloud.Ebs.Outputs.GetRegionsRegion>
    OutputFile string
    RegionId string
    Id string
    The provider-assigned unique ID for this managed resource.
    Regions []GetRegionsRegion
    OutputFile string
    RegionId string
    id String
    The provider-assigned unique ID for this managed resource.
    regions List<GetRegionsRegion>
    outputFile String
    regionId String
    id string
    The provider-assigned unique ID for this managed resource.
    regions GetRegionsRegion[]
    outputFile string
    regionId string
    id str
    The provider-assigned unique ID for this managed resource.
    regions Sequence[GetRegionsRegion]
    output_file str
    region_id str
    id String
    The provider-assigned unique ID for this managed resource.
    regions List<Property Map>
    outputFile String
    regionId String

    Supporting Types

    GetRegionsRegion

    RegionId string
    The ID of the region.
    Zones List<Pulumi.AliCloud.Ebs.Inputs.GetRegionsRegionZone>
    A list of Ebs Zones.
    RegionId string
    The ID of the region.
    Zones []GetRegionsRegionZone
    A list of Ebs Zones.
    regionId String
    The ID of the region.
    zones List<GetRegionsRegionZone>
    A list of Ebs Zones.
    regionId string
    The ID of the region.
    zones GetRegionsRegionZone[]
    A list of Ebs Zones.
    region_id str
    The ID of the region.
    zones Sequence[GetRegionsRegionZone]
    A list of Ebs Zones.
    regionId String
    The ID of the region.
    zones List<Property Map>
    A list of Ebs Zones.

    GetRegionsRegionZone

    ZoneId string
    The ID of the zone.
    ZoneId string
    The ID of the zone.
    zoneId String
    The ID of the zone.
    zoneId string
    The ID of the zone.
    zone_id str
    The ID of the zone.
    zoneId String
    The ID of the zone.

    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.66.0 published on Friday, Nov 15, 2024 by Pulumi