Todos os produtos
Search
Central de documentação

Resource Orchestration Service:ALIYUN::RDS::DBInstanceClone

Última atualização: Jun 27, 2026

O recurso ALIYUN::RDS::DBInstanceClone restaura dados históricos de uma instância para uma nova instância. Essa nova instância é chamada de instância clonada.

Sintaxe

{
  "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
  }
}

Propriedades

Propriedade

Tipo

Obrigatório

Editável

Descrição

Restrição

PeriodType

String

Não

Não

Unidade da duração da assinatura.

Valores válidos:

  • Month

  • Year

Especifique esta propriedade quando PayType estiver definido como Prepaid.

Category

String

Não

Sim

Edição da nova instância.

Valores válidos:

  • Basic: RDS Basic Edition.

  • HighAvailability: RDS High-availability Edition.

  • AlwaysOn: RDS Cluster Edition.

PrivateIpAddress

String

Não

Não

Endereço IP privado da nova instância.

O endereço IP privado deve estar dentro do bloco CIDR do vSwitch. Por padrão, o sistema atribui um endereço IP privado com base nos valores de VpcId e VSwitchId.

ConnectionStringPrefix

String

Não

Sim

Prefixo do endpoint.

O prefixo deve ter de 8 a 64 caracteres e pode conter letras, dígitos e hifens (-).

ConnectionStringType

String

Não

Sim

Tipo do endpoint.

Valores válidos:

  • Inner: endpoint privado.

  • Public: endpoint público.

TimeoutInMinutes

Integer

Não

Não

Tempo limite.

Valores válidos:

  • 30

  • 60

  • 90

  • 120 (padrão)

  • 150

  • 180

  • 210

  • 240

  • 270

  • 300

  • 330

  • 360

Unidade: minutos.

Port

Integer

Não

Sim

Porta da nova instância.

Valores válidos: 1 a 65535.

DedicatedHostGroupId

String

Não

Não

ID do grupo de hosts.

Nenhuma.

BackupId

String

Não

Não

ID do conjunto de backup.

Especifique pelo menos um dos parâmetros BackupId ou RestoreTime.

RestoreTime

String

Não

Não

Ponto no tempo para restauração dos dados. Esse ponto deve estar dentro do período de retenção de backup especificado.

Especifique a hora no padrão ISO 8601, no formato yyyy-MM-ddTHH:mm:ssZ. A hora deve estar em UTC.

Especifique pelo menos um dos parâmetros BackupId ou RestoreTime.

InstanceNetworkType

String

Não

Não

Tipo de rede da nova instância.

Valores válidos:

  • VPC

  • Classic

Nota

Por padrão, o valor desta propriedade é igual ao tipo de rede da instância primária.

DbNames

String

Não

Não

Nomes dos bancos de dados.

Nenhuma.

PreferredBackupPeriod

List

Não

Sim

Dia da semana em que o sistema faz backup dos dados.

Valores válidos:

  • Monday

  • Tuesday

  • Wednesday

  • Thursday

  • Friday

  • Saturday

  • Sunday

DBInstanceId

String

Sim

Não

ID da instância de source.

Nenhuma.

SecurityIPList

String

Não

Sim

Entradas na lista de permissões de endereços IP que permitem acesso a todos os bancos de dados na nova instância.

Separe vários endereços IP na lista de permissões com vírgulas (,). Cada endereço IP deve ser único na lista. A lista de permissões pode conter até 1.000 endereços IP.

É possível especificar entradas na lista de permissões nos seguintes formatos:

  • Endereço IP. Exemplo: 10.23.12.24.

  • Bloco CIDR. Exemplo: 10.23.12.24/24. Neste exemplo, 24 indica que o prefixo do bloco CIDR tem 24 bits. Substitua 24 por um valor entre 1 e 32.

DBInstanceStorage

Integer

Não

Sim

Capacidade de armazenamento da nova instância.

Unidade: GB. O valor deve ser em incrementos de 5 GB.

Para obter mais informações, consulte Tipos de instância primária do ApsaraDB RDS.

