alicloud logo
Alibaba Cloud v3.34.0, Mar 17 23

alicloud.adb.getDBClusters

This data source provides the Adb DBClusters of the current Alibaba Cloud user.

NOTE: Available in v1.121.0+.

Example Usage

Basic Usage

using System.Collections.Generic;
using Pulumi;
using AliCloud = Pulumi.AliCloud;

return await Deployment.RunAsync(() => 
{
    var example = AliCloud.Adb.GetDBClusters.Invoke(new()
    {
        DescriptionRegex = "example",
    });

    return new Dictionary<string, object?>
    {
        ["firstAdbDbClusterId"] = example.Apply(getDBClustersResult => getDBClustersResult.Clusters[0]?.Id),
    };
});
package main

import (
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/adb"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := adb.GetDBClusters(ctx, &adb.GetDBClustersArgs{
			DescriptionRegex: pulumi.StringRef("example"),
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("firstAdbDbClusterId", example.Clusters[0].Id)
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.adb.AdbFunctions;
import com.pulumi.alicloud.adb.inputs.GetDBClustersArgs;
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 example = AdbFunctions.getDBClusters(GetDBClustersArgs.builder()
            .descriptionRegex("example")
            .build());

        ctx.export("firstAdbDbClusterId", example.applyValue(getDBClustersResult -> getDBClustersResult.clusters()[0].id()));
    }
}
import pulumi
import pulumi_alicloud as alicloud

example = alicloud.adb.get_db_clusters(description_regex="example")
pulumi.export("firstAdbDbClusterId", example.clusters[0].id)
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const example = alicloud.adb.getDBClusters({
    descriptionRegex: "example",
});
export const firstAdbDbClusterId = example.then(example => example.clusters?.[0]?.id);
variables:
  example:
    fn::invoke:
      Function: alicloud:adb:getDBClusters
      Arguments:
        descriptionRegex: example
outputs:
  firstAdbDbClusterId: ${example.clusters[0].id}

Using getDBClusters

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getDBClusters(args: GetDBClustersArgs, opts?: InvokeOptions): Promise<GetDBClustersResult>
function getDBClustersOutput(args: GetDBClustersOutputArgs, opts?: InvokeOptions): Output<GetDBClustersResult>
def get_db_clusters(description: Optional[str] = None,
                    description_regex: Optional[str] = None,
                    enable_details: Optional[bool] = None,
                    ids: Optional[Sequence[str]] = None,
                    output_file: Optional[str] = None,
                    page_number: Optional[int] = None,
                    page_size: Optional[int] = None,
                    resource_group_id: Optional[str] = None,
                    status: Optional[str] = None,
                    tags: Optional[Mapping[str, Any]] = None,
                    opts: Optional[InvokeOptions] = None) -> GetDBClustersResult
def get_db_clusters_output(description: Optional[pulumi.Input[str]] = None,
                    description_regex: Optional[pulumi.Input[str]] = None,
                    enable_details: Optional[pulumi.Input[bool]] = None,
                    ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                    output_file: Optional[pulumi.Input[str]] = None,
                    page_number: Optional[pulumi.Input[int]] = None,
                    page_size: Optional[pulumi.Input[int]] = None,
                    resource_group_id: Optional[pulumi.Input[str]] = None,
                    status: Optional[pulumi.Input[str]] = None,
                    tags: Optional[pulumi.Input[Mapping[str, Any]]] = None,
                    opts: Optional[InvokeOptions] = None) -> Output[GetDBClustersResult]
func GetDBClusters(ctx *Context, args *GetDBClustersArgs, opts ...InvokeOption) (*GetDBClustersResult, error)
func GetDBClustersOutput(ctx *Context, args *GetDBClustersOutputArgs, opts ...InvokeOption) GetDBClustersResultOutput

> Note: This function is named GetDBClusters in the Go SDK.

