Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 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, nil, 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)
// Output-based functions aren't available in Java yet
fn::invoke:
function: alicloud:ros/getRegions:getRegions
arguments:
# arguments dictionary
The following arguments are supported:
- Output
File string - File name where to save data source results (after running
pulumi preview
).
- Output
File string - File name where to save data source results (after running
pulumi preview
).
- output
File String - File name where to save data source results (after running
pulumi preview
).
- output
File 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
).
- output
File 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> - Output
File string
- Id string
- The provider-assigned unique ID for this managed resource.
- Regions
[]Get
Regions Region - Output
File string
- id String
- The provider-assigned unique ID for this managed resource.
- regions
List<Get
Regions Region> - output
File String
- id string
- The provider-assigned unique ID for this managed resource.
- regions
Get
Regions Region[] - output
File string
- id str
- The provider-assigned unique ID for this managed resource.
- regions
Sequence[Get
Regions Region] - output_
file str
- id String
- The provider-assigned unique ID for this managed resource.
- regions List<Property Map>
- output
File String
Supporting Types
GetRegionsRegion
- Local
Name string - The name of the region.
- Region
Endpoint string - The endpoint of the region.
- Region
Id string - The ID of the region.
- Local
Name string - The name of the region.
- Region
Endpoint string - The endpoint of the region.
- Region
Id string - The ID of the region.
- local
Name String - The name of the region.
- region
Endpoint String - The endpoint of the region.
- region
Id String - The ID of the region.
- local
Name string - The name of the region.
- region
Endpoint string - The endpoint of the region.
- region
Id 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.
- local
Name String - The name of the region.
- region
Endpoint String - The endpoint of the region.
- region
Id 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
alicloud
Terraform Provider.