ALIYUN::DRDS::DrdsDB

ALIYUN::DRDS::DrdsDB类型用于创建PolarDB-X云原生分布式数据库

语法

{
  "Type": "ALIYUN::DRDS::DrdsDB",
  "Properties": {
    "DbInstType": String,
    "Type": String,
    "DrdsInstanceId": String,
    "RdsInstance": List,
    "DbInstanceIsCreating": Boolean,
    "InstDbName": List,
    "DbName": String,
    "Encode": String,
    "AccountName": String,
    "Password": String
  }
}

属性

属性名称类型必须允许更新描述约束
DbInstTypeString挂载的存储类型。取值:
  • RDS
  • POLARDB
TypeString库的拆分方式。取值:
  • HORIZONTAL:水平拆分,即分库分表方式。
  • VERTICAL:垂直拆分。

更多信息,请参见扩展性原理

DrdsInstanceIdStringPolarDB-X实例ID。
RdsInstanceListRDS实例ID。仅在水平拆分时使用。

最多支持5个RDS实例。

DbInstanceIsCreatingBoolean建库所涉及的RDS是否正在创建中。取值:
  • true
  • false
InstDbNameList垂直拆分时RDS实例ID和数据库列表。最多支持5个RDS实例。

更多信息,请参见InstDbName属性

DbNameString数据库名称。
EncodeString数据库所用编码。
AccountNameString垂直拆分场景下,拥有所有RDS相应数据库访问权限的账号名称。仅在垂直拆分时使用。
PasswordString数据库访问密码。

InstDbName语法

"InstDbName": [
  {
    "ShardDbName": List,
    "DbInstanceId": String
  }
]

InstDbName属性

属性名称类型必须允许更新描述约束
ShardDbNameListRDS实例中需要垂直拆分的数据库列表。最多支持5个数据库。
DbInstanceIdString需要垂直拆分的RDS实例ID。

返回值

Fn::GetAtt

示例

JSON格式

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "DbInstType": {
      "Type": "String",
      "Description": "The type of the attached storage. Valid values:\nRDS or POLARDB",
      "AllowedValues": [
        "RDS",
        "POLARDB"
      ]
    },
    "Type": {
      "Type": "String",
      "Description": "Database Sharding method. For more information, see scalability principle. Valid values:\nHORIZONTAL: indicates HORIZONTAL partitioning, which is commonly known as database\nand table sharding.\nVERTICAL: indicates VERTICAL partitioning.",
      "AllowedValues": [
        "HORIZONTAL",
        "VERTICAL"
      ],
      "Default": "HORIZONTAL"
    },
    "DrdsInstanceId": {
      "Type": "String",
      "Description": "DRDS instance ID"
    },
    "RdsInstance": {
      "Type": "Json",
      "Description": "This property is required only for vertical partitioning.",
      "MinLength": 1,
      "MaxLength": 5
    },
    "DbInstanceIsCreating": {
      "Type": "Boolean",
      "Description": "Check whether the RDS instance is being created.",
      "AllowedValues": [
        "True",
        "true",
        "False",
        "false"
      ]
    },
    "InstDbName": {
      "Type": "Json",
      "Description": "",
      "MinLength": 1,
      "MaxLength": 5
    },
    "DbName": {
      "Type": "String",
      "Description": "Database Name"
    },
    "Encode": {
      "Type": "String",
      "Description": "Encoding used by the database"
    },
    "AccountName": {
      "Type": "String",
      "Description": "In the vertical split scenario, an account name with access rights to the corresponding database on all RDSs."
    },
    "Password": {
      "Type": "String",
      "Description": "The logon password of the database instance."
    }
  },
  "Resources": {
    "DrdsDB": {
      "Type": "ALIYUN::DRDS::DrdsDB",
      "Properties": {
        "DbInstType": {
          "Ref": "DbInstType"
        },
        "Type": {
          "Ref": "Type"
        },
        "DrdsInstanceId": {
          "Ref": "DrdsInstanceId"
        },
        "RdsInstance": {
          "Ref": "RdsInstance"
        },
        "DbInstanceIsCreating": {
          "Ref": "DbInstanceIsCreating"
        },
        "InstDbName": {
          "Ref": "InstDbName"
        },
        "DbName": {
          "Ref": "DbName"
        },
        "Encode": {
          "Ref": "Encode"
        },
        "AccountName": {
          "Ref": "AccountName"
        },
        "Password": {
          "Ref": "Password"
        }
      }
    }
  }
}

YAML格式

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
 DbInstType:
  Type: String
  Description: |-
   The type of the attached storage. Valid values:
   RDS or POLARDB
  AllowedValues:
   - RDS
   - POLARDB
 Type:
  Type: String
  Description: >-
   Database Sharding method. For more information, see scalability principle.
   Valid values:

   HORIZONTAL: indicates HORIZONTAL partitioning, which is commonly known as
   database

   and table sharding.

   VERTICAL: indicates VERTICAL partitioning.
  AllowedValues:
   - HORIZONTAL
   - VERTICAL
  Default: HORIZONTAL
 DrdsInstanceId:
  Type: String
  Description: DRDS instance ID
 RdsInstance:
  Type: Json
  Description: This property is required only for vertical partitioning.
  MinLength: 1
  MaxLength: 5
 DbInstanceIsCreating:
  Type: Boolean
  Description: Check whether the RDS instance is being created.
  AllowedValues:
   - 'True'
   - 'true'
   - 'False'
   - 'false'
 InstDbName:
  Type: Json
  Description: ''
  MinLength: 1
  MaxLength: 5
 DbName:
  Type: String
  Description: Database Name
 Encode:
  Type: String
  Description: Encoding used by the database
 AccountName:
  Type: String
  Description: >-
   In the vertical split scenario, an account name with access rights to the
   corresponding database on all RDSs.
 Password:
  Type: String
  Description: The logon password of the database instance.
Resources:
 DrdsDB:
  Type: 'ALIYUN::DRDS::DrdsDB'
  Properties:
   DbInstType:
    Ref: DbInstType
   Type:
    Ref: Type
   DrdsInstanceId:
    Ref: DrdsInstanceId
   RdsInstance:
    Ref: RdsInstance
   DbInstanceIsCreating:
    Ref: DbInstanceIsCreating
   InstDbName:
    Ref: InstDbName
   DbName:
    Ref: DbName
   Encode:
    Ref: Encode
   AccountName:
    Ref: AccountName
   Password:
    Ref: Password