ALIYUN::RDS::DBProxy

ALIYUN::RDS::DBProxy类型用于开启RDS实例的数据库代理实例功能。

语法

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

属性

属性名称

类型

必须

允许更新

描述

约束

DBInstanceId

String

数据库实例 ID。

VPCId

String

实例所属 VPC ID。

VSwitchId

String

实例所属虚拟交换机 ID。

说明

RDS MySQL 云盘版或 RDS PostgreSQL 开启数据库代理时,该参数必选。

DBProxyInstanceNum

Integer

开通代理实例数量。

取值:1~16。默认值:1

DBProxyNodes

List

代理节点列表。

更多信息,请参见DBProxyNodes属性

DBProxyInstanceType

String

数据库代理实例类型。

取值:

  • common:通用型代理

  • exclusive:独享型代理(默认值)

PersistentConnectionStatus

String

是否开启连接保持。

取值:

  • Enabled:开启连接保持

  • Disabled:关闭连接保持

说明
  • 仅 RDS MySQL 支持此参数。

  • 修改连接保持状态时,ConfigDBProxyService 取值为 Modify

ResourceGroupId

String

资源组 ID。

DBProxyNodes语法

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

DBProxyNodes属性

属性名称

类型

必须

允许更新

描述

约束

CpuCores

Integer

节点 CPU 核数。

取值 1~16

NodeCounts

Integer

可用区中代理节点数量。

取值 1~2

ZoneId

String

节点所在的可用区 ID。

返回值

Fn::GetAtt

示例

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