ALIYUN::SELECTDB::DBInstance is used to create an ApsaraDB for SelectDB instance.
Syntax
{
"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
}
}Properties
Property | Type | Required | Editable | Description | Constraint |
CacheSize | Integer | Yes | No | The reserved cache size. | None. |
ChargeType | String | Yes | No | The billing method of the instance. | Valid values:
|
DBInstanceClass | String | Yes | No | The instance type. | Valid values:
|
EngineVersion | String | Yes | No | The version of the database engine. | Valid values:
|
VSwitchId | String | Yes | No | The ID of the vSwitch. | None. |
VpcId | String | Yes | No | The ID of the virtual private cloud (VPC). | None. |
ZoneId | String | Yes | No | The ID of the zone. | None. |
AccountPassword | String | No | No | The password of the database admin account. | The password must meet the following requirements:
|
ConnectionString | String | No | No | The endpoint that is used to connect to the database. | None. |
DBInstanceDescription | String | No | No | The description of the instance. | None. |
Engine | String | No | No | The type of the database engine. | Default value: selectdb. |
Period | String | No | No | The unit of the subscription duration of the cluster. | Valid values:
Note This property must be specified only when ChargeType is set to Prepaid. |
ResourceGroupId | String | No | No | The ID of the resource group. | None. |
SecurityIPList | List | No | No | The IP addresses in the IP address whitelist of the instance. | You can specify up to 1,000 IP addresses in the whitelist. |
Tags | List | No | No | The tags of the instance. | You can add up to 20 tags. For more information, see Tags properties. |
UsedTime | Integer | No | No | The subscription duration of the instance. | Valid values:
Note This property must be specified only when ChargeType is set to Prepaid. |
Tags syntax
"Tags": [
{
"Value": String,
"Key": String
}
]Tags properties
Property | Type | Required | Editable | Description | Constraint |
Key | String | Yes | No | The key of the tag. | None. |
Value | String | No | No | The value of the tag. | None. |
Return values
Fn::GetAtt
DBInstanceId: the ID of the instance.
VpcConnectionString: the VPC endpoint of the instance.
Examples
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"
]
}
}
}
}