ALIYUN::SELECTDB::DBInstance类型用于创建一个云数据库SelectDB版实例。
语法
{
"Type": "ALIYUN::SELECTDB::DBInstance",
"Properties": {
"CacheSize": Integer,
"ChargeType": String,
"DBInstanceClass": String,
"EngineVersion": String,
"VSwitchId": String,
"VpcId": String,
"ZoneId": String,
"AccountPassword": String,
"ConnectionString": String,
"DBInstanceDescription": String,
"Engine": String,
"Period": String,
"ResourceGroupId": String,
"SecurityIPList": List,
"Tags": List,
"UsedTime": Integer
}
}
属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
CacheSize | Integer | 是 | 否 | 预留缓存大小。 | 无。 |
ChargeType | String | 是 | 否 | 实例的付费类型。 | 取值:
|
DBInstanceClass | String | 是 | 否 | 实例计算资源。 | 取值说明:
|
EngineVersion | String | 是 | 否 | 数据库版本。 | 取值:
|
VSwitchId | String | 是 | 否 | 交换机 ID。 | 无 |
VpcId | String | 是 | 否 | 专有网络 ID。 | 无 |
ZoneId | String | 是 | 否 | 可用区 ID。 | 无 |
AccountPassword | String | 否 | 否 | 数据库admin账号的密码。 | 取值说明:
|
ConnectionString | String | 否 | 否 | 数据库连接地址。 | 无 |
DBInstanceDescription | String | 否 | 否 | 实例备注信息。 | 无 |
Engine | String | 否 | 否 | 数据库类型。 | 默认值为 selectdb。 |
Period | String | 否 | 否 | 指定预付费集群为包年或包月类型。 | 取值说明:
说明 仅当 ChargeType 为 Prepaid 时,该参数才生效且为必填参数。 |
ResourceGroupId | String | 否 | 否 | 资源组 ID。 | 无 |
SecurityIPList | List | 否 | 否 | 实例的 IP 白名单列表。 | 最多支持配置1000个白名单。 |
Tags | List | 否 | 否 | 实例标签列表信息。 | 最多支持配置20个标签信息,更多信息,请参考Tags属性。 |
UsedTime | Integer | 否 | 否 | 指定预付费实例的购买时长。 | 取值说明:
说明 仅当 ChargeType 为 Prepaid 时,该参数才生效且为必填参数。 |
Tags语法
"Tags": [
{
"Value": String,
"Key": String
}
]
Tags属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
Key | String | 是 | 否 | 标签键。 | 无 |
Value | String | 否 | 否 | 标签值。 | 无 |
返回值
Fn::GetAtt
DBInstanceId:数据库实例 ID。
VpcConnectionString:SelectDB 实例的 VPC 连接地址。
示例
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
EngineVersion:
Type: String
Description:
en: Database version.
AllowedValues:
- '3.0'
- '4.0'
Required: true
ZoneId:
AssociationProperty: ZoneId
Type: String
Description:
en: Availability Zone ID.
Required: true
DBInstanceClass:
Type: String
Description:
en: |-
The class of the DB instance.
Call DescribeAllDBInstanceClass API to check the latest class list
Required: true
VSwitchId:
AssociationPropertyMetadata:
VpcId: ${VpcId}
ZoneId: ${ZoneId}
AssociationProperty: ALIYUN::VPC::VSwitch::VSwitchId
Type: String
Description:
en: Switch ID.
Required: true
CacheSize:
Type: Number
Description:
en: Reserve cache size.
Required: true
MinValue: 100
MaxValue: 4000
VpcId:
AssociationProperty: ALIYUN::ECS::VPC::VPCId
Type: String
Description:
en: VPC id.
Required: true
ChargeType:
Type: String
Description:
en: |-
The paid type of instance.Value:
Postpaid: Postpaid (pay per quantity).
Prepaid: Prepaid (year and monthly).
AllowedValues:
- Postpaid
- Prepaid
Required: true
Resources:
DBInstance:
Type: ALIYUN::SELECTDB::DBInstance
Properties:
EngineVersion:
Ref: EngineVersion
ZoneId:
Ref: ZoneId
DBInstanceClass:
Ref: DBInstanceClass
VSwitchId:
Ref: VSwitchId
CacheSize:
Ref: CacheSize
VpcId:
Ref: VpcId
ChargeType:
Ref: ChargeType
Outputs:
DBInstanceId:
Description: Instance ID.
Value:
Fn::GetAtt:
- DBInstance
- DBInstanceId
{
"ROSTemplateFormatVersion": "2015-09-01",
"Parameters": {
"EngineVersion": {
"Type": "String",
"Description": {
"en": "Database version."
},
"AllowedValues": [
"3.0",
"4.0"
],
"Required": true
},
"ZoneId": {
"AssociationProperty": "ZoneId",
"Type": "String",
"Description": {
"en": "Availability Zone ID."
},
"Required": true
},
"DBInstanceClass": {
"Type": "String",
"Description": {
"en": "The class of the DB instance.\nCall DescribeAllDBInstanceClass API to check the latest class list"
},
"Required": true
},
"VSwitchId": {
"AssociationPropertyMetadata": {
"VpcId": "${VpcId}",
"ZoneId": "${ZoneId}"
},
"AssociationProperty": "ALIYUN::VPC::VSwitch::VSwitchId",
"Type": "String",
"Description": {
"en": "Switch ID."
},
"Required": true
},
"CacheSize": {
"Type": "Number",
"Description": {
"en": "Reserve cache size."
},
"Required": true,
"MinValue": 100,
"MaxValue": 4000
},
"VpcId": {
"AssociationProperty": "ALIYUN::ECS::VPC::VPCId",
"Type": "String",
"Description": {
"en": "VPC id."
},
"Required": true
},
"ChargeType": {
"Type": "String",
"Description": {
"en": "The paid type of instance.Value:\nPostpaid: Postpaid (pay per quantity).\nPrepaid: Prepaid (year and monthly)."
},
"AllowedValues": [
"Postpaid",
"Prepaid"
],
"Required": true
}
},
"Resources": {
"DBInstance": {
"Type": "ALIYUN::SELECTDB::DBInstance",
"Properties": {
"EngineVersion": {
"Ref": "EngineVersion"
},
"ZoneId": {
"Ref": "ZoneId"
},
"DBInstanceClass": {
"Ref": "DBInstanceClass"
},
"VSwitchId": {
"Ref": "VSwitchId"
},
"CacheSize": {
"Ref": "CacheSize"
},
"VpcId": {
"Ref": "VpcId"
},
"ChargeType": {
"Ref": "ChargeType"
}
}
}
},
"Outputs": {
"DBInstanceId": {
"Description": "Instance ID.",
"Value": {
"Fn::GetAtt": [
"DBInstance",
"DBInstanceId"
]
}
}
}
}