get Clusters
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
A collection of arguments for invoking getClusters.
Return
A collection of values returned by getClusters.
See also
Parameters
Database type. Options are MySQL
, Oracle
and PostgreSQL
. If no value is specified, all types are returned.
A regex string to filter results by cluster description.
A list of PolarDB cluster IDs.
File name where to save data source results (after running pulumi preview
).
status of the cluster.
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.
Return
A collection of values returned by getClusters.
See also
Parameters
Builder for com.pulumi.alicloud.polardb.kotlin.inputs.GetClustersPlainArgs.