文档

ALIYUN::POLARDB::DBInstance

更新时间:

ALIYUN::POLARDB::DBInstance类型用于在PolarDB集群下创建一个新的数据库。

语法

{
  "Type": "ALIYUN::POLARDB::DBInstance",
  "Properties": {
    "DBClusterId": String,
    "CharacterSetName": String,
    "DBDescription": String,
    "AccountName": String,
    "AccountPrivilege": String,
    "DBName": String,
    "Collate": String,
    "Ctype": String
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

DBClusterId

String

集群ID。

CharacterSetName

String

字符集。

取值信息,请参见字符集表

DBDescription

String

数据库描述信息。

长度为2~256个字符。不能以http://https://开头。

AccountName

String

账号名。

AccountPrivilege

String

账号权限。

取值:

  • ReadWrite(默认值) :读写。

  • ReadOnly:只读。

  • DMLOnly:只允许DML。

  • DDLOnly:只允许DDL。

DBName

String

数据库名。

长度不超过64个字符。必须以小写英文字母开头,以英文字母或数字结尾。可包含英文字母、数字、短划线(-)和下划线(_)。

Collate

String

语言环境设置。

用于指定新建数据库的排序规则。

说明
  • 语言环境必须与CharacterSetName参数设置的字符集兼容。

  • 当集群为PolarDB PostgreSQL版(兼容Oracle)或PolarDB PostgreSQL版时,该参数必填;当集群为PolarDB MySQL版时,不支持该参数。 更多信息,请参见CreateDatabase

Ctype

String

语言环境设置。

用于指定数据库的字符分类。

说明
  • 语言环境必须与CharacterSetName参数设置的字符集兼容。

  • 与Collate传入信息一致。

  • 当集群为PolarDB PostgreSQL版(兼容Oracle)或PolarDB PostgreSQL版时,该参数必填;当集群为PolarDB MySQL版时,该参数非必填。 更多信息,请参见CreateDatabase

返回值

Fn::GetAtt

示例

YAML格式

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  DBClusterId:
    Type: String
    Description: The ID of the ApsaraDB for POLARDB cluster for which a database is to be created.
Resources:
  DBInstance:
    Type: ALIYUN::POLARDB::DBInstance
    Properties:
      DBClusterId:
        Ref: DBClusterId
      CharacterSetName: utf8
      AccountName: TestAccountUser
      DBName: Test

JSON格式

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "DBClusterId": {
      "Type": "String",
      "Description": "The ID of the ApsaraDB for POLARDB cluster for which a database is to be created."
    }
  },
  "Resources": {
    "DBInstance": {
      "Type": "ALIYUN::POLARDB::DBInstance",
      "Properties": {
        "DBClusterId": {
          "Ref": "DBClusterId"
        },
        "CharacterSetName": "utf8",
        "AccountName": "TestAccountUser",
        "DBName": "Test"
      }
    }
  }
}
  • 本页导读 (1)
文档反馈