GetRegions

This data source provides Alibaba Cloud regions.

Example Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var currentRegionDs = Output.Create(AliCloud.GetRegions.InvokeAsync(new AliCloud.GetRegionsArgs
        {
            Current = true,
        }));
        this.CurrentRegionId = currentRegionDs.Apply(currentRegionDs => currentRegionDs.Regions[0].Id);
    }

    [Output("currentRegionId")]
    public Output<string> CurrentRegionId { get; set; }
}

Coming soon!

import pulumi
import pulumi_alicloud as alicloud

current_region_ds = alicloud.get_regions(current=True)
pulumi.export("currentRegionId", current_region_ds.regions[0]["id"])
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const currentRegionDs = pulumi.output(alicloud.getRegions({
    current: true,
}, { async: true }));

export const currentRegionId = currentRegionDs.regions[0].id;

Using GetRegions

function getRegions(args: GetRegionsArgs, opts?: InvokeOptions): Promise<GetRegionsResult>
function  get_regions(current=None, name=None, output_file=None, opts=None)
func GetRegions(ctx *Context, args *GetRegionsArgs, opts ...InvokeOption) (*GetRegionsResult, error)
public static class GetRegions {
    public static Task<GetRegionsResult> InvokeAsync(GetRegionsArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

Current bool

Set to true to match only the region configured in the provider.

Name string

The name of the region to select, such as eu-central-1.

OutputFile string
Current bool

Set to true to match only the region configured in the provider.

Name string

The name of the region to select, such as eu-central-1.

OutputFile string
current boolean

Set to true to match only the region configured in the provider.

name string

The name of the region to select, such as eu-central-1.

outputFile string
current bool

Set to true to match only the region configured in the provider.

name str

The name of the region to select, such as eu-central-1.

output_file str

GetRegions Result

The following output properties are available:

Current bool
Id string

The provider-assigned unique ID for this managed resource.

Ids List<string>

A list of region IDs.

Name string
Regions List<Pulumi.AliCloud.Outputs.GetRegionsRegion>

A list of regions. Each element contains the following attributes:

OutputFile string
Current bool
Id string

The provider-assigned unique ID for this managed resource.

Ids []string

A list of region IDs.

Name string
Regions []GetRegionsRegion

A list of regions. Each element contains the following attributes:

OutputFile string
current boolean
id string

The provider-assigned unique ID for this managed resource.

ids string[]

A list of region IDs.

name string
regions GetRegionsRegion[]

A list of regions. Each element contains the following attributes:

outputFile string
current bool
id str

The provider-assigned unique ID for this managed resource.

ids List[str]

A list of region IDs.

name str
regions List[GetRegionsRegion]

A list of regions. Each element contains the following attributes:

output_file str

Supporting Types

GetRegionsRegion

See the output API doc for this type.

See the output API doc for this type.

See the output API doc for this type.

Id string

ID of the region.

LocalName string

Name of the region in the local language.

RegionId string
Id string

ID of the region.

LocalName string

Name of the region in the local language.

RegionId string
id string

ID of the region.

localName string

Name of the region in the local language.

regionId string
id str

ID of the region.

localName str

Name of the region in the local language.

regionId str

Package Details

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