ALIYUN::RDS::DBInstanceClone

Updated at:

Use ALIYUN::RDS::DBInstanceClone to restore historical data to a new instance, which is called a clone instance.

Syntax

{
  "Type": "ALIYUN::RDS::DBInstanceClone",
  "Properties": {
    "PeriodType": String,
    "Category": String,
    "PrivateIpAddress": String,
    "DedicatedHostGroupId": String,
    "BackupId": String,
    "RestoreTime": String,
    "InstanceNetworkType": String,
    "DbNames": String,
    "Port": Integer,
    "ConnectionStringPrefix": String,
    "ConnectionStringType": String,
    "TimeoutInMinutes": Integer,
    "PreferredBackupPeriod": List,
    "DBInstanceId": String,
    "SecurityIPList": String,
    "DBInstanceStorage": Integer,
    "BackupType": String,
    "DBMappings": List,
    "MaintainTime": String,
    "Tags": Map,
    "DBInstanceDescription": String,
    "ZoneId": String,
    "SlaveZoneIds": List,
    "DBInstanceClass": String,
    "AllocatePublicConnection": Boolean,
    "SecurityGroupId": String,
    "PreferredBackupTime": String,
    "VSwitchId": String,
    "Period": Integer,
    "PayType": String,
    "DBInstanceStorageType": String,
    "RestoreTable": String,
    "MasterUserPassword": String,
    "MasterUserType": String,
    "VpcId": String,
    "SSLSetting": String,
    "MasterUsername": String,
    "SQLCollectorStatus": String,
    "BackupRetentionPeriod": Number,
    "TableMeta": List
  }
}

Properties

Property name

Type

Required

Update allowed

Description

Constraints

PeriodType

String

No

No

Subscription plan

Valid values:

  • Monthly subscription.

  • Year: Annual subscription.

This parameter is required when PayType is set to Prepaid.

Category

String

No

Yes

Instance specification.

Valid values:

  • Basic: Basic Edition.

  • HighAvailability: High-availability Edition.

  • AlwaysOn: Cluster Edition.

  • Finance: Finance Edition.

PrivateIpAddress

String

No

No

The internal IP address of the new instance.

The IP address must be within the CIDR block of the specified vSwitch. By default, the system automatically assigns an internal IP address based on the VpcId and VSwitchId.

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 type of the endpoint.

Valid values:

  • Inner: internal network.

  • Public: public network.

TimeoutInMinutes

Integer

No

No

The timeout period.

Valid values:

  • 30

  • 60

  • 90

  • 120 (default)

  • 150

  • 180

  • 210

  • 240

  • 270

  • 300

  • 330

  • 360

Unit: minutes.

Port

Integer

No

Yes

The port of the new instance.

The value must be in the range of 1 to 65535.

DedicatedHostGroupId

String

No

No

The ID of the dedicated host group.

None

BackupId

String

No

No

The ID of the backup set.

You must specify at least one of BackupId and RestoreTime.

RestoreTime

String

No

No

A point in time within the backup retention period.

Format: yyyy-MM-ddTHH:mm:ssZ (UTC).

You must specify at least one of BackupId and RestoreTime.

InstanceNetworkType

String

No

No

The network type of the new instance.

Valid values:

  • VPC stands for Virtual Private Cloud.

  • Classic: classic network.

Note

By default, the network type is the same as that of the primary instance.

DbNames

String

No

No

The database name.

None

PreferredBackupPeriod

List

No

Yes

The backup cycle.

Valid values:

  • Monday

  • Tuesday

  • Wednesday

  • Thursday

  • Friday

  • Saturday

  • Sunday

DBInstanceId

String

Yes

No

The source instance ID.

None

SecurityIPList

String

No

Yes

The IP address whitelist for accessing all databases in the new instance.

Separate multiple IP addresses with commas (,). Each IP address must be unique. You can specify up to 1,000 IP addresses.

Supported formats:

  • IP address, for example, 10.23.12.24.

  • CIDR block, for example, 10.23.12.24/24. The number 24 indicates the prefix length, which can be from 1 to 32.

DBInstanceStorage

Integer

No

Yes

The storage space of the new instance.

Unit: GB. The value must be a multiple of 5.

For more information, see Primary instance types.

Note

By default, the storage space is the same as that of the primary instance.

BackupType

String

No

No

The backup type.

Valid values:

  • FullBackup: full backup.

  • IncrementalBackup: incremental backup.

DBMappings

List

No

No

The databases of the new instance.

For more information, see DBMappings properties.

MaintainTime

String

No

No

The maintenance window for the new instance.

