GetDatabases

The alicloud.polardb.getDatabases data source provides a collection of PolarDB cluster database available in Alibaba Cloud account. Filters support regular expression for the database name, searches by clusterId.

NOTE: Available in v1.70.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",
        }));
        var @default = polardbClustersDs.Apply(polardbClustersDs => Output.Create(AliCloud.PolarDB.GetDatabases.InvokeAsync(new AliCloud.PolarDB.GetDatabasesArgs
        {
            DbClusterId = polardbClustersDs.Clusters[0].Id,
        })));
        this.Ends = @default.Apply(@default => @default.Databases[0].DbName);
    }

    [Output("ends")]
    public Output<string> Ends { get; set; }
}

Coming soon!

import pulumi
import pulumi_alicloud as alicloud

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

const polardbClustersDs = alicloud.polardb.getClusters({
    descriptionRegex: "pc-\\w+",
    status: "Running",
});
const default = polardbClustersDs.then(polardbClustersDs => alicloud.polardb.getDatabases({
    dbClusterId: polardbClustersDs.clusters[0].id,
}));
export const ends = _default.then(_default => _default.databases[0].dbName);

Using GetDatabases

function getDatabases(args: GetDatabasesArgs, opts?: InvokeOptions): Promise<GetDatabasesResult>
function  get_databases(db_cluster_id=None, name_regex=None, opts=None)
func GetDatabases(ctx *Context, args *GetDatabasesArgs, opts ...InvokeOption) (*GetDatabasesResult, error)
public static class GetDatabases {
    public static Task<GetDatabasesResult> InvokeAsync(GetDatabasesArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

DbClusterId string

The polarDB cluster ID.

NameRegex string

A regex string to filter results by database name.

DbClusterId string

The polarDB cluster ID.

NameRegex string

A regex string to filter results by database name.

dbClusterId string

The polarDB cluster ID.

nameRegex string

A regex string to filter results by database name.

db_cluster_id str

The polarDB cluster ID.

name_regex str

A regex string to filter results by database name.

GetDatabases Result

The following output properties are available:

Databases List<Pulumi.AliCloud.PolarDB.Outputs.GetDatabasesDatabase>

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

DbClusterId string
Id string

The provider-assigned unique ID for this managed resource.

Names List<string>

database name of the cluster.

NameRegex string
Databases []GetDatabasesDatabase

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

DbClusterId string
Id string

The provider-assigned unique ID for this managed resource.

Names []string

database name of the cluster.

NameRegex string
databases GetDatabasesDatabase[]

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

dbClusterId string
id string

The provider-assigned unique ID for this managed resource.

names string[]

database name of the cluster.

nameRegex string
databases List[GetDatabasesDatabase]

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

db_cluster_id str
id str

The provider-assigned unique ID for this managed resource.

names List[str]

database name of the cluster.

name_regex str

Supporting Types

GetDatabasesDatabase

See the output API doc for this type.

See the output API doc for this type.

See the output API doc for this type.

Accounts List<Pulumi.AliCloud.PolarDB.Inputs.GetDatabasesDatabaseAccountArgs>

A list of accounts of database. Each element contains the following attributes.

CharacterSetName string

The character set name of database.

DbDescription string

Database description.

DbName string

Database name.

DbStatus string

The status of database.

Engine string

The engine of database.

Accounts []GetDatabasesDatabaseAccount

A list of accounts of database. Each element contains the following attributes.

CharacterSetName string

The character set name of database.

DbDescription string

Database description.

DbName string

Database name.

DbStatus string

The status of database.

Engine string

The engine of database.

accounts GetDatabasesDatabaseAccount[]

A list of accounts of database. Each element contains the following attributes.

characterSetName string

The character set name of database.

dbDescription string

Database description.

dbName string

Database name.

dbStatus string

The status of database.

engine string

The engine of database.

accounts List[GetDatabasesDatabaseAccount]

A list of accounts of database. Each element contains the following attributes.

character_set_name str

The character set name of database.

dbStatus str

The status of database.

db_description str

Database description.

db_name str

Database name.

engine str

The engine of database.

GetDatabasesDatabaseAccount

See the output API doc for this type.

See the output API doc for this type.

See the output API doc for this type.

AccountName string

Account name.

AccountStatus string

Account status.

PrivilegeStatus string

The privilege status of account.

AccountName string

Account name.

AccountStatus string

Account status.

PrivilegeStatus string

The privilege status of account.

accountName string

Account name.

accountStatus string

Account status.

privilegeStatus string

The privilege status of account.

accountStatus str

Account status.

account_name str

Account name.

privilegeStatus str

The privilege status of account.

Package Details

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