Nota

Por padrão, o valor desta propriedade é igual à capacidade de armazenamento da instância primária.

BackupType

String

Não

Não

Tipo de backup.

Valores válidos:

  • FullBackup

  • IncrementalBackup

DBMappings

List

Não

Não

Bancos de dados na nova instância.

Para obter mais informações, consulte Propriedades de DBMappings.

MaintainTime

String

Não

Não

Janela de manutenção da nova instância.

Especifique a hora no padrão ISO 8601, no formato HH:mmZ-HH:mmZ. A hora deve estar em UTC.

Tags

Map

Não

Sim

As tags.

Nenhuma.

DBInstanceDescription

String

Não

Sim

Descrição da nova instância.

A descrição deve ter de 2 a 256 caracteres. Deve começar com uma letra e não pode iniciar com http:// ou https://. Pode conter letras, dígitos, sublinhados (_) e hifens (-).

ZoneId

String

Não

Não

ID da zona da nova instância.

Por padrão, o valor desta propriedade é igual ao ID da zona da instância de source.

SlaveZoneIds

List

Não

Não

IDs das zonas secundárias da nova instância que executa o RDS High-availability Edition ou RDS Enterprise Edition.

É possível especificar até dois IDs de zona secundária. Por exemplo, defina ["zone-b"] ou ["zone-b", "zone-c"] como valor desta propriedade.

Especifique um vSwitch em cada zona primária ou secundária. Por exemplo, se ZoneId for "zone-a" e SlaveZoneIds for ["zone-c", "zone-b"], especifique os IDs de vSwitch no seguinte formato: "vsw-zone-a,vsw-zone-c,vsw-zone-b".

Para que o sistema selecione automaticamente uma zona secundária, defina SlaveZoneIds como ["Auto"] ou ["Auto", "Auto"]. Nesse caso, ao especificar um ID de vSwitch para a zona primária, o sistema cria automaticamente um vSwitch nas zonas secundárias.

DBInstanceClass

String

Não

Sim

Tipo da nova instância.

Para obter mais informações, consulte Tipos de instância primária do ApsaraDB RDS.

Nota

Por padrão, o valor desta propriedade é igual ao tipo da instância primária.

AllocatePublicConnection

Boolean

Não

Não

Define se deve ser solicitado um endpoint público para a nova instância.

Valores válidos:

  • true

  • false

SecurityGroupId

String

Não

Sim

ID do grupo de segurança ao qual associar a nova instância.

Associe a instância a até três grupos de segurança. Separe múltiplos grupos de segurança com vírgulas (,).

Para desassociar a instância de todos os grupos de segurança, deixe esta propriedade vazia.

PreferredBackupTime

String

Não

Sim

Horário do backup.

Especifique a hora no padrão ISO 8601, no formato HH:mmZ- HH:mmZ.

Valores válidos: 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 e 23:00Z-24:00Z.

VSwitchId

String

Não

Não

ID do vSwitch.

Nenhuma.

Period

Integer

Não

Não

Duração da assinatura.

  • Valores válidos quando PeriodType é Year: 1 a 5.

  • Valores válidos quando PeriodType é Month: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 24, 36, 48 e 60.

PayType

String

Sim

Não

Método de faturamento da nova instância.

Valores válidos:

  • Postpaid: pagamento conforme o uso.

  • Prepaid: assinatura.

DBInstanceStorageType

String

Não

Sim

Tipo de armazenamento da nova instância.

Valores válidos:

  • local_ssd ou ephemeral_ssd: SSD local.

  • cloud_ssd: SSD padrão.

  • cloud_essd: Enterprise SSD (ESSD).

RestoreTable

String

Não

Não

Define se bancos de dados e tabelas devem ser restaurados.

O valor 1 indica que bancos de dados e tabelas serão restaurados. Outros valores indicam que não haverá restauração.

MasterUserPassword

String

Não

Sim

Senha da conta de gerenciamento de banco de dados da nova instância.

A senha deve ter de 8 a 32 caracteres e pode conter letras, dígitos e sublinhados (_).

