DATASOURCE::REDIS::Accounts is used to query one or all accounts in an ApsaraDB for
Redis instance.
Syntax
{
"Type": "DATASOURCE::REDIS::Accounts",
"Properties": {
"InstanceId": String,
"AccountName": String
}
}
Properties
Property |
Type |
Required |
Editable |
Description |
Constraint |
InstanceId |
String |
Yes |
Yes |
The ID of the instance. |
None. |
AccountName |
String |
No |
Yes |
The name of the account that you want to query. |
None. |
Return values (Fn::GetAtt)
- AccountNames: the names of the accounts.
- Accounts: details of the accounts.
Parameter |
Type |
Description |
Constraint |
AccountNames |
List |
The names of the accounts. |
None. |
Accounts |
List |
Details of the accounts. |
None. |
AccountStatus |
String |
The state of the account. |
Valid values:
|
AccountDescription |
String |
The description of the account. |
None. |
InstanceId |
String |
The ID of the instance. |
None. |
AccountType |
String |
The type of the account. |
Valid values:
- Normal: standard account
- Super: superuser account
|
AccountName |
String |
The name of the account. |
None. |
DatabasePrivileges |
List |
The permissions of the account. |
Example:[ {
"AccountPrivilege" : "RoleReadWrite"
} ]
|
Examples
-
JSON
format
{
"ROSTemplateFormatVersion": "2015-09-01",
"Parameters": {
"InstanceId": {
"Type": "String",
"Description": "The ID of the Redis instance."
}
},
"Resources": {
"ExtensionDataSource": {
"Type": "DATASOURCE::REDIS::Accounts",
"Properties": {
"InstanceId": {
"Ref": "InstanceId"
}
}
}
},
"Outputs": {
"AccountNames": {
"Description": "The list of The Redis account names.",
"Value": {
"Fn::GetAtt": [
"ExtensionDataSource",
"AccountNames"
]
}
},
"Accounts": {
"Description": "The list of The Redis accounts.",
"Value": {
"Fn::GetAtt": [
"ExtensionDataSource",
"Accounts"
]
}
}
}
}
-
YAML
format
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
InstanceId:
Type: String
Description: The ID of the Redis instance.
Resources:
ExtensionDataSource:
Type: DATASOURCE::REDIS::Accounts
Properties:
InstanceId:
Ref: InstanceId
Outputs:
AccountNames:
Description: The list of The Redis account names.
Value:
Fn::GetAtt:
- ExtensionDataSource
- AccountNames
Accounts:
Description: The list of The Redis accounts.
Value:
Fn::GetAtt:
- ExtensionDataSource
- Accounts