DATASOURCE::RDS::Databases is used to query the details of databases in an ApsaraDB RDS instance.

Syntax

{
  "Type": "DATASOURCE::RDS::Databases",
  "Properties": {
    "DBInstanceId": String,
    "DBName": String,
    "DBStatus": String
  }
}

Properties

Property Type Required Editable Description Constraint
DBInstanceId String Yes Yes The ID of the instance. None.
DBName String No Yes The name of the database. None.
DBStatus String No Yes The status of the database. Valid values:
  • Creating: The database is being created.
  • Running: The database is in use.
  • Deleting: The database is being deleted.

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 name of the database. None.
DBInstanceId String The ID of the instance to which the database belongs. None.
Engine String The database engine of the instance to which the database belongs. None.
DBStatus String The status of the database. Valid values:
  • Creating: The database is being created.
  • Running: The database is in use.
  • Deleting: The database is being deleted.
CharacterSetName String The character set that is used by the database. None.
DBDescription String The description of the database. None.
Accounts Map The Alibaba Cloud accounts that have specific permissions on the database. Sample code:
{
    "Account": "Demo",
    "AccountPrivilege":"ReadOnly",
    "AccountPrivilegeDetail":"SELECT"
}

Examples

  • JSON format

    {
      "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"
            ]
          }
        }
      }
    }
  • YAML format

    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