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

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var polardbClustersDs = Output.Create(AliCloud.PolarDB.GetClusters.InvokeAsync(new AliCloud.PolarDB.GetClustersArgs
        {
            DescriptionRegex = "pc-\\w+",
            Status = "Running",
        }));
        this.FirstPolardbClusterId = polardbClustersDs.Apply(polardbClustersDs => polardbClustersDs.Clusters[0].Id);
    }

    [Output("firstPolardbClusterId")]
    public Output<string> FirstPolardbClusterId { get; set; }
}

Coming soon!

import pulumi
import pulumi_alicloud as alicloud

polardb_clusters_ds = alicloud.polardb.get_clusters(description_regex="pc-\\w+",
    status="Running")
pulumi.export("firstPolardbClusterId", polardb_clusters_ds.clusters[0]["id"])
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const polardbClustersDs = pulumi.output(alicloud.polardb.getClusters({
    descriptionRegex: "pc-\\w+",
    status: "Running",
}, { async: true }));

export const firstPolardbClusterId = polardbClustersDs.clusters[0].id;

Using GetClusters

function getClusters(args: GetClustersArgs, opts?: InvokeOptions): Promise<GetClustersResult>
function  get_clusters(db_type=None, description_regex=None, ids=None, output_file=None, status=None, tags=None, opts=None)
func GetClusters(ctx *Context, args *GetClustersArgs, opts ...InvokeOption) (*GetClustersResult, error)
public static class GetClusters {
    public static Task<GetClustersResult> InvokeAsync(GetClustersArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

DbType string

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

DescriptionRegex string

A regex string to filter results by cluster description.

Ids List<string>

A list of PolarDB cluster IDs.

OutputFile string
Status string

status of the cluster.

Tags Dictionary<string, object>

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.

DbType string

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

DescriptionRegex string

A regex string to filter results by cluster description.

Ids []string

A list of PolarDB cluster IDs.

OutputFile string
Status string

status of the cluster.

Tags map[string]interface{}

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.

dbType string

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

descriptionRegex string

A regex string to filter results by cluster description.

ids string[]

A list of PolarDB cluster IDs.

outputFile string
status string

status of the cluster.

tags {[key: string]: any}

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.

db_type str

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

description_regex str

A regex string to filter results by cluster description.

ids List[str]

A list of PolarDB cluster IDs.

output_file str
status str

status of the cluster.

tags Dict[str, Any]

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.

GetClusters Result

The following output properties are available:

Clusters List<Pulumi.AliCloud.PolarDB.Outputs.GetClustersCluster>

A list of PolarDB clusters. Each element contains the following attributes:

Descriptions List<string>

A list of RDS cluster descriptions.

Id string

The provider-assigned unique ID for this managed resource.

Ids List<string>

A list of RDS cluster IDs.

DbType string

Primary for primary cluster, ReadOnly for read-only cluster, Guard for disaster recovery cluster, and Temp for temporary cluster.

DescriptionRegex string
OutputFile string
Status string

Status of the cluster.

Tags Dictionary<string, object>
Clusters []GetClustersCluster

A list of PolarDB clusters. Each element contains the following attributes:

Descriptions []string

A list of RDS cluster descriptions.

Id string

The provider-assigned unique ID for this managed resource.

Ids []string

A list of RDS cluster IDs.

DbType string

Primary for primary cluster, ReadOnly for read-only cluster, Guard for disaster recovery cluster, and Temp for temporary cluster.

DescriptionRegex string
OutputFile string
Status string

Status of the cluster.

Tags map[string]interface{}
clusters GetClustersCluster[]

A list of PolarDB clusters. Each element contains the following attributes:

descriptions string[]

A list of RDS cluster descriptions.

id string

The provider-assigned unique ID for this managed resource.

ids string[]

A list of RDS cluster IDs.

dbType string

Primary for primary cluster, ReadOnly for read-only cluster, Guard for disaster recovery cluster, and Temp for temporary cluster.

descriptionRegex string
outputFile string
status string

Status of the cluster.

tags {[key: string]: any}
clusters List[GetClustersCluster]

A list of PolarDB clusters. Each element contains the following attributes:

descriptions List[str]

A list of RDS cluster descriptions.

id str

The provider-assigned unique ID for this managed resource.

ids List[str]

A list of RDS cluster IDs.

db_type str

Primary for primary cluster, ReadOnly for read-only cluster, Guard for disaster recovery cluster, and Temp for temporary cluster.

description_regex str
output_file str
status str

Status of the cluster.

tags Dict[str, Any]

Supporting Types

GetClustersCluster

See the output API doc for this type.

See the output API doc for this type.

See the output API doc for this type.

ChargeType string

Billing method. Value options: PostPaid for Pay-As-You-Go and PrePaid for subscription.

CreateTime string

The create_time of the db_nodes.

DbNodeClass string

The db_node_class of the db_nodes.

DbNodeNumber int

The DBNodeNumber of the PolarDB cluster.

DbNodes List<Pulumi.AliCloud.PolarDB.Inputs.GetClustersClusterDbNodeArgs>

The DBNodes of the PolarDB cluster.

DbType string

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

DbVersion string

The DBVersion of the PolarDB cluster.

DeleteLock int

The DeleteLock of the PolarDB cluster.

Description string

The description of the PolarDB cluster.

Engine string

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

ExpireTime string

Expiration time. Pay-As-You-Go clusters never expire.

Expired string

The expired of the PolarDB cluster.

Id string

The ID of the PolarDB cluster.

LockMode string

The LockMode of the PolarDB cluster.

NetworkType string

The DBClusterNetworkType of the PolarDB cluster.

RegionId string

The region_id of the db_nodes.

Status string

status of the cluster.

StorageUsed int

The StorageUsed of the PolarDB cluster.

VpcId string

ID of the VPC the cluster belongs to.

ZoneId string

The zone_id of the db_nodes.

ChargeType string

Billing method. Value options: PostPaid for Pay-As-You-Go and PrePaid for subscription.

CreateTime string

The create_time of the db_nodes.

DbNodeClass string

The db_node_class of the db_nodes.

DbNodeNumber int

The DBNodeNumber of the PolarDB cluster.

DbNodes []GetClustersClusterDbNode

The DBNodes of the PolarDB cluster.

DbType string

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

DbVersion string

The DBVersion of the PolarDB cluster.

DeleteLock int

The DeleteLock of the PolarDB cluster.

Description string

The description of the PolarDB cluster.

Engine string

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

ExpireTime string

Expiration time. Pay-As-You-Go clusters never expire.

Expired string

The expired of the PolarDB cluster.

Id string

The ID of the PolarDB cluster.

LockMode string

The LockMode of the PolarDB cluster.

NetworkType string

The DBClusterNetworkType of the PolarDB cluster.

RegionId string

The region_id of the db_nodes.

Status string

status of the cluster.

StorageUsed int

The StorageUsed of the PolarDB cluster.

VpcId string

ID of the VPC the cluster belongs to.

ZoneId string

The zone_id of the db_nodes.

chargeType string

Billing method. Value options: PostPaid for Pay-As-You-Go and PrePaid for subscription.

createTime string

The create_time of the db_nodes.

dbNodeClass string

The db_node_class of the db_nodes.

dbNodeNumber number

The DBNodeNumber of the PolarDB cluster.

dbNodes GetClustersClusterDbNode[]

The DBNodes of the PolarDB cluster.

dbType string

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

dbVersion string

The DBVersion of the PolarDB cluster.

deleteLock number

The DeleteLock of the PolarDB cluster.

description string

The description of the PolarDB cluster.

engine string

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

expireTime string

Expiration time. Pay-As-You-Go clusters never expire.

expired string

The expired of the PolarDB cluster.

id string

The ID of the PolarDB cluster.

lockMode string

The LockMode of the PolarDB cluster.

networkType string

The DBClusterNetworkType of the PolarDB cluster.

regionId string

The region_id of the db_nodes.

status string

status of the cluster.

storageUsed number

The StorageUsed of the PolarDB cluster.

vpcId string

ID of the VPC the cluster belongs to.

zoneId string

The zone_id of the db_nodes.

charge_type str

Billing method. Value options: PostPaid for Pay-As-You-Go and PrePaid for subscription.

create_time str

The create_time of the db_nodes.

dbNodeNumber float

The DBNodeNumber of the PolarDB cluster.

dbNodes List[GetClustersClusterDbNode]

The DBNodes of the PolarDB cluster.

db_node_class str

The db_node_class of the db_nodes.

db_type str

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

db_version str

The DBVersion of the PolarDB cluster.

deleteLock float

The DeleteLock of the PolarDB cluster.

description str

The description of the PolarDB cluster.

engine str

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

expire_time str

Expiration time. Pay-As-You-Go clusters never expire.

expired str

The expired of the PolarDB cluster.

id str

The ID of the PolarDB cluster.

lockMode str

The LockMode of the PolarDB cluster.

network_type str

The DBClusterNetworkType of the PolarDB cluster.

regionId str

The region_id of the db_nodes.

status str

status of the cluster.

storageUsed float

The StorageUsed of the PolarDB cluster.

vpc_id str

ID of the VPC the cluster belongs to.

zone_id str

The zone_id of the db_nodes.

GetClustersClusterDbNode

See the output API doc for this type.

See the output API doc for this type.

See the output API doc for this type.

CreateTime string

The create_time of the db_nodes.

DbNodeClass string

The db_node_class of the db_nodes.

DbNodeId string

The db_node_id of the db_nodes.

DbNodeRole string

The db_node_role of the db_nodes.

DbNodeStatus string

The db_node_status of the db_nodes.

MaxConnections int

The max_connections of the db_nodes.

MaxIops int

The max_iops of the db_nodes.

RegionId string

The region_id of the db_nodes.

ZoneId string

The zone_id of the db_nodes.

CreateTime string

The create_time of the db_nodes.

DbNodeClass string

The db_node_class of the db_nodes.

DbNodeId string

The db_node_id of the db_nodes.

DbNodeRole string

The db_node_role of the db_nodes.

DbNodeStatus string

The db_node_status of the db_nodes.

MaxConnections int

The max_connections of the db_nodes.

MaxIops int

The max_iops of the db_nodes.

RegionId string

The region_id of the db_nodes.

ZoneId string

The zone_id of the db_nodes.

createTime string

The create_time of the db_nodes.

dbNodeClass string

The db_node_class of the db_nodes.

dbNodeId string

The db_node_id of the db_nodes.

dbNodeRole string

The db_node_role of the db_nodes.

dbNodeStatus string

The db_node_status of the db_nodes.

maxConnections number

The max_connections of the db_nodes.

maxIops number

The max_iops of the db_nodes.

regionId string

The region_id of the db_nodes.

zoneId string

The zone_id of the db_nodes.

create_time str

The create_time of the db_nodes.

dbNodeId str

The db_node_id of the db_nodes.

dbNodeRole str

The db_node_role of the db_nodes.

dbNodeStatus str

The db_node_status of the db_nodes.

db_node_class str

The db_node_class of the db_nodes.

maxIops float

The max_iops of the db_nodes.

max_connections float

The max_connections of the db_nodes.

regionId str

The region_id of the db_nodes.

zone_id str

The zone_id of the db_nodes.

Package Details

Repository
https://github.com/pulumi/pulumi-alicloud
License
Apache-2.0
Notes
This Pulumi package is based on the alicloud Terraform Provider.