DATASOURCE::RDS::Databases is used to query the information about databases on an ApsaraDB RDS instance.
Syntax
{
"Type": "DATASOURCE::RDS::Databases",
"Properties": {
"DBInstanceId": String,
"DBName": String,
"DBStatus": String,
"RefreshOptions": String
}
}
Properties
Property | Type | Required | Editable | Description | Constraint |
DBInstanceId | String | Yes | Yes | The instance ID. | None. |
DBName | String | No | Yes | The database name. | None. |
DBStatus | String | No | Yes | The status of the database. | Valid values:
|
RefreshOptions | String | No | Yes | The refresh policy for data source resources when the stack is updated. | Valid values:
|
Return values (Fn::GetAtt)
Databases: details of the databases.
DBNames: the names of the databases.
Property | Type | Description | Constraint |
DBNames | List | The names of the databases. | None. |
Databases | List | Details of the databases. | None. |
DBName | String | The database name. | None. |
DBInstanceId | String | The ID of the instance to which the database belongs. | None. |
Engine | String | The database engine of the instance. | None. |
DBStatus | String | The status of the database. | Valid values:
|
CharacterSetName | String | The character set. | None. |
DBDescription | String | The description of the database. | None. |
Accounts | Map | The accounts that have specific permissions on the database. | Example:
|
Examples
{
"ROSTemplateFormatVersion": "2015-09-01",
"Parameters": {
"DBInstanceId": {
"Type": "String",
"Description": "The ID of the RDS instance."
}
},
"Resources": {
"ExtensionDataSource": {
"Type": "DATASOURCE::RDS::Databases",
"Properties": {
"DBInstanceId": {
"Ref": "DBInstanceId"
}
}
}
},
"Outputs": {
"Databases": {
"Description": "The list of The RDS databases.",
"Value": {
"Fn::GetAtt": [
"ExtensionDataSource",
"Databases"
]
}
},
"DBNames": {
"Description": "The list of The RDS database names.",
"Value": {
"Fn::GetAtt": [
"ExtensionDataSource",
"DBNames"
]
}
}
}
}
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
DBInstanceId:
Type: String
Description: The ID of the RDS instance.
Resources:
ExtensionDataSource:
Type: DATASOURCE::RDS::Databases
Properties:
DBInstanceId:
Ref: DBInstanceId
Outputs:
Databases:
Description: The list of The RDS databases.
Value:
Fn::GetAtt:
- ExtensionDataSource
- Databases
DBNames:
Description: The list of The RDS database names.
Value:
Fn::GetAtt:
- ExtensionDataSource
- DBNames