Format: HH:mmZ-HH:mmZ (UTC).

Tags

Map

No

Yes

The tags.

None

DBInstanceDescription

String

No

Yes

The description of the new instance.

The description must be 2 to 256 characters in length. It must start with a letter or a Chinese character and cannot start with http:// or https://. It can contain Chinese characters, letters, digits, underscores (_), and hyphens (-).

ZoneId

String

No

No

The zone ID.

The default value is the zone of the source instance.

SlaveZoneIds

List

No

No

The secondary zone for a High-availability Edition or a three-node Enterprise Edition instance.

You can specify up to two secondary zones, for example, ["zone-b"] or ["zone-b", "zone-c"].

Specify a vSwitch for each primary or secondary zone. For example, if ZoneId is "zone-a" and SlaveZoneIds is ["zone-c", "zone-b"], set VSwitchID to "vsw-zone-a,vsw-zone-c,vsw-zone-b".

If you want the system to automatically select secondary zones, set the value to ["Auto"] or ["Auto", "Auto"]. In this case, you only need to specify the vSwitch ID for the primary zone. The system automatically creates vSwitches for the secondary zones.

DBInstanceClass

String

No

Yes

The instance type of the new instance.

For more information, see Primary instance types.

Note

By default, the instance type is the same as that of the primary instance.

AllocatePublicConnection

Boolean

No

No

Specifies whether to allocate a public endpoint for the new instance.

Valid values:

  • true

  • false

SecurityGroupId

String

No

Yes

The ID of the security group to which the new instance is added.

You can add the instance to up to three security groups. Separate multiple security group IDs with commas (,).

Specify an empty string to clear the security group.

PreferredBackupTime

String

No

Yes

The backup time.

Format: HH:mmZ- HH:mmZ.

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, 23:00Z-24:00Z.

VSwitchId

String

No

No

The vSwitch ID.

None

Period

Integer

No

No

The subscription duration.

Valid values:

  • If PeriodType is set to Year: 1 to 5.

  • If PeriodType is set to Month: 1 to 12, 24, 36, 48, 60.

PayType

String

Yes

No

The billing method of the new instance.

Valid values:

  • Postpaid: pay-as-you-go.

  • Prepaid: subscription.

DBInstanceStorageType

String

No

Yes

The storage type of the new instance.

Valid values:

  • local_ssd/ephemeral_ssd: local SSD.

  • cloud_ssd: standard SSD.

  • cloud_essd: enterprise SSD.

RestoreTable

String

No

No

Specifies whether to perform database and table restoration.

Set the value to 1 to perform database and table restoration. Otherwise, the restoration is not performed.

MasterUserPassword

String

No

Yes

The password of the root account for the database instance.

The password must be 8 to 32 characters in length. It can contain letters, digits, and underscores (_).

MasterUserType

String

No

No

The type of the root account.

Valid values:

  • Normal (default): standard account.

  • Super: privileged account.

  • Sysadmin: administrator account.

    Note

    The administrator account supports only SQL Server databases.

VpcId

String

No

No

The VPC ID.

None

SSLSetting

String

No

No

The Secure Sockets Layer (SSL) connection setting for the new instance.

Valid values:

  • Disabled (default): disables SSL.

  • EnabledForPublicConnection: Protects the public endpoint with an SSL Certificate.

    Note

    If this parameter is set to `EnabledForPublicConnection`, `AllocatePublicConnection` must be `true`.

  • EnabledForInnerConnection: protects the private endpoint with an SSL certificate.

MasterUsername

String

No

Yes

The name of the root account for the database instance.

The name must be unique.

It must be no more than 16 characters in length. It must start with a letter and can contain letters, digits, and underscores (_).

SQLCollectorStatus

String

No

Yes

Enables or disables SQL Explorer (SQL Audit).

Valid values:

  • Enable

  • Disabled

BackupRetentionPeriod

Number

No

Yes

The number of days to retain backups.

The value must be in the range of 7 to 30.

Unit: days.

Default value: 7.

TableMeta

List

No

No

When you perform database and table restoration, specify the information about the databases and tables to restore.

For more information, see TableMeta properties.

DBMappings syntax

"DBMappings": [
  {
    "CharacterSetName": String,
    "DBDescription": String,
    "DBName": String
  }
]

DBMappings properties

Property name

Type

Required

Update allowed

Description

Constraints

CharacterSetName

String

Yes

No

The character set.

Valid values:

  • MySQL type:

    • utf8

    • gbk

    • latin1

    • utf8mb4 (for versions 5.5 and 5.6)

  • SQL Server type:

    • Chinese_PRC_CI_AS

    • Chinese_PRC_CS_AS

    • SQL_Latin1_General_CP1_CI_AS

    • SQL_Latin1_General_CP1_CS_AS

    • Chinese_PRC_BIN