MasterUserType

String

Não

Não

Tipo da conta de gerenciamento de banco de dados.

Valores válidos:

  • Normal (padrão): conta padrão.

  • Super: conta privilegiada.

  • Sysadmin: conta de administrador do sistema.

    Nota

    Contas de administrador do sistema suportam apenas bancos de dados SQL Server.

VpcId

String

Não

Não

ID da VPC.

Nenhuma.

SSLSetting

String

Não

Não

Configurações de conexão ssl da nova instância.

Valores válidos:

  • Disabled (padrão): desativa as configurações de conexão ssl da nova instância.

  • EnabledForPublicConnection: ativa as configurações de conexão ssl da nova instância. Certificados ssl protegem endpoints públicos.

    Nota

    Se definir esta propriedade como EnabledForPublicConnection, defina AllocatePublicConnection como true.

  • EnabledForInnerConnection: ativa as configurações de conexão ssl da nova instância. Certificados ssl protegem endpoints privados.

MasterUsername

String

Não

Sim

Nome de usuário da conta de gerenciamento de banco de dados da nova instância.

O nome de usuário deve ser único.

Pode ter até 16 caracteres e conter letras, dígitos e sublinhados (_). Deve começar com uma letra.

SQLCollectorStatus

String

Não

Sim

Define se o SQL Explorer and Audit deve ser ativado.

Valores válidos:

  • Enable

  • Disabled

BackupRetentionPeriod

Number

Não

Sim

Período de retenção dos dados de backup.

Valores válidos: 7 a 30.

Unidade: dias.

Valor padrão: 7.

TableMeta

List

Não

Não

Informações sobre os bancos de dados e tabelas a serem restaurados.

Para obter mais informações, consulte Propriedades de TableMeta.

Sintaxe de DBMappings

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

Propriedades de DBMappings

Propriedade

Tipo

Obrigatório

Editável

Descrição

Restrição

CharacterSetName

String

Sim

Não

Conjunto de caracteres.

  • Valores válidos para MySQL:

    • utf8

    • gbk

    • latin1

    • utf8mb4 (aplicável às versões 5,5 e 5,6)

  • Valores válidos para SQL Server:

    • 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

Sim

Não

Nome do banco de dados.

O nome deve ser único.

Pode ter até 64 caracteres e conter letras, dígitos e sublinhados (_). Deve começar com uma letra.

DBDescription

String

Não

Não

Descrição do banco de dados.

A descrição deve ter de 2 a 256 caracteres. Deve começar com uma letra e não pode iniciar com http:// ou https://. Pode conter letras, dígitos, sublinhados (_) e hifens (-).

Sintaxe de TableMeta

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

Propriedades de TableMeta

Propriedade

Tipo

Obrigatório

Editável

Descrição

Restrição

Type

String

Não

Não

O tipo.

Defina o valor como db.

Name

String

Não

Não

Nome original do banco de dados.

Nenhuma.

NewName

String

Não

Não

Novo nome do banco de dados.

Nenhuma.

Tables

List

Não

Não

Tabelas a serem restauradas.

Para obter mais informações, consulte Propriedades de Tables.

Sintaxe de Tables

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

Propriedades de Tables

Propriedade

Tipo

Obrigatório

Editável

Descrição

Restrição

Type

String

Não

Não

O tipo.

Defina o valor como table.

Name

String

Não

Não

Nome original da tabela.

Nenhuma.

NewName

String

Não

Não

Novo nome da tabela.

Nenhuma.

Valores de retorno

Fn::GetAtt

  • InnerConnectionString: endpoint interno da nova instância.

  • DBInstanceId: ID da nova instância.

  • InnerIPAddress: endereço IP privado da nova instância.

  • PublicConnectionString: endpoint público da nova instância.

  • PublicIPAddress: endereço IP público da nova instância.

  • PublicPort: porta pública da nova instância.

  • InnerPort: porta interna da nova instância.

