All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::RDS::DBProxy

Last Updated:Apr 18, 2025

ALIYUN::RDS::DBProxy is used to enable the database proxy feature for an ApsaraDB RDS instance.

Syntax

{
  "Type": "ALIYUN::RDS::DBProxy",
  "Properties": {
    "DBInstanceId": String,
    "VPCId": String,
    "VSwitchId": String,
    "DBProxyInstanceNum": Integer,
    "DBProxyNodes": List,
    "DBProxyInstanceType": String,
    "PersistentConnectionStatus": String,
    "ResourceGroupId": String
  }
}

Properties

Property

Type

Required

Editable

Description

Constraint

DBInstanceId

String

Yes

No

The ID of the instance.

None.

VPCId

String

Yes

No

The virtual private cloud (VPC) ID of the instance.

None.

VSwitchId

String

Yes

No

The vSwitch ID of the instance.

Note

This property must be specified when you enable the database proxy feature for ApsaraDB RDS for MySQL instances that use cloud disks or ApsaraDB RDS for PostgreSQL instances.

DBProxyInstanceNum

Integer

No

No

The number of database proxies to be enabled for the instance.

Valid values: 1 to 16. Default value: 1.

DBProxyNodes

List

No

No

The proxy nodes.

For more information, see DBProxyNodes properties.

DBProxyInstanceType

String

No

No

The type of the database proxy.

Valid values:

  • common: general-purpose database proxy.

  • exclusive (default): dedicated database proxy.

PersistentConnectionStatus

String

No

No

Specifies whether to enable persistent connections.

Valid values:

  • Enabled

  • Disabled

Note
  • This property is supported only for ApsaraDB RDS for MySQL instances.

  • You must set ConfigDBProxyService to Modify when you modify the persistent connection status.

ResourceGroupId

String

No

No

The ID of the resource group.

None.

DBProxyNodes syntax

"DBProxyNodes": [
  {
    "ZoneId": String,
    "CpuCores": Integer,
    "NodeCounts": Integer
  }
]

DBProxyNodes properties

Property

Type

Required

Editable

Description

Constraint

CpuCores

Integer

Yes

No

The number of vCPUs of the proxy node.

Valid values: 1 to 16.

NodeCounts

Integer

Yes

No

The number of proxy nodes in the zone.

Valid values: 1 to 2.

ZoneId

String

Yes

No

The zone ID of the proxy node.

None.

Return values

Fn::GetAtt

None.

Examples

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  DBInstanceId:
    Type: String
    AssociationProperty: ALIYUN::RDS::Instance::InstanceId
    Description:
      en: Instance ID of the DB. DescribeDBInstances can be called to get it.
    Required: true
  VPCId:
    Type: String
    AssociationProperty: ALIYUN::ECS::VPC::VPCId
    Description:
      en: The VPC ID to which the instance belongs.
    Required: true
  VSwitchId:
    AssociationPropertyMetadata:
      VpcId: ${VpcId}
      ZoneId: ${ZoneId}
    AssociationProperty: ALIYUN::VPC::VSwitch::VSwitchId
    Type: String
    Description:
      en: The virtual switch ID to which the instance belongs.
    Required: true
Resources:
  DBProxy:
    Type: ALIYUN::RDS::DBProxy
    Properties:
      DBInstanceId:
        Ref: DBInstanceId
      VPCId:
        Ref: VPCId
      VSwitchId:
        Ref: VSwitchId
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "DBInstanceId": {
      "Type": "String",
      "AssociationProperty": "ALIYUN::RDS::Instance::InstanceId",
      "Description": {
        "en": "Instance ID of the DB. DescribeDBInstances can be called to get it."
      },
      "Required": true
    },
    "VPCId": {
      "Type": "String",
      "AssociationProperty": "ALIYUN::ECS::VPC::VPCId",
      "Description": {
        "en": "The VPC ID to which the instance belongs."
      },
      "Required": true
    },
    "VSwitchId": {
      "AssociationPropertyMetadata": {
        "VpcId": "${VpcId}",
        "ZoneId": "${ZoneId}"
      },
      "AssociationProperty": "ALIYUN::VPC::VSwitch::VSwitchId",
      "Type": "String",
      "Description": {
        "en": "The virtual switch ID to which the instance belongs."
      },
      "Required": true
    }
  },
  "Resources": {
    "DBProxy": {
      "Type": "ALIYUN::RDS::DBProxy",
      "Properties": {
        "DBInstanceId": {
          "Ref": "DBInstanceId"
        },
        "VPCId": {
          "Ref": "VPCId"
        },
        "VSwitchId": {
          "Ref": "VSwitchId"
        }
      }
    }
  }
}