ALIYUN::RDS::AccountPrivilege is used to authorize an account to access a database.
If you create both ALIYUN::RDS::Database and ALIYUN::RDS::Account resources in a stack and use ALIYUN::RDS::AccountPrivilege to grant the required permissions, you must specify the DependsOn property in ALIYUN::RDS::Database and specify ALIYUN::RDS::Account in the property.
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 that you want to grant to the account. | The number of AccountPrivilege values must be the same as the number of DBName values. Valid values:
Note
|
DBInstanceId | String | Yes | No | The instance ID. | None. |
DBName | String | Yes | No | The name of the database on which you want to grant access permissions. | 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": {}
}