Authorizes an account to access a database on an ApsaraDB RDS instance.
If you create both ALIYUN::RDS::Database and ALIYUN::RDS::Account resources in a stack and use ALIYUN::RDS::AccountPrivilege to grant permissions, you must set the DependsOn property in ALIYUN::RDS::Database to the corresponding ALIYUN::RDS::Account resource.
Syntax
{
"Type": "ALIYUN::RDS::AccountPrivilege",
"Properties": {
"AccountPrivilege": String,
"DBInstanceId": String,
"DBName": String,
"AccountName": String
}
}
Properties
|
Property |
Type |
Required |
Editable |
Description |
Constraint |
|
AccountPrivilege |
String |
Yes |
Yes |
The permissions to grant to the account. |
The number of AccountPrivilege values must match the number of DBName values. Valid values:
Note
|
|
DBInstanceId |
String |
Yes |
No |
The ID of the ApsaraDB RDS instance. |
None. |
|
DBName |
String |
Yes |
No |
The name of the database to which you want to grant access. |
Separate multiple names with commas (,). |
|
AccountName |
String |
Yes |
No |
The account name. |
None. |
Return values
Fn::GetAtt
None.
Examples
YAML
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
DBInstanceId:
Type: String
AssociationProperty: ALIYUN::RDS::Instance::InstanceId
Resources:
AccountPrivilege:
Type: ALIYUN::RDS::AccountPrivilege
Properties:
AccountPrivilege: ReadOnly
DBInstanceId:
Ref: DBInstanceId
DBName: dev
AccountName: DBUser
Outputs: {}
JSON
{
"ROSTemplateFormatVersion": "2015-09-01",
"Parameters": {
"DBInstanceId": {
"Type": "String",
"AssociationProperty": "ALIYUN::RDS::Instance::InstanceId"
}
},
"Resources": {
"AccountPrivilege": {
"Type": "ALIYUN::RDS::AccountPrivilege",
"Properties": {
"AccountPrivilege": "ReadOnly",
"DBInstanceId": {
"Ref": "DBInstanceId"
},
"DBName": "dev",
"AccountName": "DBUser"
}
}
},
"Outputs": {}
}