Exemplos

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
 PeriodType:
  Type: String
  Description: Charge period for created instances.
  AllowedValues:
   - Month
   - Year
  Default: Month
 Category:
  Type: String
  Description: |-
   The edition of the instance. Valid values:
   Basic: specifies to use the Basic Edition.
   HighAvailability: specifies to use the High-availability Edition.
   AlwaysOn: specifies to use the Cluster Edition.
   Finance: specifies to use the Enterprise Edition.
  AllowedValues:
   - Basic
   - HighAvailability
   - AlwaysOn
   - Finance
 PrivateIpAddress:
  Type: String
  Description: The private ip for created instance.
 DedicatedHostGroupId:
  Type: String
  Description: >-
   The ID of the host group to which the instance belongs if you create an
   instance in a host group.
 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 most recent backup
   set list.

   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 original instance.
 RestoreTime:
  Type: String
  Description: >-
   The point in time to which you want to restore the data of the original
   instance.

   The point in time must fall within the specified log backup retention
   period.

   The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ
   format.

   The time must be in UTC.
 PreferredBackupPeriod:
  Type: CommaDelimitedList
  Description: >-
   The backup period. Separate multiple values with commas (,). The default
   value is the original value. Valid values:Monday Tuesday Wednesday
   Thursday Friday Saturday Sunday Note When the BackupPolicyMode parameter
   is set to DataBackupPolicy, this parameter is required.
 DbNames:
  Type: String
  Description: The names of the databases that you want to create on the new instance.
 DBInstanceId:
  Type: String
  Description: Instance id
 SecurityIPList:
  Type: String
  Description: >-
   Security ip to access the database instance, combine with comma, 0.0.0.0/0
   means no limitation.
 DBInstanceStorage:
  Type: Number
  Description: >-
   Database instance storage size. mysql is [5,1000]. sql server 2008r2 is
   [10,1000], sql server 2012/2012_web/2016-web is [20,1000]. PostgreSQL and
   PPAS is [5,2000]. Increased every 5 GB, Unit in GB
 BackupType:
  Type: String
  Description: |-
   The type of backup used by the new instance. Valid values:
   - FullBackup: full backup
   - IncrementalBackup: incremental backup
  AllowedValues:
   - FullBackup
   - IncrementalBackup
 DBMappings:
  Type: Json
  Description: Database mappings to attach to db instance.
 ConnectionStringPrefix:
  Type: String
  Description: >-
   The prefix of the endpoint.

   Only the prefix of the CurrentConnectionString parameter value can be
   modified.

   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 period during which the maintenance performs. The format is
   HH:mmZ-HH:mmZ.
 Tags:
  Type: Json
  Description: >-
   The tags of an instance.

   You should input the information of the tag with the format of the
   Key-Value, such as {"key1":"value1","key2":"value2", ... "key5":"value5"}.

   At most 5 tags can be specified.

   Key

   It can be up to 64 characters in length.

   Cannot begin with aliyun.

   Cannot begin with http:// or https://.

   Cannot be a null string.

   Value

   It can be up to 128 characters in length.

   Cannot begin with aliyun.

   Cannot begin with http:// or https://.

   Can be a null string.
 DBInstanceDescription:
  Type: String
  Description: Description of created database instance.
 ZoneId:
  Type: String
  Description: >-
   selected zone to create database instance. You cannot set the ZoneId
   parameter if the MultiAZ parameter is set to true.
 SlaveZoneIds:
  Type: Json
  Description: >-
   List of slave zone ids can specify slave zone ids when creating the
   high-availability or enterprise edition instance. Meanwhile, VSwitchId
   needs to pass in the corresponding vswitch id to the slave zone by order.
   For example, ZoneId = "zone-a" and SlaveZoneIds = ["zone-c", "zone-b"],
   then the VSwitchId must be "vsw-zone-a,vsw-zone-c,vsw-zone-b". Of course,
   you can also choose automatic allocation, for example, ZoneId = "zone-a"
   and SlaveZoneIds = ["Auto", "Auto"], then the VSwitchId must be
   "vsw-zone-a,Auto,Auto". The list contains up to 2 slave zone ids,
   separated by commas.
  MaxLength: 2
 DBInstanceClass:
  Type: String
  Description: >-
   Database instance type. Refer the RDS database instance type reference,
   such as 'rds.mys2.large', 'rds.mss1.large', 'rds.pg.s1.small' etc
 AllocatePublicConnection:
  Type: Boolean
  Description: 'If true, allocate public connection automate.'
  AllowedValues:
   - 'True'
   - 'true'
   - 'False'
   - 'false'
 PreferredBackupTime:
  Type: String
  Description: >-
   The time when the backup task is performed. Format:
   yyyy-MM-ddZ-HH:mm:ssZ.Note When the BackupPolicyMode parameter is set to
   DataBackupPolicy, this parameter is required.
 VSwitchId:
  Type: String
  Description: >-
   The vSwitch id of created instance. For VPC network, the property is
   required.
 SecurityGroupId:
  Type: String
  Description: |
   The ID of the ECS security groups.
   Each RDS instance can be associated with up to three ECS security groups.
   You must separate them with commas (,).
   To delete an ECS Security group, leave this parameter empty.
 Period:
  Type: Number
  Description: >-
   Prepaid time period. While choose by pay by month, it could be from 1 to
   12, 24, 36, 48, 60. While choose pay by year, it could be from 1 to 5.
  MinValue: 1
  MaxValue: 60
  Default: 1
 PayType:
  Type: String
  Description: The charge type of created instance.
  AllowedValues:
   - Prepaid
   - Postpaid
  Default: Postpaid
 DBInstanceStorageType:
  Type: String
  Description: >-
   The storage type of the instance. Valid values:

   local_ssd: specifies to use local SSDs. This is the recommended storage
   type.

   cloud_ssd: specifies to use standard SSDs.

   cloud_essd: specifies to use enhanced SSDs.
 ConnectionStringType:
  Type: String
  Description: 'The endpoint type of the instance, allow values: Inner, Public'
  AllowedValues:
   - Inner
   - Public
  Default: Inner
 RestoreTable:
  Type: String
  Description: >-
   Specifies whether to restore specific databases and tables.

   The value 1 specifies to restore specific databases and tables.

   If you do not want to restore specific databases or tables, you can choose
   not to specify this parameter.
 MasterUserPassword:
  Type: String
  Description: 'The master password for the database instance. '
  MinLength: 8
  MaxLength: 32
 MasterUserType:
  Type: String
  Description: |-
   Privilege type of account.
   Normal: Common privilege.
   Super: High privilege.
   Sysadmin: Super privileges (SA) (only supported by SQL Server)
   The default value is Normal.
  AllowedValues:
   - Normal
   - Super
   - Sysadmin
  Default: Normal
 VpcId:
  Type: String
  Description: >-
   The VPC id of created database instance. For VPC network, the property is
   required.
 SSLSetting:
  Type: String
  Description: >-
   Secure Sockets Layer (SSL) link setting of the instance. Valid values:

   Disabled: Disable SSL

   EnabledForPublicConnection: Public connection address will be protected by
   the SSL certificate. It requires AllocatePublicConnection is true.

   EnabledForInnerConnection: Private connection address will be protected by
   the SSL certificate.

   Default value is Disabled.
  AllowedValues:
   - Disabled
   - EnabledForPublicConnection
   - EnabledForInnerConnection
  Default: Disabled
 MasterUsername:
  Type: String
  Description: 'The master user name for the database instance. '
 SQLCollectorStatus:
  Type: String
  Description: >-
   Specifies whether to enable or disable the SQL Explorer (SQL audit)
   feature.

   Valid values:Enable | Disabled.
  AllowedValues:
   - Enable
   - Disabled
 BackupRetentionPeriod:
  Type: Number
  Description: >-
   The retention period of the data backup. Value range: 7 to 730. The
   default value is the original value. Note When the BackupPolicyMode
   parameter is set to LogBackupPolicy, this parameter is required.
  Default: 7
 TableMeta:
  Type: Json
  Description: The information about the databases and tables that you want to restore.
 TimeoutInMinutes:
  Type: Number
  Description: >-
   The timeout period for creating the clone instance resource. Unit: Minute.
   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: DB instance connection url by Intranet.
  Value:
   'Fn::GetAtt':
    - DbInstanceClone
    - InnerConnectionString
 DBInstanceId:
  Description: The instance id of created database instance.
  Value:
   'Fn::GetAtt':
    - DbInstanceClone
    - DBInstanceId
 InnerIPAddress:
  Description: IP Address for created DB instance of Intranet.
  Value:
   'Fn::GetAtt':
    - DbInstanceClone
    - InnerIPAddress
 PublicConnectionString:
  Description: DB instance connection url by Internet.
  Value:
   'Fn::GetAtt':
    - DbInstanceClone
    - PublicConnectionString
 PublicIPAddress:
  Description: IP Address for created DB instance of Internet.
  Value:
   'Fn::GetAtt':
    - DbInstanceClone
    - PublicIPAddress
 PublicPort:
  Description: Internet port of created DB instance.
  Value:
   'Fn::GetAtt':
    - DbInstanceClone
    - PublicPort
 InnerPort:
  Description: Intranet port of created DB instance.
  Value:
   'Fn::GetAtt':
    - DbInstanceClone
    - InnerPort
{
 "ROSTemplateFormatVersion": "2015-09-01",
 "Parameters": {
  "PeriodType": {
   "Type": "String",
   "Description": "Charge period for created instances.",
   "AllowedValues": [
    "Month",
    "Year"
   ],
   "Default": "Month"
  },
  "Category": {
   "Type": "String",
   "Description": "The edition of the instance. Valid values:\nBasic: specifies to use the Basic Edition.\nHighAvailability: specifies to use the High-availability Edition.\nAlwaysOn: specifies to use the Cluster Edition.\nFinance: specifies to use the Enterprise Edition.",
   "AllowedValues": [
    "Basic",
    "HighAvailability",
    "AlwaysOn",
    "Finance"
   ]
  },
  "PrivateIpAddress": {
   "Type": "String",
   "Description": "The private ip for created instance."
  },
  "DedicatedHostGroupId": {
   "Type": "String",
   "Description": "The ID of the host group to which the instance belongs if you create an instance in a host group."
  },
  "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 most recent backup set list. \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 original instance."
  },
  "RestoreTime": {
   "Type": "String",
   "Description": "The point in time to which you want to restore the data of the original instance. \nThe point in time must fall within the specified log backup retention period. \nThe time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. \nThe time must be in UTC."
  },
  "PreferredBackupPeriod": {
   "Type": "CommaDelimitedList",
   "Description": "The backup period. Separate multiple values with commas (,). The default value is the original value. Valid values:Monday Tuesday Wednesday Thursday Friday Saturday Sunday Note When the BackupPolicyMode parameter is set to DataBackupPolicy, this parameter is required."
  },
  "DbNames": {
   "Type": "String",
   "Description": "The names of the databases that you want to create on the new instance."
  },
  "DBInstanceId": {
   "Type": "String",
   "Description": "Instance id"
  },
  "SecurityIPList": {
   "Type": "String",
   "Description": "Security ip to access the database instance, combine with comma, 0.0.0.0/0 means no limitation."
  },
  "DBInstanceStorage": {
   "Type": "Number",
   "Description": "Database instance storage size. mysql is [5.1000]. sql server 2008r2 is [10.1000], sql server 2012/2012_web/2016-web is [20.1000]. PostgreSQL and PPAS is [5.2000]. Increased every 5 GB, Unit in GB"
  },
  "BackupType": {
   "Type": "String",
   "Description": "The type of backup used by the new instance. Valid values: \n - FullBackup: full backup \n - IncrementalBackup: incremental backup",
   "AllowedValues": [
    "FullBackup",
    "IncrementalBackup"
   ]
  },
  "DBMappings": {
   "Type": "Json",
   "Description": "Database mappings to attach to db instance."
  },
  "ConnectionStringPrefix": {
   "Type": "String",
   "Description": "The prefix of the endpoint. \nOnly the prefix of the CurrentConnectionString parameter value can be modified.\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 period during which the maintenance performs. The format is HH:mmZ-HH:mmZ."
  },
  "Tags": {
   "Type": "Json",
   "Description": "The tags of an instance.\nYou should input the information of the tag with the format of the Key-Value, such as {\"key1\":\"value1\",\"key2\":\"value2\", ... \"key5\":\"value5\"}.\nAt most 5 tags can be specified.\nKey\nIt can be up to 64 characters in length.\nCannot begin with aliyun.\nCannot begin with http:// or https://.\nCannot be a null string.\nValue\nIt can be up to 128 characters in length.\nCannot begin with aliyun.\nCannot begin with http:// or https://.\nCan be a null string."
  },
  "DBInstanceDescription": {
   "Type": "String",
   "Description": "Description of created database instance."
  },
  "ZoneId": {
   "Type": "String",
   "Description": "selected zone to create database instance. You cannot set the ZoneId parameter if the MultiAZ parameter is set to true."
  },
    "SlaveZoneIds": {
     "Type": "Json",
     "Description": "List of slave zone ids can specify slave zone ids when creating the high-availability or enterprise edition instance. Meanwhile, VSwitchId needs to pass in the corresponding vswitch id to the slave zone by order. For example, ZoneId = \"zone-a\" and SlaveZoneIds = [\"zone-c\", \"zone-b\"], then the VSwitchId must be \"vsw-zone-a,vsw-zone-c,vsw-zone-b\". Of course, you can also choose automatic allocation, for example, ZoneId = \"zone-a\" and SlaveZoneIds = [\"Auto\", \"Auto\"], then the VSwitchId must be \"vsw-zone-a,Auto,Auto\". The list contains up to 2 slave zone ids, separated by commas.",
     "MaxLength": 2
    },
  "DBInstanceClass": {
   "Type": "String",
   "Description": "Database instance type. Refer the RDS database instance type reference, such as 'rds.mys2.large', 'rds.mss1.large', 'rds.pg.s1.small' etc"
  },
  "AllocatePublicConnection": {
   "Type": "Boolean",
   "Description": "If true, allocate public connection automate.",
   "AllowedValues": [
    "True",
    "true",
    "False",
    "false"
   ]
  },
  "PreferredBackupTime": {
   "Type": "String",
   "Description": "The time when the backup task is performed. Format: yyyy-MM-ddZ-HH:mm:ssZ.Note When the BackupPolicyMode parameter is set to DataBackupPolicy, this parameter is required."
  },
  "VSwitchId": {
   "Type": "String",
   "Description": "The vSwitch id of created instance. For VPC network, the property is required."
  },
  "SecurityGroupId": {
   "Type": "String",
   "Description": "The ID of the ECS security groups. \nEach RDS instance can be associated with up to three ECS security groups. \nYou must separate them with commas (,). \nTo delete an ECS Security group, leave this parameter empty. \n"
  },
  "Period": {
   "Type": "Number",
   "Description": "Prepaid time period. While choose by pay by month, it could be from 1 to 12, 24, 36, 48, 60. While choose pay by year, it could be from 1 to 5.",
   "MinValue": 1,
   "MaxValue": 60,
   "Default": 1
  },
  "PayType": {
   "Type": "String",
   "Description": "The charge type of created instance.",
   "AllowedValues": [
    "Prepaid",
    "Postpaid"
   ],
   "Default": "Postpaid"
  },
  "DBInstanceStorageType": {
   "Type": "String",
   "Description": "The storage type of the instance. Valid values:\nlocal_ssd: specifies to use local SSDs. This is the recommended storage type.\ncloud_ssd: specifies to use standard SSDs.\ncloud_essd: specifies to use enhanced SSDs."
  },
  "ConnectionStringType": {
   "Type": "String",
   "Description": "The endpoint type of the instance, allow values: Inner, Public",
   "AllowedValues": [
    "Inner",
    "Public"
   ],
   "Default": "Inner"
  },
  "RestoreTable": {
   "Type": "String",
   "Description": "Specifies whether to restore specific databases and tables. \nThe value 1 specifies to restore specific databases and tables. \nIf you do not want to restore specific databases or tables, you can choose not to specify this parameter."
  },
  "MasterUserPassword": {
   "Type": "String",
   "Description": "The master password for the database instance. ",
   "MinLength": 8,
   "MaxLength": 32
  },
  "MasterUserType": {
   "Type": "String",
   "Description": "Privilege type of account.\n Normal: Common privilege. \n Super: High privilege. \nSysadmin: Super privileges (SA) (only supported by SQL Server)\nThe default value is Normal.",
   "AllowedValues": [
    "Normal",
    "Super",
    "Sysadmin"
   ],
   "Default": "Normal"
  },
  "VpcId": {
   "Type": "String",
   "Description": "The VPC id of created database instance. For VPC network, the property is required."
  },
  "SSLSetting": {
   "Type": "String",
   "Description": "Secure Sockets Layer (SSL) link setting of the instance. Valid values:\nDisabled: Disable SSL\nEnabledForPublicConnection: Public connection address will be protected by the SSL certificate. It requires AllocatePublicConnection is true.\nEnabledForInnerConnection: Private connection address will be protected by the SSL certificate.\nDefault value is Disabled.",
   "AllowedValues": [
    "Disabled",
    "EnabledForPublicConnection",
    "EnabledForInnerConnection"
   ],
   "Default": "Disabled"
  },
  "MasterUsername": {
   "Type": "String",
   "Description": "The master user name for the database instance. "
  },
  "SQLCollectorStatus": {
   "Type": "String",
   "Description": "Specifies whether to enable or disable the SQL Explorer (SQL audit) feature. \nValid values:Enable | Disabled.",
   "AllowedValues": [
    "Enable",
    "Disabled"
   ]
  },
  "BackupRetentionPeriod": {
   "Type": "Number",
   "Description": "The retention period of the data backup. Value range: 7 to 730. The default value is the original value. Note When the BackupPolicyMode parameter is set to LogBackupPolicy, this parameter is required.",
   "Default": 7
  },
  "TableMeta": {
   "Type": "Json",
   "Description": "The information about the databases and tables that you want to restore."
  },
  "TimeoutInMinutes": {
   "Type": "Number",
   "Description": "The timeout period for creating the clone instance resource. Unit: Minute. 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": "DB instance connection url by Intranet.",
   "Value": {
    "Fn::GetAtt": [
     "DbInstanceClone",
     "InnerConnectionString"
    ]
   }
  },
  "DBInstanceId": {
   "Description": "The instance id of created database instance.",
   "Value": {
    "Fn::GetAtt": [
     "DbInstanceClone",
     "DBInstanceId"
    ]
   }
  },
  "InnerIPAddress": {
   "Description": "IP Address for created DB instance of Intranet.",
   "Value": {
    "Fn::GetAtt": [
     "DbInstanceClone",
     "InnerIPAddress"
    ]
   }
  },
  "PublicConnectionString": {
   "Description": "DB instance connection url by Internet.",
   "Value": {
    "Fn::GetAtt": [
     "DbInstanceClone",
     "PublicConnectionString"
    ]
   }
  },
  "PublicIPAddress": {
   "Description": "IP Address for created DB instance of Internet.",
   "Value": {
    "Fn::GetAtt": [
     "DbInstanceClone",
     "PublicIPAddress"
    ]
   }
  },
  "PublicPort": {
   "Description": "Internet port of created DB instance.",
   "Value": {
    "Fn::GetAtt": [
     "DbInstanceClone",
     "PublicPort"
    ]
   }
  },
  "InnerPort": {
   "Description": "Intranet port of created DB instance.",
   "Value": {
    "Fn::GetAtt": [
     "DbInstanceClone",
     "InnerPort"
    ]
   }
  }
 }
}