DBName

String

Yes

No

The database name.

It must be unique.

It must be no more than 64 characters in length. It must start with a letter and can contain letters, digits, and underscores (_).

DBDescription

String

No

No

The database description.

The description must be 2 to 256 characters in length. It must start with a letter or a Chinese character and cannot start with http:// or https://. It can contain Chinese characters, letters, digits, underscores (_), and hyphens (-).

TableMeta syntax

"TableMeta": [
  {
    "Type": String,
    "Name": String,
    "NewName": String,
    "Tables": List
  }
]

TableMeta properties

Property name

Type

Required

Update allowed

Description

Constraints

Type

String

No

No

The type.

Valid value: db.

Name

String

No

No

The database name.

None

NewName

String

No

No

The new database name.

None

Tables

List

No

No

The tables to restore.

For more information, see Tables properties.

Tables syntax

"Tables": [
  {
    "Type": String,
    "Name": String,
    "NewName": String
  }
]

Tables properties

Property name

Type

Required

Update allowed

Description

Constraints

Type

String

No

No

The type.

Valid value: table.

Name

String

No

No

The name of the table in the database.

None

NewName

String

No

No

The new table name.

None

Return values

Fn::GetAtt

  • InnerConnectionString: The internal endpoint.

  • DBInstanceId: The source instance ID.

  • InnerIPAddress: The internal IP address.

  • PublicConnectionString: The public endpoint.

  • PublicIPAddress: The public IP address.

  • PublicPort: The public port of the database instance.

  • InnerPort: The internal port of the database instance.