public static class GetDBClusters 
{
    public static Task<GetDBClustersResult> InvokeAsync(GetDBClustersArgs args, InvokeOptions? opts = null)
    public static Output<GetDBClustersResult> Invoke(GetDBClustersInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetDBClustersResult> getDBClusters(GetDBClustersArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
  function: alicloud:adb/getDBClusters:getDBClusters
  arguments:
    # arguments dictionary

The following arguments are supported:

Description string

The description of DBCluster.

DescriptionRegex string

A regex string to filter results by DBCluster description.

EnableDetails bool

Default to false. Set it to true can output more details about resource attributes.

Ids List<string>

A list of DBCluster IDs.

OutputFile string
PageNumber int
PageSize int
ResourceGroupId string

The ID of the resource group.

Status string

The status of the resource.

Tags Dictionary<string, object>

The tag of the resource.

Description string

The description of DBCluster.

DescriptionRegex string

A regex string to filter results by DBCluster description.

EnableDetails bool

Default to false. Set it to true can output more details about resource attributes.

Ids []string

A list of DBCluster IDs.

OutputFile string
PageNumber int
PageSize int
ResourceGroupId string

The ID of the resource group.

Status string

The status of the resource.

Tags map[string]interface{}

The tag of the resource.

description String

The description of DBCluster.

descriptionRegex String

A regex string to filter results by DBCluster description.

enableDetails Boolean

Default to false. Set it to true can output more details about resource attributes.

ids List<String>

A list of DBCluster IDs.

outputFile String
pageNumber Integer
pageSize Integer
resourceGroupId String

The ID of the resource group.

status String

The status of the resource.

tags Map<String,Object>

The tag of the resource.

description string

The description of DBCluster.

descriptionRegex string

A regex string to filter results by DBCluster description.

enableDetails boolean

Default to false. Set it to true can output more details about resource attributes.

ids string[]

A list of DBCluster IDs.

outputFile string
pageNumber number
pageSize number
resourceGroupId string

The ID of the resource group.

status string

The status of the resource.

tags {[key: string]: any}

The tag of the resource.

description str

The description of DBCluster.

description_regex str

A regex string to filter results by DBCluster description.

enable_details bool

Default to false. Set it to true can output more details about resource attributes.

ids Sequence[str]

A list of DBCluster IDs.

output_file str
page_number int
page_size int
resource_group_id str

The ID of the resource group.

status str

The status of the resource.

tags Mapping[str, Any]

The tag of the resource.

description String

The description of DBCluster.

descriptionRegex String

A regex string to filter results by DBCluster description.

enableDetails Boolean

Default to false. Set it to true can output more details about resource attributes.

ids List<String>

A list of DBCluster IDs.

outputFile String
pageNumber Number
pageSize Number
resourceGroupId String

The ID of the resource group.

status String

The status of the resource.

tags Map<Any>

The tag of the resource.

getDBClusters Result

The following output properties are available:

Clusters List<Pulumi.AliCloud.Adb.Outputs.GetDBClustersCluster>
Descriptions List<string>
Id string

The provider-assigned unique ID for this managed resource.

Ids List<string>
TotalCount int
Description string
DescriptionRegex string
EnableDetails bool
OutputFile string
PageNumber int
PageSize int
ResourceGroupId string
Status string
Tags Dictionary<string, object>
Clusters []GetDBClustersCluster
Descriptions []string
Id string

The provider-assigned unique ID for this managed resource.

Ids []string
TotalCount int
Description string
DescriptionRegex string
EnableDetails bool
OutputFile string
PageNumber int
PageSize int
ResourceGroupId string
Status string
Tags map[string]interface{}
clusters List<GetDBClustersCluster>
descriptions List<String>
id String

The provider-assigned unique ID for this managed resource.

ids List<String>
totalCount Integer
description String
descriptionRegex String
enableDetails Boolean
outputFile String
pageNumber Integer
pageSize Integer
resourceGroupId String
status String
tags Map<String,Object>
clusters GetDBClustersCluster[]
descriptions string[]
id string

The provider-assigned unique ID for this managed resource.

ids string[]
totalCount number
description string
descriptionRegex string
enableDetails boolean
outputFile string
pageNumber number
pageSize number
resourceGroupId string
status string
tags {[key: string]: any}
clusters Sequence[GetDBClustersCluster]
descriptions Sequence[str]
id str

The provider-assigned unique ID for this managed resource.

ids Sequence[str]
total_count int
description str
description_regex str
enable_details bool
output_file str
page_number int
page_size int
resource_group_id str
status str
tags Mapping[str, Any]
clusters List<Property Map>
descriptions List<String>
id String

The provider-assigned unique ID for this managed resource.

ids List<String>
totalCount Number
description String
descriptionRegex String
enableDetails Boolean
outputFile String
pageNumber Number
pageSize Number
resourceGroupId String
status String
tags Map<Any>

Supporting Types

GetDBClustersCluster

AutoRenewPeriod int

Auto-renewal period of an cluster, in the unit of the month.

ChargeType string

The payment type of the resource.

CommodityCode string

The name of the service.

ComputeResource string

The specifications of computing resources in elastic mode. The increase of resources can speed up queries. AnalyticDB for MySQL automatically scales computing resources. For more information, see Specifications.

ConnectionString string

The endpoint of the cluster.

CreateTime string

The CreateTime of the ADB cluster.

DbClusterCategory string

The db cluster category.

DbClusterId string

The db cluster id.

DbClusterNetworkType string

The db cluster network type.

DbClusterType string

The db cluster type.

DbClusterVersion string

The db cluster version.

DbNodeClass string

The db node class.

DbNodeCount int

The db node count.

DbNodeStorage int

The db node storage.

Description string

The description of DBCluster.

DiskType string

The type of the disk.

DtsJobId string

The ID of the data synchronization task in Data Transmission Service (DTS). This parameter is valid only for analytic instances.

ElasticIoResource int

The elastic io resource.

Engine string

The engine of the database.

EngineVersion string

The engine version of the database.

ExecutorCount string

The number of nodes. The node resources are used for data computing in elastic mode.

ExpireTime string

The time when the cluster expires.

Expired string

Indicates whether the cluster has expired.

Id string

The ID of the DBCluster.

LockMode string

The lock mode of the cluster.

LockReason string

The reason why the cluster is locked.

MaintainTime string

The maintenance window of the cluster.

Mode string

The lock mode of the cluster.

NetworkType string
PaymentType string

The payment type of the resource.

Port int

The port that is used to access the cluster.

RdsInstanceId string

The ID of the ApsaraDB RDS instance from which data is synchronized to the cluster. This parameter is valid only for analytic instances.

RegionId string
RenewalStatus string

The status of renewal.

ResourceGroupId string

The ID of the resource group.

SecurityIps List<string>

List of IP addresses allowed to access all databases of an cluster.

Status string

The status of the resource.

StorageResource string

The specifications of storage resources in elastic mode. The resources are used for data read and write operations. The increase of resources can improve the read and write performance of your cluster. For more information, see Specifications.

Tags Dictionary<string, object>

The tag of the resource.

VpcCloudInstanceId string

The vpc cloud instance id.

VpcId string

The vpc id.

VswitchId string

The vswitch id.

ZoneId string

The zone ID of the resource.

AutoRenewPeriod int

Auto-renewal period of an cluster, in the unit of the month.

ChargeType string

The payment type of the resource.

CommodityCode string

The name of the service.

ComputeResource string

The specifications of computing resources in elastic mode. The increase of resources can speed up queries. AnalyticDB for MySQL automatically scales computing resources. For more information, see Specifications.

ConnectionString string

The endpoint of the cluster.

CreateTime string

The CreateTime of the ADB cluster.

DbClusterCategory string

The db cluster category.

DbClusterId string

The db cluster id.

DbClusterNetworkType string

The db cluster network type.

DbClusterType string

The db cluster type.

DbClusterVersion string

The db cluster version.

DbNodeClass string

The db node class.

DbNodeCount int

The db node count.

DbNodeStorage int

The db node storage.

Description string

The description of DBCluster.

DiskType string

The type of the disk.

DtsJobId string

The ID of the data synchronization task in Data Transmission Service (DTS). This parameter is valid only for analytic instances.

ElasticIoResource int

The elastic io resource.

Engine string

The engine of the database.

EngineVersion string

The engine version of the database.

ExecutorCount string

The number of nodes. The node resources are used for data computing in elastic mode.

ExpireTime string

The time when the cluster expires.

Expired string

Indicates whether the cluster has expired.

Id string

The ID of the DBCluster.

LockMode string

The lock mode of the cluster.

LockReason string

The reason why the cluster is locked.

MaintainTime string

The maintenance window of the cluster.

Mode string

The lock mode of the cluster.

NetworkType string
PaymentType string

The payment type of the resource.

Port int

The port that is used to access the cluster.

RdsInstanceId string

The ID of the ApsaraDB RDS instance from which data is synchronized to the cluster. This parameter is valid only for analytic instances.

RegionId string
RenewalStatus string

The status of renewal.

ResourceGroupId string

The ID of the resource group.

SecurityIps []string

List of IP addresses allowed to access all databases of an cluster.

Status string

The status of the resource.

StorageResource string

The specifications of storage resources in elastic mode. The resources are used for data read and write operations. The increase of resources can improve the read and write performance of your cluster. For more information, see Specifications.

Tags map[string]interface{}

The tag of the resource.

VpcCloudInstanceId string

The vpc cloud instance id.

VpcId string

The vpc id.

VswitchId string

The vswitch id.

ZoneId string

The zone ID of the resource.

autoRenewPeriod Integer

Auto-renewal period of an cluster, in the unit of the month.

chargeType String

The payment type of the resource.

commodityCode String

The name of the service.

computeResource String

The specifications of computing resources in elastic mode. The increase of resources can speed up queries. AnalyticDB for MySQL automatically scales computing resources. For more information, see Specifications.

connectionString String

The endpoint of the cluster.

createTime String

The CreateTime of the ADB cluster.

dbClusterCategory String

The db cluster category.

dbClusterId String

The db cluster id.

dbClusterNetworkType String

The db cluster network type.

dbClusterType String

The db cluster type.

dbClusterVersion String

The db cluster version.

dbNodeClass String

The db node class.

dbNodeCount Integer

The db node count.

dbNodeStorage Integer

The db node storage.

description String

The description of DBCluster.

diskType String

The type of the disk.

dtsJobId String

The ID of the data synchronization task in Data Transmission Service (DTS). This parameter is valid only for analytic instances.

elasticIoResource Integer

The elastic io resource.

engine String

The engine of the database.

engineVersion String

The engine version of the database.

executorCount String

The number of nodes. The node resources are used for data computing in elastic mode.

expireTime String

The time when the cluster expires.

expired String

Indicates whether the cluster has expired.

id String

The ID of the DBCluster.

lockMode String

The lock mode of the cluster.

lockReason String

The reason why the cluster is locked.

maintainTime String

The maintenance window of the cluster.

mode String

The lock mode of the cluster.

networkType String
paymentType String

The payment type of the resource.

port Integer

The port that is used to access the cluster.

rdsInstanceId String

The ID of the ApsaraDB RDS instance from which data is synchronized to the cluster. This parameter is valid only for analytic instances.

regionId String
renewalStatus String

The status of renewal.

resourceGroupId String

The ID of the resource group.

securityIps List<String>

List of IP addresses allowed to access all databases of an cluster.

status String

The status of the resource.

storageResource String

The specifications of storage resources in elastic mode. The resources are used for data read and write operations. The increase of resources can improve the read and write performance of your cluster. For more information, see Specifications.

tags Map<String,Object>

The tag of the resource.

vpcCloudInstanceId String

The vpc cloud instance id.

vpcId String

The vpc id.

vswitchId String

The vswitch id.

zoneId String

The zone ID of the resource.

autoRenewPeriod number

Auto-renewal period of an cluster, in the unit of the month.

chargeType string

The payment type of the resource.

commodityCode string

The name of the service.

computeResource string

The specifications of computing resources in elastic mode. The increase of resources can speed up queries. AnalyticDB for MySQL automatically scales computing resources. For more information, see Specifications.

connectionString string

The endpoint of the cluster.

createTime string

The CreateTime of the ADB cluster.

dbClusterCategory string

The db cluster category.

dbClusterId string

The db cluster id.

dbClusterNetworkType string

The db cluster network type.

dbClusterType string

The db cluster type.

dbClusterVersion string

The db cluster version.

dbNodeClass string

The db node class.

dbNodeCount number

The db node count.

dbNodeStorage number

The db node storage.

description string

The description of DBCluster.

diskType string

The type of the disk.

dtsJobId string

The ID of the data synchronization task in Data Transmission Service (DTS). This parameter is valid only for analytic instances.

elasticIoResource number

The elastic io resource.

engine string

The engine of the database.

engineVersion string

The engine version of the database.

executorCount string

The number of nodes. The node resources are used for data computing in elastic mode.

expireTime string

The time when the cluster expires.

expired string

Indicates whether the cluster has expired.

id string

The ID of the DBCluster.

lockMode string

The lock mode of the cluster.

lockReason string

The reason why the cluster is locked.

maintainTime string

The maintenance window of the cluster.

mode string

The lock mode of the cluster.

networkType string
paymentType string

The payment type of the resource.

port number

The port that is used to access the cluster.

rdsInstanceId string

The ID of the ApsaraDB RDS instance from which data is synchronized to the cluster. This parameter is valid only for analytic instances.

regionId string
renewalStatus string

The status of renewal.

resourceGroupId string

The ID of the resource group.

securityIps string[]

List of IP addresses allowed to access all databases of an cluster.

status string

The status of the resource.

storageResource string

The specifications of storage resources in elastic mode. The resources are used for data read and write operations. The increase of resources can improve the read and write performance of your cluster. For more information, see Specifications.

tags {[key: string]: any}

The tag of the resource.

vpcCloudInstanceId string

The vpc cloud instance id.

vpcId string

The vpc id.

vswitchId string

The vswitch id.

zoneId string

The zone ID of the resource.

auto_renew_period int

Auto-renewal period of an cluster, in the unit of the month.

charge_type str

The payment type of the resource.

commodity_code str

The name of the service.

compute_resource str

The specifications of computing resources in elastic mode. The increase of resources can speed up queries. AnalyticDB for MySQL automatically scales computing resources. For more information, see Specifications.

connection_string str

The endpoint of the cluster.

create_time str

The CreateTime of the ADB cluster.

db_cluster_category str

The db cluster category.

db_cluster_id str

The db cluster id.

db_cluster_network_type str

The db cluster network type.

db_cluster_type str

The db cluster type.

db_cluster_version str

The db cluster version.

db_node_class str

The db node class.

db_node_count int

The db node count.

db_node_storage int

The db node storage.

description str

The description of DBCluster.

disk_type str

The type of the disk.

dts_job_id str

The ID of the data synchronization task in Data Transmission Service (DTS). This parameter is valid only for analytic instances.

elastic_io_resource int

The elastic io resource.

engine str

The engine of the database.

engine_version str

The engine version of the database.

executor_count str

The number of nodes. The node resources are used for data computing in elastic mode.

expire_time str

The time when the cluster expires.

expired str

Indicates whether the cluster has expired.

id str

The ID of the DBCluster.

lock_mode str

The lock mode of the cluster.

lock_reason str

The reason why the cluster is locked.

maintain_time str

The maintenance window of the cluster.

mode str

The lock mode of the cluster.

network_type str
payment_type str

The payment type of the resource.

port int

The port that is used to access the cluster.

rds_instance_id str

The ID of the ApsaraDB RDS instance from which data is synchronized to the cluster. This parameter is valid only for analytic instances.

region_id str
renewal_status str

The status of renewal.

resource_group_id str

The ID of the resource group.

security_ips Sequence[str]

List of IP addresses allowed to access all databases of an cluster.

status str

The status of the resource.

storage_resource str

The specifications of storage resources in elastic mode. The resources are used for data read and write operations. The increase of resources can improve the read and write performance of your cluster. For more information, see Specifications.

tags Mapping[str, Any]

The tag of the resource.

vpc_cloud_instance_id str

The vpc cloud instance id.

vpc_id str

The vpc id.

vswitch_id str

The vswitch id.

zone_id str

The zone ID of the resource.

autoRenewPeriod Number

Auto-renewal period of an cluster, in the unit of the month.

chargeType String

The payment type of the resource.

commodityCode String

The name of the service.

computeResource String

The specifications of computing resources in elastic mode. The increase of resources can speed up queries. AnalyticDB for MySQL automatically scales computing resources. For more information, see Specifications.

connectionString String

The endpoint of the cluster.

createTime String

The CreateTime of the ADB cluster.

dbClusterCategory String

The db cluster category.

dbClusterId String

The db cluster id.

dbClusterNetworkType String

The db cluster network type.

dbClusterType String

The db cluster type.

dbClusterVersion String

The db cluster version.

dbNodeClass String

The db node class.

dbNodeCount Number

The db node count.

dbNodeStorage Number

The db node storage.

description String

The description of DBCluster.

diskType String

The type of the disk.

dtsJobId String

The ID of the data synchronization task in Data Transmission Service (DTS). This parameter is valid only for analytic instances.

elasticIoResource Number

The elastic io resource.

engine String

The engine of the database.

engineVersion String

The engine version of the database.

executorCount String

The number of nodes. The node resources are used for data computing in elastic mode.

expireTime String

The time when the cluster expires.

expired String

Indicates whether the cluster has expired.

id String

The ID of the DBCluster.

lockMode String

The lock mode of the cluster.

lockReason String

The reason why the cluster is locked.

maintainTime String

The maintenance window of the cluster.

mode String

The lock mode of the cluster.

networkType String
paymentType String

The payment type of the resource.

port Number

The port that is used to access the cluster.

rdsInstanceId String

The ID of the ApsaraDB RDS instance from which data is synchronized to the cluster. This parameter is valid only for analytic instances.

regionId String
renewalStatus String

The status of renewal.

resourceGroupId String

The ID of the resource group.

securityIps List<String>

List of IP addresses allowed to access all databases of an cluster.

status String

The status of the resource.

storageResource String

The specifications of storage resources in elastic mode. The resources are used for data read and write operations. The increase of resources can improve the read and write performance of your cluster. For more information, see Specifications.

tags Map<Any>

The tag of the resource.

vpcCloudInstanceId String

The vpc cloud instance id.

vpcId String

The vpc id.

vswitchId String

The vswitch id.

zoneId String

The zone ID of the resource.

Package Details

Repository
Alibaba Cloud pulumi/pulumi-alicloud
License
Apache-2.0
Notes

This Pulumi package is based on the alicloud Terraform Provider.