All Products
Search
Document Center

Resource Orchestration Service:DATASOURCE::RDS::DBInstances

最終更新日:Dec 06, 2024

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,
    "RefreshOptions": String
  }
}

Properties

Property

Type

Required

Editable

Description

Constraint

DedicatedHostId

String

No

Yes

The ID of the host in the dedicated cluster.

None.

EngineVersion

String

No

Yes

The version of the database engine.

None.

DBInstanceStatus

String

No

Yes

The status of the instance.

For more information, see Instance state table.

ResourceGroupId

String

No

Yes

The ID of the resource group.

None.

ZoneId

String

No

Yes

The zone ID.

None.

DBInstanceClass

String

No

Yes

The instance type.

For more information, see Primary ApsaraDB RDS instance types.

DedicatedHostGroupId

String

No

Yes

The ID of the dedicated cluster.

None.

VSwitchId

String

No

Yes

The vSwitch ID.

None.

DBInstanceType

String

No

Yes

The category of the instance.

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 edition of the instance.

Valid values:

  • 0: does not return the edition of the instance.

  • 1: returns the edition of the instance.

Expired

String

No

Yes

Specifies whether the instance has expired.

Valid values:

  • true

  • false

PayType

String

No

Yes

The billing method.

Valid values:

  • Postpaid: pay-as-you-go

  • Prepaid: subscription

InstanceNetworkType

String

No

Yes

The network type of the instance.

Valid values:

  • VPC

  • Classic

VpcId

String

No

Yes

The ID of the virtual private cloud (VPC).

None.

DBInstanceId

String

No

Yes

The instance ID.

None.

SearchKey

String

No

Yes

The keyword of instance IDs or descriptions, which is used to perform fuzzy searches for instances.

None.

ConnectionMode

String

No

Yes

The connection mode of the instance.

Valid values:

  • Standard: standard mode

  • Safe: database proxy mode

ConnectionString

String

No

Yes

The endpoint of the instance.

None.

Engine

String

No

Yes

The type of the database engine.

Valid values:

  • MySQL

  • SQLServer

  • PostgreSQL

  • MariaDB

proxyId

String

No

Yes

The ID of the proxy mode.

None.

RefreshOptions

String

No

Yes

The refresh policy for data source resources when the stack is updated.

Valid values:

  • Never (default): does not refresh data source resources when the stack is updated.

  • Always: refreshes data source resources when the stack is updated.

Return values (Fn::GetAtt)

  • DBInstanceIds: the IDs of the instances.

  • DBInstances: details of the instances.

Property

Type

Description

Constraint

DBInstanceIds

List

The IDs of the instances.

None.

DBInstances

List

Details of the instances.

None.

VpcId

String

The VPC ID.

None.

CreateTime

String

The creation time.

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 VPC name.

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 value of null indicates that the instance is a primary instance.

ExpireTime

String

The expiration time.

The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.

Note

This property is not returned for pay-as-you-go instances.

GuardDBInstanceId

String

The ID of the disaster recovery instance.

None.

ZoneId

String

The zone ID.

None.

DBInstanceId

String

The instance ID.

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: database proxy mode

DBInstanceDescription

String

The description of the instance.

None.

DBInstanceNetType

String

The network connection type of the instance.

Valid values:

  • Internet

  • Intranet

DBInstanceType

String

The category 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 vSwitch ID.

None.

ResourceGroupId

String

The ID of the resource group.

None.

Category

String

The edition of the instance.

Valid values:

  • Basic: RDS Basic Edition

  • HighAvailability: RDS High-availability Edition

  • Finance: RDS Enterprise Edition

Note

This property is returned if InstanceLevel is set to 1.

Engine

String

The type of the database engine.

Valid values:

  • MySQL

  • SQLServer

  • PostgreSQL

  • MariaDB

DBInstanceClass

String

The instance type.

For more information, see Primary ApsaraDB RDS instance types.

ReadOnlyDBInstanceIds

List

The IDs of the read-only instances.

None.

DeletionProtection

Boolean

Indicates whether the release protection feature is enabled.

Valid values:

  • true

  • false

Examples

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