DATASOURCE::RDS::DBInstances is used to query ApsaraDB RDS instances.

Syntax

{
  "Type": "DATASOURCE::RDS::DBInstances",
  "Properties": {
    "DedicatedHostId": String,
    "EngineVersion": String,
    "DBInstanceStatus": String,
    "ResourceGroupId": String,
    "ZoneId": String,
    "DBInstanceClass": String,
    "DedicatedHostGroupId": String,
    "VSwitchId": String,
    "DBInstanceType": String,
    "InstanceLevel": Number,
    "Expired": String,
    "PayType": String,
    "InstanceNetworkType": String,
    "VpcId": String,
    "DBInstanceId": String,
    "SearchKey": String,
    "ConnectionMode": String,
    "ConnectionString": String,
    "Engine": String,
    "proxyId": String
  }
}

Properties

Property Type Required Editable Description Constraint
DedicatedHostId String No Yes The ID of the host on which the instances reside in the specified dedicated cluster. None.
EngineVersion String No Yes The database engine version of the instances. None.
DBInstanceStatus String No Yes The state of the instances. For more information, see Instance state table.
ResourceGroupId String No Yes The ID of the resource group to which the instances belong. None.
ZoneId String No Yes The ID of the zone. None.
DBInstanceClass String No Yes The specifications of the instances. For more information, see Primary ApsaraDB RDS instance types.
DedicatedHostGroupId String No Yes The ID of the dedicated cluster to which the instances belong. None.
VSwitchId String No Yes The ID of the vSwitch. None.
DBInstanceType String No Yes The category of the instances. Valid values:
  • Primary: primary instance
  • Readonly: read-only instance
  • Guard: disaster recovery instance
  • Temp: temporary instance
InstanceLevel Number No Yes Specifies whether to return the Category property. The value of the Category property indicates the edition of an instance. Valid values:
  • 0: does not return the Category property.
  • 1: returns the Category property.
Expired String No Yes Specifies whether to query expired instances. Valid values:
  • true: queries expired instances.
  • false: queries instances that have not expired.
PayType String No Yes The billing method of the instances. Valid values:
  • Postpaid: pay-as-you-go
  • Prepaid: subscription
InstanceNetworkType String No Yes The network type of the instances. Valid values:
  • VPC: virtual private cloud (VPC)
  • Classic: classic network
VpcId String No Yes The ID of the VPC in which the instances reside. None.
DBInstanceId String No Yes The ID of the instance. None.
SearchKey String No Yes The keyword that is contained in the IDs or descriptions of the instances. None.
ConnectionMode String No Yes The connection mode of the instances. Valid values:
  • Standard: standard mode
  • Safe: proxy mode
ConnectionString String No Yes The endpoint of the instance. None.
Engine String No Yes The database engine. Valid values:
  • MySQL
  • SQLServer
  • PostgreSQL
  • MariaDB
proxyId String No Yes The ID of the proxy mode. None.

Response parameters (Fn::GetAtt)

  • DBInstanceIds: the IDs of the ApsaraDB RDS instances.
  • DBInstances: details of the ApsaraDB RDS instances.
Parameter Type Description Constraint
DBInstanceIds List The IDs of the ApsaraDB RDS instances. None.
DBInstances List Details of the ApsaraDB RDS instances. None.
VpcId String The ID of the VPC. None.
CreateTime String The time when the ApsaraDB RDS instance was created. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.
PayType String The billing method of the instance. Valid values:
  • Postpaid: pay-as-you-go
  • Prepaid: subscription
EngineVersion String The version of the database engine. None.
VpcName String The name of the VPC. None.
ConnectionString String The endpoint of the instance. None.
InstanceNetworkType String The network type of the instance. Valid values:
  • Classic
  • VPC
MasterInstanceId String The ID of the primary instance. A null value for this property indicates that the instance is a primary instance.
ExpireTime String The time when the instance expires. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.
Note Pay-as-you-go instances never expire.
GuardDBInstanceId String The ID of the disaster recovery instance. None.
ZoneId String The ID of the zone. None.
DBInstanceId String The ID of the instance. None.
TempDBInstanceId String The ID of the temporary instance. None.
DBInstanceStorageType String The storage type of the instance. None.
ConnectionMode String The connection mode of the instance. Valid values:
  • Standard: standard mode
  • Safe: proxy mode
DBInstanceDescription String The description of the instance. None.
DBInstanceNetType String The type of network connection to the instance. Valid values:
  • Internet
  • Intranet
DBInstanceType String The type of the instance. Valid values:
  • Primary: primary instance
  • Readonly: read-only instance
  • Guard: disaster recovery instance
  • Temp: temporary instance
DBInstanceStatus String The status of the instance. For more information, see Instance state table.
VSwitchId String The ID of the vSwitch. None.
ResourceGroupId String The ID of the resource group. None.
Category String The edition of the instance. Valid values:
  • Basic: Basic Edition
  • HighAvailability: High-availability Edition
  • Finance: Enterprise Edition
Note If you set the InstanceLevel property to 1, this property is returned.
Engine String The database engine. Valid values:
  • MySQL
  • SQLServer
  • PostgreSQL
  • MariaDB
DBInstanceClass String The instance class. For more information, see Primary ApsaraDB RDS instance types.
ReadOnlyDBInstanceIds List The IDs of read-only instances. None.
DeletionProtection Boolean Indicates whether the release protection feature is enabled for the instance. Valid values:
  • true
  • false

Example

  • JSON format

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
        "DBInstanceId": {
          "Type": "String",
          "Description": "The ID of the instance."
        }
      },
      "Resources": {
        "ExtensionDataSource": {
          "Type": "DATASOURCE::RDS::DBInstances",
          "Properties": {
            "DBInstanceId": {
              "Ref": "DBInstanceId"
            }
          }
        }
      },
      "Outputs": {
        "DBInstances": {
          "Description": "The list of The RDS Database instances.",
          "Value": {
            "Fn::GetAtt": [
              "ExtensionDataSource",
              "DBInstances"
            ]
          }
        },
        "DBInstanceIds": {
          "Description": "The list of The RDS Database instance Ids.",
          "Value": {
            "Fn::GetAtt": [
              "ExtensionDataSource",
              "DBInstanceIds"
            ]
          }
        }
      }
    }
  • YAML format

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters:
      DBInstanceId:
        Type: String
        Description: The ID of the instance.
    Resources:
      ExtensionDataSource:
        Type: DATASOURCE::RDS::DBInstances
        Properties:
          DBInstanceId:
            Ref: DBInstanceId
    Outputs:
      DBInstances:
        Description: The list of The RDS Database instances.
        Value:
          Fn::GetAtt:
            - ExtensionDataSource
            - DBInstances
      DBInstanceIds:
        Description: The list of The RDS Database instance Ids.
        Value:
          Fn::GetAtt:
            - ExtensionDataSource
            - DBInstanceIds