GetAccounts

The alicloud.polardb.getAccounts data source provides a collection of PolarDB cluster database account available in Alibaba Cloud account. Filters support regular expression for the account 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.GetAccounts.InvokeAsync(new AliCloud.PolarDB.GetAccountsArgs
        {
            DbClusterId = polardbClustersDs.Clusters[0].Id,
        })));
        this.Ends = @default.Apply(@default => @default.Accounts[0].AccountName);
    }

    [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_accounts(db_cluster_id=polardb_clusters_ds.clusters[0]["id"])
pulumi.export("ends", default.accounts[0]["account_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.getAccounts({
    dbClusterId: polardbClustersDs.clusters[0].id,
}));
export const ends = _default.then(_default => _default.accounts[0].accountName);

Using GetAccounts

function getAccounts(args: GetAccountsArgs, opts?: InvokeOptions): Promise<GetAccountsResult>
function  get_accounts(db_cluster_id=None, name_regex=None, opts=None)
func GetAccounts(ctx *Context, args *GetAccountsArgs, opts ...InvokeOption) (*GetAccountsResult, error)
public static class GetAccounts {
    public static Task<GetAccountsResult> InvokeAsync(GetAccountsArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

DbClusterId string

The polarDB cluster ID.

NameRegex string

A regex string to filter results by account name.

DbClusterId string

The polarDB cluster ID.

NameRegex string

A regex string to filter results by account name.

dbClusterId string

The polarDB cluster ID.

nameRegex string

A regex string to filter results by account name.

db_cluster_id str

The polarDB cluster ID.

name_regex str

A regex string to filter results by account name.

GetAccounts Result

The following output properties are available:

Accounts List<Pulumi.AliCloud.PolarDB.Outputs.GetAccountsAccount>

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

DbClusterId string
Id string

The provider-assigned unique ID for this managed resource.

Names List<string>

Account name of the cluster.

NameRegex string
Accounts []GetAccountsAccount

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

DbClusterId string
Id string

The provider-assigned unique ID for this managed resource.

Names []string

Account name of the cluster.

NameRegex string
accounts GetAccountsAccount[]

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

dbClusterId string
id string

The provider-assigned unique ID for this managed resource.

names string[]

Account name of the cluster.

nameRegex string
accounts List[GetAccountsAccount]

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

db_cluster_id str
id str

The provider-assigned unique ID for this managed resource.

names List[str]

Account name of the cluster.

name_regex str

Supporting Types

GetAccountsAccount

See the output API doc for this type.

See the output API doc for this type.

See the output API doc for this type.

AccountDescription string

Account description.

AccountLockState string

Account lock state, Valid values are Lock, UnLock.

AccountName string

Account name.

AccountStatus string

Cluster address type.Cluster: the default address of the Cluster.Primary: Primary address.Custom: Custom cluster addresses.

AccountType string

Account type, Valid values are Normal, Super.

DatabasePrivileges List<Pulumi.AliCloud.PolarDB.Inputs.GetAccountsAccountDatabasePrivilegeArgs>

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

AccountDescription string

Account description.

AccountLockState string

Account lock state, Valid values are Lock, UnLock.

AccountName string

Account name.

AccountStatus string

Cluster address type.Cluster: the default address of the Cluster.Primary: Primary address.Custom: Custom cluster addresses.

AccountType string

Account type, Valid values are Normal, Super.

DatabasePrivileges []GetAccountsAccountDatabasePrivilege

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

accountDescription string

Account description.

accountLockState string

Account lock state, Valid values are Lock, UnLock.

accountName string

Account name.

accountStatus string

Cluster address type.Cluster: the default address of the Cluster.Primary: Primary address.Custom: Custom cluster addresses.

accountType string

Account type, Valid values are Normal, Super.

databasePrivileges GetAccountsAccountDatabasePrivilege[]

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

accountLockState str

Account lock state, Valid values are Lock, UnLock.

accountStatus str

Cluster address type.Cluster: the default address of the Cluster.Primary: Primary address.Custom: Custom cluster addresses.

account_description str

Account description.

account_name str

Account name.

account_type str

Account type, Valid values are Normal, Super.

databasePrivileges List[GetAccountsAccountDatabasePrivilege]

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

GetAccountsAccountDatabasePrivilege

See the output API doc for this type.

See the output API doc for this type.

See the output API doc for this type.

AccountPrivilege string

Account privilege of database

DbName string

The account owned database name

AccountPrivilege string

Account privilege of database

DbName string

The account owned database name

accountPrivilege string

Account privilege of database

dbName string

The account owned database name

account_privilege str

Account privilege of database

db_name str

The account owned database name

Package Details

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