Examples

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  PeriodType:
    Type: String
    Description: The billing cycle for the subscription.
    AllowedValues:
      - Month
      - Year
    Default: Month
  Category:
    Type: String
    Description: |-
      The instance edition. Valid values:
      Basic: Basic Edition.
      HighAvailability: High-availability Edition.
      AlwaysOn: Cluster Edition.
      Finance: Finance Edition.
    AllowedValues:
      - Basic
      - HighAvailability
      - AlwaysOn
      - Finance
  PrivateIpAddress:
    Type: String
    Description: The internal IP address of the new instance.
  DedicatedHostGroupId:
    Type: String
    Description: The ID of the dedicated host group to which the instance belongs.
  Port:
    Type: Number
    Description: The port of the database service.
    MinValue: 1
    MaxValue: 65535
  BackupId:
    Type: String
    Description: >-
      The ID of the backup set that you want to use. You can call the
      DescribeBackups operation to query the list of backup sets. Note: You
      must specify at least one of the BackupId and RestoreTime parameters.
  InstanceNetworkType:
    Type: String
    Description: |-
      The network type of the new instance. Valid values:
      - VPC
      - Classic
      The default value is the network type of the source instance.
  RestoreTime:
    Type: String
    Description: >-
      The point in time to which you want to restore data. The point in time
      must be within the backup retention period. The time must be in the
      yyyy-MM-ddTHH:mm:ssZ format and in UTC.
  PreferredBackupPeriod:
    Type: CommaDelimitedList
    Description: >-
      The backup cycle. Separate multiple values with commas (,). The default
      value is the same as the source instance. Valid values: Monday, Tuesday,
      Wednesday, Thursday, Friday, Saturday, Sunday. Note: This parameter is
      required when BackupPolicyMode is set to DataBackupPolicy.
  DbNames:
    Type: String
    Description: The names of the databases to create on the new instance.
  DBInstanceId:
    Type: String
    Description: The ID of the source instance.
  SecurityIPList:
    Type: String
    Description: >-
      The IP address whitelist to access the database instance. Separate
      multiple IP addresses with commas (,). 0.0.0.0/0 indicates that all IP
      addresses are allowed.
  DBInstanceStorage:
    Type: Number
    Description: >-
      The storage space of the database instance in GB. The value must be a
      multiple of 5. For more information about the value range, see Instance
      types.
  BackupType:
    Type: String
    Description: |-
      The backup type. Valid values:
      - FullBackup: full backup
      - IncrementalBackup: incremental backup
    AllowedValues:
      - FullBackup
      - IncrementalBackup
  DBMappings:
    Type: Json
    Description: The database mappings.
  ConnectionStringPrefix:
    Type: String
    Description: >-
      The prefix of the endpoint. The prefix must be 8 to 64 characters in
      length and can contain letters, digits, and hyphens (-).
    AllowedPattern: '[a-zA-Z0-9-]{8,64}'
  MaintainTime:
    Type: String
    Description: 'The maintenance window. The format is HH:mmZ-HH:mmZ.'
  Tags:
    Type: Json
    Description: >-
      The tags of the instance. Tags are key-value pairs. You can specify up to
      5 tags. Key: Up to 64 characters. Cannot start with aliyun, http://, or
      https://. Cannot be an empty string. Value: Up to 128 characters. Cannot
      start with aliyun, http://, or https://. Can be an empty string.
  DBInstanceDescription:
    Type: String
    Description: The description of the new instance.
  ZoneId:
    Type: String
    Description: >-
      The zone where you want to create the instance. You cannot set this
      parameter if MultiAZ is set to true.
  SlaveZoneIds:
    Type: Json
    Description: >-
      The IDs of the secondary zones. You can specify secondary zones when you
      create a High-availability or Enterprise Edition instance. You must
      specify a vSwitch ID for each secondary zone in the VSwitchId parameter.
      For example, if ZoneId is "zone-a" and SlaveZoneIds is ["zone-c",
      "zone-b"], VSwitchId must be "vsw-zone-a,vsw-zone-c,vsw-zone-b". To have
      the system automatically select zones, set the value to ["Auto", "Auto"].
      In this case, VSwitchId must be "vsw-zone-a,Auto,Auto". You can specify
      up to two secondary zone IDs.
    MaxLength: 2
  DBInstanceClass:
    Type: String
    Description: >-
      The instance type of the database instance. For more information, see
      Instance types. Examples: rds.mys2.large, rds.mss1.large,
      rds.pg.s1.small.
  AllocatePublicConnection:
    Type: Boolean
    Description: Specifies whether to automatically allocate a public endpoint.
    AllowedValues:
      - 'True'
      - 'true'
      - 'False'
      - 'false'
  PreferredBackupTime:
    Type: String
    Description: >-
      The backup time. The format is HH:mmZ-HH:mmZ. Note: This parameter is
      required when BackupPolicyMode is set to DataBackupPolicy.
  VSwitchId:
    Type: String
    Description: >-
      The ID of the vSwitch. This parameter is required if the network type is
      VPC.
  SecurityGroupId:
    Type: String
    Description: |
      The IDs of the security groups.
      You can associate an instance with up to three security groups.
      Separate multiple IDs with commas (,).
      To disassociate all security groups, leave this parameter empty.
  Period:
    Type: Number
    Description: >-
      The subscription duration. If you set PeriodType to Month, valid values
      are 1 to 12, 24, 36, 48, and 60. If you set PeriodType to Year, valid
      values are 1 to 5.
    MinValue: 1
    MaxValue: 60
    Default: 1
  PayType:
    Type: String
    Description: The billing method of the instance.
    AllowedValues:
      - Prepaid
      - Postpaid
    Default: Postpaid
  DBInstanceStorageType:
    Type: String
    Description: >-
      The storage type of the instance. Valid values: local_ssd (local SSD),
      cloud_ssd (standard SSD), cloud_essd (enhanced SSD).
  ConnectionStringType:
    Type: String
    Description: 'The endpoint type of the instance. Valid values: Inner, Public'
    AllowedValues:
      - Inner
      - Public
    Default: Inner
  RestoreTable:
    Type: String
    Description: >-
      Specifies whether to restore specific databases and tables. Set the value
      to 1 to restore specific databases and tables. If you do not specify this
      parameter, this feature is disabled.
  MasterUserPassword:
    Type: String
    Description: The password of the root account.
    MinLength: 8
    MaxLength: 32
  MasterUserType:
    Type: String
    Description: |-
      The type of the root account. Valid values:
      Normal: standard account.
      Super: privileged account.
      Sysadmin: administrator account, SQL Server only.
      The default value is Normal.
    AllowedValues:
      - Normal
      - Super
      - Sysadmin
    Default: Normal
  VpcId:
    Type: String
    Description: >-
      The ID of the VPC. This parameter is required if the network type is VPC.
  SSLSetting:
    Type: String
    Description: >-
      The SSL connection setting. Valid values: Disabled (disables SSL),
      EnabledForPublicConnection (enables SSL for the public endpoint),
      EnabledForInnerConnection (enables SSL for the internal endpoint).
      Default value is Disabled.
    AllowedValues:
      - Disabled
      - EnabledForPublicConnection
      - EnabledForInnerConnection
    Default: Disabled
  MasterUsername:
    Type: String
    Description: The name of the root account.
  SQLCollectorStatus:
    Type: String
    Description: >-
      Specifies whether to enable or disable SQL Explorer (SQL Audit). Valid
      values: Enable, Disabled.
    AllowedValues:
      - Enable
      - Disabled
  BackupRetentionPeriod:
    Type: Number
    Description: >-
      The number of days to retain data backups. Value range: 7 to 730. The
      default value is the same as the source instance. Note: This parameter is
      required when BackupPolicyMode is set to LogBackupPolicy.
    Default: 7
  TableMeta:
    Type: Json
    Description: The information about the databases and tables to restore.
  TimeoutInMinutes:
    Type: Number
    Description: >-
      The timeout period for creating the clone instance. Unit: minutes.
      Default: 120.
    AllowedValues:
      - 30
      - 60
      - 90
      - 120
      - 150
      - 180
      - 210
      - 240
      - 270
      - 300
      - 330
      - 360
    Default: 120
