Alibaba Cloud v3.75.0 published on Friday, Mar 7, 2025 by Pulumi
alicloud.ros.getRegions
Explore with Pulumi AI
This data source provides the Ros Regions 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 all = alicloud.ros.getRegions({});
export const rosRegionRegionId1 = all.then(all => all.regions?.[0]?.regionId);
import pulumi
import pulumi_alicloud as alicloud
all = alicloud.ros.get_regions()
pulumi.export("rosRegionRegionId1", all.regions[0].region_id)
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, &ros.GetRegionsArgs{}, nil)
		if err != nil {
			return err
		}
		ctx.Export("rosRegionRegionId1", all.Regions[0].RegionId)
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() => 
{
    var all = AliCloud.Ros.GetRegions.Invoke();
    return new Dictionary<string, object?>
    {
        ["rosRegionRegionId1"] = all.Apply(getRegionsResult => getRegionsResult.Regions[0]?.RegionId),
    };
});
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.ros.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()));
    }
}
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)
public static Output<GetRegionsResult> getRegions(GetRegionsArgs args, InvokeOptions options)
fn::invoke:
  function: alicloud:ros/getRegions:getRegions
  arguments:
    # arguments dictionaryThe 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).
getRegions Result
The following output properties are available:
- Id string
- The provider-assigned unique ID for this managed resource.
- Regions
List<Pulumi.Ali Cloud. Ros. Outputs. Get Regions Region> 
- OutputFile string
- Id string
- The provider-assigned unique ID for this managed resource.
- Regions
[]GetRegions Region 
- OutputFile string
- id String
- The provider-assigned unique ID for this managed resource.
- regions
List<GetRegions Region> 
- outputFile String
- id string
- The provider-assigned unique ID for this managed resource.
- regions
GetRegions Region[] 
- outputFile string
- id str
- The provider-assigned unique ID for this managed resource.
- regions
Sequence[GetRegions Region] 
- 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
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the alicloudTerraform Provider.