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:
- Db
Cluster stringId The polarDB cluster ID.
- Name
Regex string A regex string to filter results by database name.
- Db
Cluster stringId The polarDB cluster ID.
- Name
Regex string A regex string to filter results by database name.
- db
Cluster stringId The polarDB cluster ID.
- name
Regex string A regex string to filter results by database name.
- db_
cluster_ strid 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.
Ali Cloud. Polar DB. Outputs. Get Databases Database> A list of PolarDB cluster databases. Each element contains the following attributes:
- Db
Cluster stringId - Id string
The provider-assigned unique ID for this managed resource.
- Names List<string>
database name of the cluster.
- Name
Regex string
- Databases
[]Get
Databases Database A list of PolarDB cluster databases. Each element contains the following attributes:
- Db
Cluster stringId - Id string
The provider-assigned unique ID for this managed resource.
- Names []string
database name of the cluster.
- Name
Regex string
- databases
Get
Databases Database[] A list of PolarDB cluster databases. Each element contains the following attributes:
- db
Cluster stringId - id string
The provider-assigned unique ID for this managed resource.
- names string[]
database name of the cluster.
- name
Regex string
- databases
List[Get
Databases Database] A list of PolarDB cluster databases. Each element contains the following attributes:
- db_
cluster_ strid - 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.
Ali Cloud. Polar DB. Inputs. Get Databases Database Account Args> A list of accounts of database. Each element contains the following attributes.
- Character
Set stringName The character set name of database.
- Db
Description string Database description.
- Db
Name string Database name.
- Db
Status string The status of database.
- Engine string
The engine of database.
- Accounts
[]Get
Databases Database Account A list of accounts of database. Each element contains the following attributes.
- Character
Set stringName The character set name of database.
- Db
Description string Database description.
- Db
Name string Database name.
- Db
Status string The status of database.
- Engine string
The engine of database.
- accounts
Get
Databases Database Account[] A list of accounts of database. Each element contains the following attributes.
- character
Set stringName The character set name of database.
- db
Description string Database description.
- db
Name string Database name.
- db
Status string The status of database.
- engine string
The engine of database.
- accounts
List[Get
Databases Database Account] A list of accounts of database. Each element contains the following attributes.
- character_
set_ strname The character set name of database.
- db
Status 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.
- Account
Name string Account name.
- Account
Status string Account status.
- Privilege
Status string The privilege status of account.
- Account
Name string Account name.
- Account
Status string Account status.
- Privilege
Status string The privilege status of account.
- account
Name string Account name.
- account
Status string Account status.
- privilege
Status string The privilege status of account.
- account
Status str Account status.
- account_
name str Account name.
- privilege
Status 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
alicloudTerraform Provider.