Resources:
  DbInstanceClone:
    Type: 'ALIYUN::RDS::DBInstanceClone'
    Properties:
      PeriodType:
        Ref: PeriodType
      Category:
        Ref: Category
      PrivateIpAddress:
        Ref: PrivateIpAddress
      DedicatedHostGroupId:
        Ref: DedicatedHostGroupId
      Port:
        Ref: Port
      BackupId:
        Ref: BackupId
      InstanceNetworkType:
        Ref: InstanceNetworkType
      RestoreTime:
        Ref: RestoreTime
      PreferredBackupPeriod:
        Ref: PreferredBackupPeriod
      DbNames:
        Ref: DbNames
      DBInstanceId:
        Ref: DBInstanceId
      SecurityIPList:
        Ref: SecurityIPList
      DBInstanceStorage:
        Ref: DBInstanceStorage
      BackupType:
        Ref: BackupType
      DBMappings:
        Ref: DBMappings
      ConnectionStringPrefix:
        Ref: ConnectionStringPrefix
      MaintainTime:
        Ref: MaintainTime
      Tags:
        Ref: Tags
      DBInstanceDescription:
        Ref: DBInstanceDescription
      ZoneId:
        Ref: ZoneId
      SlaveZoneIds:
        Ref: SlaveZoneIds
      DBInstanceClass:
        Ref: DBInstanceClass
      AllocatePublicConnection:
        Ref: AllocatePublicConnection
      PreferredBackupTime:
        Ref: PreferredBackupTime
      VSwitchId:
        Ref: VSwitchId
      SecurityGroupId:
        Ref: SecurityGroupId
      Period:
        Ref: Period
      PayType:
        Ref: PayType
      DBInstanceStorageType:
        Ref: DBInstanceStorageType
      ConnectionStringType:
        Ref: ConnectionStringType
      RestoreTable:
        Ref: RestoreTable
      MasterUserPassword:
        Ref: MasterUserPassword
      MasterUserType:
        Ref: MasterUserType
      VpcId:
        Ref: VpcId
      SSLSetting:
        Ref: SSLSetting
      MasterUsername:
        Ref: MasterUsername
      SQLCollectorStatus:
        Ref: SQLCollectorStatus
      BackupRetentionPeriod:
        Ref: BackupRetentionPeriod
      TableMeta:
        Ref: TableMeta
      TimeoutInMinutes:
        Ref: TimeoutInMinutes
