get Regions
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()));
}
}
Content copied to clipboard
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
.
output File
File name where to save data source results (after running pulumi preview
).
NOTE: You will get an error if you set
current
to true andname
to a different value from the one you configured in the provider. It is better to either usename
orcurrent
, but not both at the same time.
Return
A collection of values returned by getRegions.
See also
Parameters
argument
Builder for com.pulumi.alicloud.kotlin.inputs.GetRegionsPlainArgs.