getRegions

This data source provides Alibaba Cloud regions.

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.AlicloudFunctions;
import com.pulumi.alicloud.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 currentRegionDs = AlicloudFunctions.getRegions(GetRegionsArgs.builder()
.current(true)
.build());
ctx.export("currentRegionId", currentRegionDs.applyValue(getRegionsResult -> getRegionsResult.regions()[0].id()));
}
}

Return

A collection of values returned by getRegions.

Parameters

argument

A collection of arguments for invoking getRegions.


suspend fun getRegions(current: Boolean? = null, name: String? = null, outputFile: String? = null): GetRegionsResult

Return

A collection of values returned by getRegions.

See also

Parameters

current

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

name

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

outputFile

File name where to save data source results (after running pulumi preview).

NOTE: You will get an error if you set current to true and name to a different value from the one you configured in the provider. It is better to either use name or current, but not both at the same time.


suspend fun getRegions(argument: suspend GetRegionsPlainArgsBuilder.() -> Unit): GetRegionsResult

Return

A collection of values returned by getRegions.

See also

Parameters

argument

Builder for com.pulumi.alicloud.kotlin.inputs.GetRegionsPlainArgs.