Outputs:
  InnerConnectionString:
    Description: The internal endpoint of the database instance.
    Value:
      'Fn::GetAtt':
        - DbInstanceClone
        - InnerConnectionString
  DBInstanceId:
    Description: The ID of the new database instance.
    Value:
      'Fn::GetAtt':
        - DbInstanceClone
        - DBInstanceId
  InnerIPAddress:
    Description: The internal IP address of the new database instance.
    Value:
      'Fn::GetAtt':
        - DbInstanceClone
        - InnerIPAddress
  PublicConnectionString:
    Description: The public endpoint of the database instance.
    Value:
      'Fn::GetAtt':
        - DbInstanceClone
        - PublicConnectionString
  PublicIPAddress:
    Description: The public IP address of the new database instance.
    Value:
      'Fn::GetAtt':
        - DbInstanceClone
        - PublicIPAddress
  PublicPort:
    Description: The public port of the new database instance.
    Value:
      'Fn::GetAtt':
        - DbInstanceClone
        - PublicPort
  InnerPort:
    Description: The internal port of the new database instance.
    Value:
      'Fn::GetAtt':
        - DbInstanceClone
        - InnerPort
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "PeriodType": {
      "Type": "String",
      "Description": "The billing cycle for the subscription.",
      "AllowedValues": [
        "Month",
        "Year"
      ],
      "Default": "Month"
    },
    "Category": {
      "Type": "String",
      "Description": "The instance edition. Valid values:\nBasic: Basic Edition.\nHighAvailability: High-availability Edition.\nAlwaysOn: Cluster Edition.\nFinance: Finance Edition.",
      "AllowedValues": [
        "Basic",
        "HighAvailability",
        "AlwaysOn",
        "Finance"
      ]
    },
    "PrivateIpAddress": {
      "Type": "String",
      "Description": "The internal IP address of the new instance."
    },
    "DedicatedHostGroupId": {
      "Type": "String",
      "Description": "The ID of the dedicated host group to which the instance belongs."
    },
    "Port": {
      "Type": "Number",
      "Description": "The port of the database service.",
      "MinValue": 1,
      "MaxValue": 65535
    },
    "BackupId": {
      "Type": "String",
      "Description": "The ID of the backup set that you want to use. \nYou can call the DescribeBackups operation to query the list of backup sets. \nNote: You must specify at least one of the BackupId and RestoreTime parameters."
    },
    "InstanceNetworkType": {
      "Type": "String",
      "Description": "The network type of the new instance. Valid values: \n- VPC \n- Classic \nThe default value is the network type of the source instance."
    },
    "RestoreTime": {
      "Type": "String",
      "Description": "The point in time to which you want to restore data. \nThe point in time must be within the backup retention period. \nThe time must be in the yyyy-MM-ddTHH:mm:ssZ format and in UTC."
    },
    "PreferredBackupPeriod": {
      "Type": "CommaDelimitedList",
      "Description": "The backup cycle. Separate multiple values with commas (,). The default value is the same as the source instance. Valid values: Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday. Note: This parameter is required when BackupPolicyMode is set to DataBackupPolicy."
    },
    "DbNames": {
      "Type": "String",
      "Description": "The names of the databases to create on the new instance."
    },
    "DBInstanceId": {
      "Type": "String",
      "Description": "The ID of the source instance."
    },
    "SecurityIPList": {
      "Type": "String",
      "Description": "The IP address whitelist to access the database instance. Separate multiple IP addresses with commas (,). 0.0.0.0/0 indicates that all IP addresses are allowed."
    },
    "DBInstanceStorage": {
      "Type": "Number",
      "Description": "The storage space of the database instance in GB. The value must be a multiple of 5. For more information about the value range, see Instance types."
    },
    "BackupType": {
      "Type": "String",
      "Description": "The backup type. Valid values: \n - FullBackup: full backup \n - IncrementalBackup: incremental backup",
      "AllowedValues": [
        "FullBackup",
        "IncrementalBackup"
      ]
    },
    "DBMappings": {
      "Type": "Json",
      "Description": "The database mappings."
    },
    "ConnectionStringPrefix": {
      "Type": "String",
      "Description": "The prefix of the endpoint. \nThe prefix must be 8 to 64 characters in length and can contain letters, digits, and hyphens (-). ",
      "AllowedPattern": "[a-zA-Z0-9-]{8,64}"
    },
    "MaintainTime": {
      "Type": "String",
      "Description": "The maintenance window. The format is HH:mmZ-HH:mmZ."
    },
    "Tags": {
      "Type": "Json",
      "Description": "The tags of the instance.\nTags are key-value pairs. You can specify up to 5 tags.\nKey: Up to 64 characters. Cannot start with aliyun, http://, or https://. Cannot be an empty string.\nValue: Up to 128 characters. Cannot start with aliyun, http://, or https://. Can be an empty string."
    },
    "DBInstanceDescription": {
      "Type": "String",
      "Description": "The description of the new instance."
    },
    "ZoneId": {
      "Type": "String",
      "Description": "The zone where you want to create the instance. You cannot set this parameter if MultiAZ is set to true."
    },
    "SlaveZoneIds": {
      "Type": "Json",
      "Description": "The IDs of the secondary zones. You can specify secondary zones when you create a High-availability or Enterprise Edition instance. You must specify a vSwitch ID for each secondary zone in the VSwitchId parameter. For example, if ZoneId is \"zone-a\" and SlaveZoneIds is [\"zone-c\", \"zone-b\"], VSwitchId must be \"vsw-zone-a,vsw-zone-c,vsw-zone-b\". To have the system automatically select zones, set the value to [\"Auto\", \"Auto\"]. In this case, VSwitchId must be \"vsw-zone-a,Auto,Auto\". You can specify up to two secondary zone IDs.",
      "MaxLength": 2
    },
    "DBInstanceClass": {
      "Type": "String",
      "Description": "The instance type of the database instance. For more information, see Instance types. Examples: rds.mys2.large, rds.mss1.large, rds.pg.s1.small."
    },
    "AllocatePublicConnection": {
      "Type": "Boolean",
      "Description": "Specifies whether to automatically allocate a public endpoint.",
      "AllowedValues": [
        "True",
        "true",
        "False",
        "false"
      ]
    },
    "PreferredBackupTime": {
      "Type": "String",
      "Description": "The backup time. The format is HH:mmZ-HH:mmZ. Note: This parameter is required when BackupPolicyMode is set to DataBackupPolicy."
    },
    "VSwitchId": {
      "Type": "String",
      "Description": "The ID of the vSwitch. This parameter is required if the network type is VPC."
    },
    "SecurityGroupId": {
      "Type": "String",
      "Description": "The IDs of the security groups. \nYou can associate an instance with up to three security groups. \nYou must separate them with commas (,). \nTo disassociate all security groups, leave this parameter empty. \n"
    },
    "Period": {
      "Type": "Number",
      "Description": "The subscription duration. If you set PeriodType to Month, valid values are 1 to 12, 24, 36, 48, and 60. If you set PeriodType to Year, valid values are 1 to 5.",
      "MinValue": 1,
      "MaxValue": 60,
      "Default": 1
    },
    "PayType": {
      "Type": "String",
      "Description": "The billing method of the instance.",
      "AllowedValues": [
        "Prepaid",
        "Postpaid"
      ],
      "Default": "Postpaid"
    },
    "DBInstanceStorageType": {
      "Type": "String",
      "Description": "The storage type of the instance. Valid values: local_ssd (local SSD), cloud_ssd (standard SSD), cloud_essd (enhanced SSD)."
    },
    "ConnectionStringType": {
      "Type": "String",
      "Description": "The endpoint type of the instance. Valid values: Inner, Public",
      "AllowedValues": [
        "Inner",
        "Public"
      ],
      "Default": "Inner"
    },
    "RestoreTable": {
      "Type": "String",
      "Description": "Specifies whether to restore specific databases and tables. \nSet the value to 1 to restore specific databases and tables. \nIf you do not specify this parameter, this feature is disabled."
    },
    "MasterUserPassword": {
      "Type": "String",
      "Description": "The password of the root account. ",
      "MinLength": 8,
      "MaxLength": 32
    },
    "MasterUserType": {
      "Type": "String",
      "Description": "The type of the root account. Valid values:\n Normal: standard account. \n Super: privileged account. \nSysadmin: administrator account, SQL Server only.\nThe default value is Normal.",
      "AllowedValues": [
        "Normal",
        "Super",
        "Sysadmin"
      ],
      "Default": "Normal"
    },
    "VpcId": {
      "Type": "String",
      "Description": "The ID of the VPC. This parameter is required if the network type is VPC."
    },
    "SSLSetting": {
      "Type": "String",
      "Description": "The SSL connection setting. Valid values:\nDisabled: disables SSL.\nEnabledForPublicConnection: enables SSL for the public endpoint.\nEnabledForInnerConnection: enables SSL for the internal endpoint.\nDefault value is Disabled.",
      "AllowedValues": [
        "Disabled",
        "EnabledForPublicConnection",
        "EnabledForInnerConnection"
      ],
      "Default": "Disabled"
    },
    "MasterUsername": {
      "Type": "String",
      "Description": "The name of the root account. "
    },
    "SQLCollectorStatus": {
      "Type": "String",
      "Description": "Specifies whether to enable or disable SQL Explorer (SQL Audit). \nValid values: Enable, Disabled.",
      "AllowedValues": [
        "Enable",
        "Disabled"
      ]
    },
    "BackupRetentionPeriod": {
      "Type": "Number",
      "Description": "The number of days to retain data backups. Value range: 7 to 730. The default value is the same as the source instance. Note: This parameter is required when BackupPolicyMode is set to LogBackupPolicy.",
      "Default": 7
    },
    "TableMeta": {
      "Type": "Json",
      "Description": "The information about the databases and tables to restore."
    },
    "TimeoutInMinutes": {
      "Type": "Number",
      "Description": "The timeout period for creating the clone instance. Unit: minutes. Default: 120.",
      "AllowedValues": [
        30,
        60,
        90,
        120,
        150,
        180,
        210,
        240,
        270,
        300,
        330,
        360
      ],
      "Default": 120
    }
  },
  "Resources": {
    "DbInstanceClone": {
      "Type": "ALIYUN::RDS::DBInstanceClone",
      "Properties": {
        "PeriodType": {
          "Ref": "PeriodType"
        },
        "Category": {
          "Ref": "Category"
        },
        "PrivateIpAddress": {
          "Ref": "PrivateIpAddress"
        },
        "DedicatedHostGroupId": {
          "Ref": "DedicatedHostGroupId"
        },
        "Port": {
          "Ref": "Port"
        },
        "BackupId": {
          "Ref": "BackupId"
        },
        "InstanceNetworkType": {
          "Ref": "InstanceNetworkType"
        },
        "RestoreTime": {
          "Ref": "RestoreTime"
        },
        "PreferredBackupPeriod": {
          "Ref": "PreferredBackupPeriod"
        },
        "DbNames": {
          "Ref": "DbNames"
        },
        "SlaveZoneIds": {
          "Ref": "SlaveZoneIds"
        },
        "DBInstanceId": {
          "Ref": "DBInstanceId"
        },
        "SecurityIPList": {
          "Ref": "SecurityIPList"
        },
        "DBInstanceStorage": {
          "Ref": "DBInstanceStorage"
        },
        "BackupType": {
          "Ref": "BackupType"
        },
        "DBMappings": {
          "Ref": "DBMappings"
        },
        "ConnectionStringPrefix": {
          "Ref": "ConnectionStringPrefix"
        },
        "MaintainTime": {
          "Ref": "MaintainTime"
        },
        "Tags": {
          "Ref": "Tags"
        },
        "DBInstanceDescription": {
          "Ref": "DBInstanceDescription"
        },
        "ZoneId": {
          "Ref": "ZoneId"
        },
        "DBInstanceClass": {
          "Ref": "DBInstanceClass"
        },
        "AllocatePublicConnection": {
          "Ref": "AllocatePublicConnection"
        },
        "PreferredBackupTime": {
          "Ref": "PreferredBackupTime"
        },
        "VSwitchId": {
          "Ref": "VSwitchId"
        },
        "SecurityGroupId": {
          "Ref": "SecurityGroupId"
        },
        "Period": {
          "Ref": "Period"
        },
        "PayType": {
          "Ref": "PayType"
        },
        "DBInstanceStorageType": {
          "Ref": "DBInstanceStorageType"
        },
        "ConnectionStringType": {
          "Ref": "ConnectionStringType"
        },
        "RestoreTable": {
          "Ref": "RestoreTable"
        },
        "MasterUserPassword": {
          "Ref": "MasterUserPassword"
        },
        "MasterUserType": {
          "Ref": "MasterUserType"
        },
        "VpcId": {
          "Ref": "VpcId"
        },
        "SSLSetting": {
          "Ref": "SSLSetting"
        },
        "MasterUsername": {
          "Ref": "MasterUsername"
        },
        "SQLCollectorStatus": {
          "Ref": "SQLCollectorStatus"
        },
        "BackupRetentionPeriod": {
          "Ref": "BackupRetentionPeriod"
        },
        "TableMeta": {
          "Ref": "TableMeta"
        },
        "TimeoutInMinutes": {
          "Ref": "TimeoutInMinutes"
        }
      }
    }
  },
  "Outputs": {
    "InnerConnectionString": {
      "Description": "The internal endpoint of the database instance.",
      "Value": {
        "Fn::GetAtt": [
          "DbInstanceClone",
          "InnerConnectionString"
        ]
      }
    },
    "DBInstanceId": {
      "Description": "The ID of the new database instance.",
      "Value": {
        "Fn::GetAtt": [
          "DbInstanceClone",
          "DBInstanceId"
        ]
      }
    },
    "InnerIPAddress": {
      "Description": "The internal IP address of the new database instance.",
      "Value": {
        "Fn::GetAtt": [
          "DbInstanceClone",
          "InnerIPAddress"
        ]
      }
    },
    "PublicConnectionString": {
      "Description": "The public endpoint of the database instance.",
      "Value": {
        "Fn::GetAtt": [
          "DbInstanceClone",
          "PublicConnectionString"
        ]
      }
    },
    "PublicIPAddress": {
      "Description": "The public IP address of the new database instance.",
      "Value": {
        "Fn::GetAtt": [
          "DbInstanceClone",
          "PublicIPAddress"
        ]
      }
    },
    "PublicPort": {
      "Description": "The public port of the new database instance.",
      "Value": {
        "Fn::GetAtt": [
          "DbInstanceClone",
          "PublicPort"
        ]
      }
    },
    "InnerPort": {
      "Description": "The internal port of the new database instance.",
      "Value": {
        "Fn::GetAtt": [
          "DbInstanceClone",
          "InnerPort"
        ]
      }
    }
  }
}