ALIYUN::RDS::DBInstance is used to create an ApsaraDB RDS instance.
Syntax
{
"Type": "ALIYUN::RDS::DBInstance",
"Properties": {
"PeriodType": String,
"Category": String,
"PrivateIpAddress": String,
"ResourceGroupId": String,
"TargetDedicatedHostIdForSlave": String,
"DBInstanceNetType": String,
"DBTimeZone": String,
"DedicatedHostGroupId": String,
"EncryptionKey": String,
"PreferredBackupPeriod": List,
"SecurityIPList": String,
"SecurityGroupId": String,
"DBIsIgnoreCase": Integer,
"DBInstanceStorage": Integer,
"DBMappings": List,
"Port": Integer,
"ConnectionStringPrefix": String,
"ConnectionStringType": String,
"MultiAZ": Boolean,
"MaintainTime": String,
"Engine": String,
"DBParamGroupId": String,
"DBInstanceDescription": String,
"Tags": Map,
"TargetDedicatedHostIdForMaster": String,
"EngineVersion": String,
"ZoneId": String,
"DBInstanceClass": String,
"AllocatePublicConnection": Boolean,
"PreferredBackupTime": String,
"VSwitchId": String,
"BackupPolicyMode": String,
"Period": Integer,
"PayType": String,
"DBInstanceStorageType": String,
"RoleARN": String,
"MasterUserPassword": String,
"MasterUserType": String,
"VpcId": String,
"MasterUsername": String,
"ConnectionMode": String,
"BackupRetentionPeriod": Number,
"TargetDedicatedHostIdForLog": String,
"SlaveZoneIds": List,
"AutoRenew": Boolean,
"SQLCollectorStatus": String,
"SSLSetting": String,
"LogBackupFrequency": String,
"EnableBackupLog": Boolean,
"ReleasedKeepPolicy": String,
"ArchiveBackupRetentionPeriod": Integer,
"ArchiveBackupKeepPolicy": String,
"ArchiveBackupKeepCount": Integer,
"LogBackupRetentionPeriod": Integer,
"HighSpaceUsageProtection": String,
"LocalLogRetentionSpace": Integer,
"BackUpCategory": String,
"CompressType": Integer,
"LocalLogRetentionHours": Integer,
"LogBackupLocalRetentionNumber": Integer,
"ServerlessConfig": Map,
"InstanceNetworkType": String,
"StorageAutoScale": String,
"StorageUpperBound": Number,
"StorageThreshold": Number
}
}
Properties
Property | Type | Required | Editable | Description | Constraint |
ResourceGroupId | String | No | Yes | The ID of the resource group. | None. |
Engine | String | Yes | The database engine. | Valid values:
| |
DBInstanceStorage | Integer | Yes | Yes | The storage capacity of the instance. |
Unit: GB. Note The value of DBInstanceStorage must be in increments of 5 GB. |
EngineVersion | String | Yes | No | The version of the database engine. |
|
Port | Integer | No | Yes | The port number of the instance. | None. |
ConnectionStringPrefix | String | No | Yes | The prefix of the endpoint. | The prefix must be 8 to 64 characters in length, and can contain letters, digits, and hyphens (-). |
ConnectionStringType | String | No | Yes | The endpoint type. | Valid values:
|
DBTimeZone | String | No | No | The UTC time zone. | Valid values: -12:59 to +13:00. Note
|
DBParamGroupId | String | No | No | The ID of the parameter template. | None. |
Category | String | No | Yes | The edition of the instance. | Valid values:
Note When you use the parameter query feature, we recommend that you specify the following properties: ZoneId, DBInstanceStorageType, and Category. If you do not specify the properties, the verification for parameters cannot be complete. |
TargetDedicatedHostIdForMaster | String | No | No | The host ID of the primary instance that you want to create in a dedicated cluster. | None. |
DBIsIgnoreCase | Integer | No | No | Specifies whether table names are case-insensitive. | Valid values:
|
EncryptionKey | String | No | No | The ID of the key that is used for disk encryption in the region where the instance resides. You can obtain the ID of the key from the Key Management Service (KMS) console. You can also create a key. | If you specify this property, disk encryption is enabled and the RoleARN property is required. Disk encryption cannot be disabled after it is enabled. |
MaintainTime | String | No | No | The maintenance window of the instance. | Specify the maintenance window in the |
TargetDedicatedHostIdForSlave | String | No | No | The host ID of the secondary instance that you want to create in a dedicated cluster. | None. |
DedicatedHostGroupId | String | No | No | The ID of the dedicated cluster where you want to create the instance. | None. |
DBInstanceStorageType | String | No | Yes | The storage type of the instance. | Valid values:
Note When you use the parameter query feature, we recommend that you specify the following properties: ZoneId, DBInstanceStorageType, and Category. If you do not specify the properties, the verification for parameters cannot be complete. |
RoleARN | String | No | No | The Alibaba Cloud Resource Name (ARN) of the Resource Access Management (RAM) role. You can access KMS from ApsaraDB RDS by using the RAM role. | For more information, see Authorize ApsaraDB RDS for MySQL to access KMS. |
DBInstanceClass | String | Yes | Yes | The instance type. | For more information, see Primary ApsaraDB RDS instance types. |
SecurityIPList | String | Yes | Yes | The IP address whitelist that allows access to all databases on the instance. | Separate IP addresses with commas (,). Each IP address in the whitelist must be unique. You can specify up to 1,000 IP addresses in a whitelist. Supported formats:
|
SecurityGroupId | String | No | Yes | The ID of the security group. | You can associate the instance with up to three security groups. Separate security group IDs with commas (,). If you want to disassociate the instance from all security groups, leave this property empty. |
MultiAZ | Boolean | No | No | Specifies whether to deploy the instance across zones. | Valid values:
Note When you use the parameter query feature, we recommend that you set MultiAZ to false. If you set MultiAZ to true, the verification for parameters cannot be complete. |
VpcId | String | No | No | The ID of the virtual private cloud (VPC). | None. |
DBMappings | List | No | No | The databases that you want to create on the instance. | For more information, see DBMappings properties. |
DBInstanceDescription | String | No | No | The description of the instance. | The description must be 2 to 256 characters in length. The description must start with a letter and cannot start with |
ConnectionMode | String | No | No | The connection mode of the database. | Valid values:
If you do not specify this property, the system assigns a connection mode by default. Note Instances that run SQL Server 2012, SQL Server 2016, and SQL Server 2017 support only the standard mode. |
MasterUsername | String | No | Yes | The username of the Alibaba Cloud account. | The username must be globally unique. The username can be up to 16 characters in length, and can contain letters, digits, and underscores (_). The username must start with a letter. |
MasterUserPassword | String | No | Yes | The password of the Alibaba Cloud account. | The password must be 8 to 32 characters in length, and can contain letters, digits, and underscores (_). |
ZoneId | String | No | No | The zone ID. | Note When you use the parameter query feature, we recommend that you specify the following properties: ZoneId, DBInstanceStorageType, and Category. If you do not specify the properties, the verification for parameters cannot be complete. |
DBInstanceNetType | String | No | No | The network connection type of the instance. | Valid values:
|
VSwitchId | String | No | No | The vSwitch ID. | Separate vSwitch IDs with commas (,). You must specify this property when Engine is set to MariaDB. |
BackupPolicyMode | String | No | No | The backup type. | Valid values:
|
AllocatePublicConnection | Boolean | No | No | Specifies whether to apply for a public endpoint for the instance. | Valid values:
|
PreferredBackupTime | String | No | No | The backup time. | Specify the time in the Valid values: 00:00Z-01:00Z, 01:00Z-02:00Z, 02:00Z-03:00Z, 03:00Z-04:00Z, 04:00Z-05:00Z, 05:00Z-06:00Z, 06:00Z-07:00Z, 07:00Z-08:00Z, 08:00Z-09:00Z, 09:00Z-10:00Z, 10:00Z-11:00Z, 11:00Z-12:00Z, 12:00Z-13:00Z, 13:00Z-14:00Z, 14:00Z-15:00Z, 15:00Z-16:00Z, 16:00Z-17:00Z, 17:00Z-18:00Z, 18:00Z-19:00Z, 19:00Z-20:00Z, 20:00Z-21:00Z, 21:00Z-22:00Z, 22:00Z-23:00Z, and 23:00Z-24:00Z. |
BackupRetentionPeriod | Number | No | No | The number of days for which you can retain the backup data. | Valid values: 7 to 30. Unit: day. Default value: 7. |
PrivateIpAddress | String | No | No | The private IP address that corresponds to the vSwitch. | If you do not specify this property, the system automatically allocates a private IP address. |
PreferredBackupPeriod | List | No | No | The day of a week on which you want to back up data. | Valid values:
|
MasterUserType | String | No | No | The type of the Alibaba Cloud account. | Valid values:
|
Tags | Map | No | Yes | The tags. Each tag consists of a tag key and a tag value. | The tag key is required and the tag value is optional. Example: |
PeriodType | String | No | No | The unit of the subscription duration. | Valid values:
|
PayType | String | No | No | The billing method of the instance. | Valid values:
|
Period | Integer | No | No | The subscription duration. |
|
TargetDedicatedHostIdForLog | String | No | No | The host ID of the logger instance that you want to create in a dedicated cluster. | None. |
SlaveZoneIds | List | No | No | The secondary zone IDs of the High-availability Edition or Enterprise Edition instance. | You can specify up to two secondary zones. For example, you can set this property to You must specify a vSwitch for each primary or secondary zone. For example, if ZoneId is set to
|
SQLCollectorStatus | String | No | Yes | Specifies whether to enable SQL Explorer and Audit. | Valid values:
|
SSLSetting | String | No | No | The SSL connection settings of the instance. | Valid values:
|
AutoRenew | Boolean | No | No | Specifies whether to enable auto-renewal. | You must specify this property only when you create a subscription instance. Valid values:
Note
|
LogBackupFrequency | String | No | No | The backup frequency of logs. | Set the value to LogInterval. A value of LogInterval specifies that the system backs up logs every 30 minutes. The default value of LogBackupFrequency is the same as the value of PreferredBackupPeriod. Note LogBackupFrequency is supported only when Engine is set to SQLServer. |
EnableBackupLog | Boolean | No | No | Specifies whether to enable the log backup feature. | Valid values:
Note You must specify this property when BackupPolicyMode is set to LogBackupPolicy. |
ReleasedKeepPolicy | String | No | No | The policy that you want to use to retain archived backup files after the instance is released. | Valid values:
|
ArchiveBackupRetentionPeriod | Integer | No | No | The number of days for which you want to retain the archived backup files. | Valid values: 30 to 1095. Unit: day. |
ArchiveBackupKeepPolicy | String | No | No | The cycle based on which you want to retain the archived backup files. | Valid values:
|
ArchiveBackupKeepCount | Integer | No | No | The number of archived backup files that you want to retain. |
Default value: 1. |
LogBackupRetentionPeriod | Integer | No | No | The number of days for which you want to retain log backups. | Valid values: 7 to 730. The retention period of log backups cannot be longer than that of data backups. Note If you enable the log backup feature, you can specify the retention period of log backups. |
HighSpaceUsageProtection | String | No | No | Specifies whether to forcefully delete log backup files when the disk capacity is insufficient. The capacity is considered insufficient if the storage usage of your instance exceeds 80% or the remaining storage capacity of your instance is less than 5 GB. | Valid values:
You must specify this property when BackupPolicyMode is set to LogBackupPolicy. |
LocalLogRetentionSpace | Integer | No | No | The maximum storage usage that is allowed for log backup files on the instance. | Valid values: 0 to 50. If the storage usage for log backup files on the instance exceeds the value of this property, the system deletes earlier log backup files until the storage usage falls below the value of this property. Note You must specify this property when BackupPolicyMode is set to LogBackupPolicy. |
BackUpCategory | String | No | No | Specifies whether to enable the level-2 backup feature. | Valid values:
|
CompressType | Integer | No | No | The method that you want to use to compress backup data. | Valid values:
|
LocalLogRetentionHours | Integer | No | No | The number of hours for which you want to retain the local log backups on the instance. | Valid values: 0 to 168. Unit: hour. A value of 0 specifies that the log backup files are not retained on the instance. Note You must specify this property when BackupPolicyMode is set to LogBackupPolicy. |
LogBackupLocalRetentionNumber | Integer | No | No | The number of log backup files that can be retained on the instance. | Valid values: 6 to 100. Default value: 60. |
ServerlessConfig | Map | No | No | The settings of the Serverless instance. | For more information, see ServerlessConfig properties. |
InstanceNetworkType | String | No | No | The network type of the instance. | Valid values:
Note For the instance that runs MySQL and uses cloud disks, you must set this property to VPC. For the instance that runs PostgreSQL or MariaDB, you must set this property to VPC. For the instance that runs SQL Server Basic or SQL Server Web, you can set this property to VPC or Classic. For other types of instances, you must set this property to VPC. |
StorageAutoScale | String | No | No | Specifies whether to enable automatic storage expansion. | This property is supported only when Engine is set to MySQL or PostgreSQL. Valid values:
Note You can also call the ModifyDasInstanceConfig operation to adjust the settings of automatic storage expansion for an instance after the instance is created. For more information, see Configure automatic storage expansion. |
StorageUpperBound | Number | No | No | The maximum storage capacity that is allowed for automatic storage expansion. | The storage capacity of the instance cannot exceed the value of this property. Unit: GB. Note The value must be greater than or equal to 0. You must specify this property when StorageAutoScale is set to Enable. |
StorageThreshold | Number | No | No | The threshold based on which the system triggers automatic storage expansion. Unit: percent. | Valid values:
Note You must specify this property when StorageAutoScale is set to Enable. |
ServerlessConfig syntax
"ServerlessConfig": {
"SwitchForce": Boolean,
"MaxCapacity": Number,
"MinCapacity": Number,
"AutoPause": Boolean
}
ServerlessConfig properties
Property | Type | Required | Editable | Description | Constraint |
SwitchForce | Boolean | No | No | Specifies whether to enable the forced scaling feature for the serverless instance. | Valid values:
Note
|
MaxCapacity | Number | Yes | No | The maximum number of RCUs of the instance. | Valid values: 0.5 to 8. Note The value of this property must be greater than or equal to the value of MinCapacity. |
MinCapacity | Number | Yes | No | The minimum number of RCUs of the instance. | Valid values: 0.5 to 8. Note The value of this property must be less than or equal to the value of MaxCapacity. |
AutoPause | Boolean | No | No | Specifies whether to enable the automatic startup and suspension feature for the serverless instance. | Valid values:
Note After you enable the feature, the instance is suspended if the instance is not connected within 10 minutes, and the instance is resumed if the instance is connected. |
DBMappings syntax
"DBMappings": [
{
"DBDescription": String,
"CharacterSetName": String,
"DBName": String
}
]
DBMappings properties
Property | Type | Required | Editable | Description | Constraint |
CharacterSetName | String | Yes | No | The character set. |
|
DBName | String | Yes | No | The database name. | The name must be globally unique. The name can be up to 64 characters in length, and can contain letters, digits, and underscores (_). The name must start with a letter. |
DBDescription | String | No | No | The description of the database. | The description must be 2 to 256 characters in length. The description must start with a letter and cannot start with |
Return values
Fn::GetAtt
DBInstanceId: the instance ID.
InnerPort: the private port of the instance.
InnerIPAddress: the private IP address of the instance.
InnerConnectionString: the private endpoint of the instance.
PublicPort: the public port of the instance.
PublicConnectionString: the public endpoint of the instance.
PublicIPAddress: the public IP address of the instance.
Examples
In the examples, the following resource types are used: ALIYUN::RDS::DBInstance, ALIYUN::RDS::Account, ALIYUN::RDS::AccountPrivilege, ALIYUN::RDS::DBInstanceParameterGroup, ALIYUN::RDS::DBInstanceSecurityIps, ALIYUN::RDS::ReadOnlyDBInstance, and ALIYUN::RDS::Database.