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:
- Db
Cluster stringId The polarDB cluster ID.
- Name
Regex string A regex string to filter results by account name.
- Db
Cluster stringId The polarDB cluster ID.
- Name
Regex string A regex string to filter results by account name.
- db
Cluster stringId The polarDB cluster ID.
- name
Regex string A regex string to filter results by account name.
- db_
cluster_ strid 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.
Ali Cloud. Polar DB. Outputs. Get Accounts Account> A list of PolarDB cluster accounts. Each element contains the following attributes:
- Db
Cluster stringId - Id string
The provider-assigned unique ID for this managed resource.
- Names List<string>
Account name of the cluster.
- Name
Regex string
- Accounts
[]Get
Accounts Account A list of PolarDB cluster accounts. Each element contains the following attributes:
- Db
Cluster stringId - Id string
The provider-assigned unique ID for this managed resource.
- Names []string
Account name of the cluster.
- Name
Regex string
- accounts
Get
Accounts Account[] A list of PolarDB cluster accounts. Each element contains the following attributes:
- db
Cluster stringId - id string
The provider-assigned unique ID for this managed resource.
- names string[]
Account name of the cluster.
- name
Regex string
- accounts
List[Get
Accounts Account] A list of PolarDB cluster accounts. Each element contains the following attributes:
- db_
cluster_ strid - 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.
- Account
Description string Account description.
- Account
Lock stringState Account lock state, Valid values are
Lock,UnLock.- Account
Name string Account name.
- Account
Status string Cluster address type.
Cluster: the default address of the Cluster.Primary: Primary address.Custom: Custom cluster addresses.- Account
Type string Account type, Valid values are
Normal,Super.- Database
Privileges List<Pulumi.Ali Cloud. Polar DB. Inputs. Get Accounts Account Database Privilege Args> A list of database privilege. Each element contains the following attributes.
- Account
Description string Account description.
- Account
Lock stringState Account lock state, Valid values are
Lock,UnLock.- Account
Name string Account name.
- Account
Status string Cluster address type.
Cluster: the default address of the Cluster.Primary: Primary address.Custom: Custom cluster addresses.- Account
Type string Account type, Valid values are
Normal,Super.- Database
Privileges []GetAccounts Account Database Privilege A list of database privilege. Each element contains the following attributes.
- account
Description string Account description.
- account
Lock stringState Account lock state, Valid values are
Lock,UnLock.- account
Name string Account name.
- account
Status string Cluster address type.
Cluster: the default address of the Cluster.Primary: Primary address.Custom: Custom cluster addresses.- account
Type string Account type, Valid values are
Normal,Super.- database
Privileges GetAccounts Account Database Privilege[] A list of database privilege. Each element contains the following attributes.
- account
Lock strState Account lock state, Valid values are
Lock,UnLock.- account
Status 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.- database
Privileges List[GetAccounts Account Database Privilege] 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.
- Account
Privilege string Account privilege of database
- Db
Name string The account owned database name
- Account
Privilege string Account privilege of database
- Db
Name string The account owned database name
- account
Privilege string Account privilege of database
- db
Name 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
alicloudTerraform Provider.