Alibaba Cloud

v3.28.0 published on Tuesday, Aug 16, 2022 by Pulumi

getRegions

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

NOTE: Available in v1.145.0+.

Example Usage

Basic Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var all = Output.Create(AliCloud.Ros.GetRegions.InvokeAsync());
        this.RosRegionRegionId1 = all.Apply(all => all.Regions?[0]?.RegionId);
    }

    [Output("rosRegionRegionId1")]
    public Output<string> RosRegionRegionId1 { get; set; }
}
package main

import (
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ros"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		all, err := ros.GetRegions(ctx, nil, nil)
		if err != nil {
			return err
		}
		ctx.Export("rosRegionRegionId1", all.Regions[0].RegionId)
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.ros.RosFunctions;
import com.pulumi.alicloud.clickhouse.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 all = RosFunctions.getRegions();

        ctx.export("rosRegionRegionId1", all.applyValue(getRegionsResult -> getRegionsResult.regions()[0].regionId()));
    }
}
import pulumi
import pulumi_alicloud as alicloud

all = alicloud.ros.get_regions()
pulumi.export("rosRegionRegionId1", all.regions[0].region_id)
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const all = alicloud.ros.getRegions({});
export const rosRegionRegionId1 = all.then(all => all.regions?[0]?.regionId);
variables:
  all:
    Fn::Invoke:
      Function: alicloud:ros:getRegions
      Arguments: {}
outputs:
  rosRegionRegionId1: ${all.regions[0].regionId}

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,
                opts: Optional[InvokeOptions] = None) -> GetRegionsResult
def get_regions_output(output_file: 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:ros/getRegions:getRegions
  arguments:
    # arguments dictionary

The following arguments are supported:

OutputFile string
OutputFile string
outputFile String
outputFile string
outputFile String

getRegions Result

The following output properties are available:

Id string

The provider-assigned unique ID for this managed resource.

Regions List<Pulumi.AliCloud.Ros.Outputs.GetRegionsRegion>
OutputFile string
Id string

The provider-assigned unique ID for this managed resource.

Regions []GetRegionsRegion
OutputFile string
id String

The provider-assigned unique ID for this managed resource.

regions List<GetRegionsRegion>
outputFile String
id string

The provider-assigned unique ID for this managed resource.

regions GetRegionsRegion[]
outputFile string
id str

The provider-assigned unique ID for this managed resource.

regions Sequence[GetRegionsRegion]
output_file str
id String

The provider-assigned unique ID for this managed resource.

regions List<Property Map>
outputFile String

Supporting Types

GetRegionsRegion

LocalName string

The name of the region.

RegionEndpoint string

The endpoint of the region.

RegionId string

The ID of the region.

LocalName string

The name of the region.

RegionEndpoint string

The endpoint of the region.

RegionId string

The ID of the region.

localName String

The name of the region.

regionEndpoint String

The endpoint of the region.

regionId String

The ID of the region.

localName string

The name of the region.

regionEndpoint string

The endpoint of the region.

regionId string

The ID of the region.

local_name str

The name of the region.

region_endpoint str

The endpoint of the region.

region_id str

The ID of the region.

localName String

The name of the region.

regionEndpoint String

The endpoint of the region.

regionId String

The ID of the region.

Package Details

Repository
https://github.com/pulumi/pulumi-alicloud
License
Apache-2.0
Notes

This Pulumi package is based on the alicloud Terraform Provider.