getClusters

The alicloud.polardb.getClusters data source provides a collection of PolarDB clusters available in Alibaba Cloud account. Filters support regular expression for the cluster description, searches by tags, and other filters which are listed below.

NOTE: Available in v1.66.0+.

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.polardb.PolardbFunctions;
import com.pulumi.alicloud.polardb.inputs.GetClustersArgs;
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 polardbClustersDs = PolardbFunctions.getClusters(GetClustersArgs.builder()
.descriptionRegex("pc-\\w+")
.status("Running")
.build());
ctx.export("firstPolardbClusterId", polardbClustersDs.applyValue(getClustersResult -> getClustersResult.clusters()[0].id()));
}
}

Return

A collection of values returned by getClusters.

Parameters

argument

A collection of arguments for invoking getClusters.


suspend fun getClusters(dbType: String? = null, descriptionRegex: String? = null, ids: List<String>? = null, outputFile: String? = null, status: String? = null, tags: Map<String, Any>? = null): GetClustersResult

Return

A collection of values returned by getClusters.

See also

Parameters

dbType

Database type. Options are MySQL, Oracle and PostgreSQL. If no value is specified, all types are returned.

descriptionRegex

A regex string to filter results by cluster description.

ids

A list of PolarDB cluster IDs.

outputFile

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

status

status of the cluster.

tags

A mapping of tags to assign to the resource.

  • Key: It can be up to 64 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It cannot be a null string.

  • Value: It can be up to 128 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://". It can be a null string.


suspend fun getClusters(argument: suspend GetClustersPlainArgsBuilder.() -> Unit): GetClustersResult

Return

A collection of values returned by getClusters.

See also

Parameters

argument

Builder for com.pulumi.alicloud.polardb.kotlin.inputs.GetClustersPlainArgs.