ALIYUN::DTS::SynchronizationJob2

ALIYUN::DTS::SynchronizationJob2类型用于配置同步作业。

语法

{
  "Type": "ALIYUN::DTS::SynchronizationJob2",
  "Properties": {
    "Status": String,
    "Reserve": Map,
    "DataSynchronization": Boolean,
    "DelayPhone": String,
    "DedicatedClusterId": String,
    "ErrorNotice": Boolean,
    "DtsJobName": String,
    "DelayRuleTime": Integer,
    "DtsInstanceId": String,
    "DbList": Map,
    "FileOssUrl": String,
    "DataCheckConfigure": Map,
    "DtsBisLabel": String,
    "Checkpoint": String,
    "DisasterRecoveryJob": Boolean,
    "DtsJobId": String,
    "DelayNotice": Boolean,
    "DataInitialization": Boolean,
    "DestinationEndpoint": Map,
    "SourceEndpoint": Map,
    "ErrorPhone": String,
    "StructureInitialization": Boolean,
    "SynchronizationDirection": String,
    "SrcPrimaryVswId": String,
    "MaxDu": Integer,
    "DestPrimaryVswId": String,
    "DestSecondaryVswId": String,
    "SrcSecondaryVswId": String,
    "MinDu": Integer,
    "ResourceGroupId": String
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

Status

String

资源的状态。

取值:

  • Synchronizing:同步中。

  • Suspending:暂停。

  • Stopping:停止。

Reserve

Map

DTS的保留参数。

通过指定此参数,可以向DTS任务添加源实例或目标实例的更多配置。 例如,指定目的Kafka数据库的数据存储格式和CEN实例的ID。 

DataSynchronization

Boolean

是否进行增量数据迁移或增量数据同步。

取值:

  • true:进行增量数据迁移或增量数据同步。

  • false(默认值):不进行增量数据迁移或增量数据同步。

DelayPhone

String

延迟报警的联系人手机号码。

多个手机号码以英文逗号(,)分隔。

说明

DedicatedClusterId

String

DTS专属集群ID。

用于将同步任务调度到指定的DTS专属集群上。

ErrorNotice

Boolean

是否监控异常状态。

取值:

  • true:是监控异常状态。

  • false:不是监控异常状态。

DtsJobName

String

同步任务名称。

建议配置具有业务意义的名称(无唯一性要求),便于后续识别。

DelayRuleTime

Integer

触发延迟报警的阈值。

单位为秒且需为整数,可根据业务需要设置阈值,建议设置10秒以上,避免因网络、数据库负载等原因导致的延迟波动。

说明

DelayNotice取值为true时,本参数必须传入。

DtsInstanceId

String

同步实例ID。

DbList

Map

同步对象。

格式为JSON串。更多信息,请参见迁移、同步或订阅对象说明

FileOssUrl

String

任务文件的OSS地址。

DataCheckConfigure

Map

迁移或同步实例的数据校验任务。

格式为JSON字符串,如参数限制或告警配置等信息。更多信息请参见DataCheckConfigure属性

DtsBisLabel

String

DTS实例的环境标签。

取值:

  • normal:普通。

  • online:线上。

Checkpoint

String

增量数据迁移的启动位点或者同步位点。

格式为Unix时间戳,单位为秒。

DisasterRecoveryJob

Boolean

是否为灾备实例。

取值:

  • true:是。

  • false:否。

DtsJobId

String

同步任务ID。

DelayNotice

Boolean

是否监控延迟状态。

取值:

  • true:是。

  • false:否。

DataInitialization

Boolean

是否执行全量数据迁移或全量数据初始化。

取值:

  • true(默认值):执行全量数据迁移或全量数据初始化。

  • false:不执行全量数据迁移或全量数据初始化。

DestinationEndpoint

Map

目标实例配置。

更多信息,请参见DestinationEndpoint属性

SourceEndpoint

Map

源实例配置。

更多信息,请参见SourceEndpoint属性

ErrorPhone

String

异常报警的联系人手机号码。

多个手机号码以英文逗号(,)分隔。

说明

StructureInitialization

Boolean

是否执行库表结构迁移或初始化。

取值:

  • true(默认值):执行库表结构迁移或初始化。

  • false:不执行库表结构迁移或初始化。

SynchronizationDirection

String

同步方向。

取值:

  • Forward(默认值):正向。

  • Reverse:反向。

说明

只有当同步任务的同步拓扑为双向时,本参数传入Reverse才会生效。

SrcPrimaryVswId

String

VPC NAT源端的主VSW ID。

MaxDu

Integer

DU的上限。

只有serverless类型的实例支持此参数。

DestPrimaryVswId

String

VPC NAT目的端的主VSW ID。

DestSecondaryVswId

String

VPC NAT目标端的辅VSW ID。

SrcSecondaryVswId

String

VPC NAT源端的辅VSW ID。

MinDu

Integer

DU的下限。

只有serverless类型的实例支持此参数。

ResourceGroupId

String

资源组的ID。

DataCheckConfigure语法

"DataCheckConfigure": {
  "fullCheckMaxReadRps": Integer,
  "dataCheckNoticePhone": String,
  "incrementalCheckDelayNotice": Boolean,
  "incrementalCheckDelayNoticeValue": Integer,
  "incrementalCheckDelayNoticePeriod": Integer,
  "dataCheckDbList": String,
  "checkMaximumHourEnable": Integer,
  "fullCheckRatio": Integer,
  "checkMaximumHour": Integer,
  "fullCheckFixData": Boolean,
  "fullCheckModel": Integer,
  "incrementalCheckValidFailNoticeValue": Integer,
  "incrementalDataCheck": Boolean,
  "incrementalCheckValidFailNoticeTimes": Integer,
  "fullCheckMaxReadBps": Integer,
  "fullCheckValidFailNotice": Boolean,
  "fullCheckErrorNotice": Boolean,
  "incrementalCheckValidFailNoticePeriod": Integer,
  "incrementalCheckDelayNoticeTimes": Integer,
  "fullCheckReferEndpoint": String,
  "fullDataCheck": Boolean,
  "incrementalCheckValidFailNotice": Boolean,
  "fullCheckNoticeValue": Integer,
  "incrementalCheckErrorNotice": Boolean
}

DataCheckConfigure属性

属性名称

类型

必须

允许更新

描述

约束

fullCheckMaxReadRps

Integer

每秒读取数据的最大行数。

取值为0~9007199254740991的整数。

说明

取值为0时表示不做限制。

dataCheckNoticePhone

String

全量或增量数据校验任务告警联系人的手机号。

当校验任务触发告警时,将以短信的形式通知告警联系人。

incrementalCheckDelayNotice

Boolean

是否进行增量数据延迟告警。

取值:

  • true:进行增量数据延迟告警。

    说明

    如果增量校验任务累计在若干个周期的延迟均大于等于设置的阈值则触发告警。

  • false:不进行增量数据延迟告警。

incrementalCheckDelayNoticeValue

Integer

增量数据校验任务延迟时间的告警阈值。

单位为秒。

说明

incrementalCheckDelayNotice取值为true时必填。

incrementalCheckDelayNoticePeriod

Integer

增量数据校验任务延迟告警的统计周期。

取值:

  • 1:表示周期为1分钟。

  • 2:表示周期为5分钟。

  • 3:表示周期为10分钟。

  • 4:表示周期为30分钟。

说明

incrementalCheckDelayNotice取值为true时必填。

dataCheckDbList

String

数据校验对象。

checkMaximumHourEnable

Integer

全量数据校验任务是否配置超时设置。

取值:

  • 0:不配置超时设置。

  • 1:配置超时设置。

说明

fullCheckModel取值为1时必填。

fullCheckRatio

Integer

全量数据校验任务的抽样比例。

取值为10~100的整数,单位为%。

说明

fullCheckModel取值为1时必填。

checkMaximumHour

Integer

全量数据校验任务的超时设置。

取值为1~72的整数。在全量数据校验任务启动后开始计时,若校验任务未在指定时间完成则强制结束。

fullCheckFixData

Boolean

是否补齐数据。

取值:

  • true:补齐数据。

    说明

    如果目标库有跟原库不一致的数据,则会用源库的数据值替换目标库的数据值。

  • false(默认值):不补齐数据。

fullCheckModel

Integer

全量数据校验任务的模式。

取值:

  • 1:按抽样比例进行校验。

  • 2:按行进行校验。

incrementalCheckValidFailNoticeValue

Integer

增量数据校验任务不一致数据的告警阈值。

incrementalCheckValidFailNotice取值为true时必填。

incrementalDataCheck

Boolean

是否进行增量数据校验。

取值:

  • true:进行增量数据校验。

  • false:不进行增量数据校验。

incrementalCheckValidFailNoticeTimes

Integer

增量数据校验任务不一致告警统计周期的数量。

incrementalCheckValidFailNotice取值为true时必填。

fullCheckMaxReadBps

Integer

每秒读取的最大数据量(Byte)。

取值为0~9007199254740991的整数。

说明

取值为0时表示不做限制。

fullCheckValidFailNotice

Boolean

是否进行全量校验数据不一致告警。

取值:

  • true:进行全量校验数据不一致告警。

    说明

    全量校验任务不一致数据的数量大于等于设置的阈值则触发告警。

  • false:不进行全量校验数据不一致告警。

fullCheckErrorNotice

Boolean

是否进行全量数据校验失败告警。

取值:

  • true:进行全量数据校验失败告警。

    说明

    全量数据校验任务失败则触发告警。

  • false:不进行全量数据校验失败告警。

incrementalCheckValidFailNoticePeriod

Integer

增量数据校验任务不一致告警统计的周期。

取值:

  • 1:表示周期为1分钟。

  • 2:表示周期为5分钟。

  • 3:表示周期为10分钟。

  • 4:表示周期为30分钟。

说明

incrementalCheckValidFailNotice取值为true时必填。

incrementalCheckDelayNoticeTimes

Integer

增量数据校验任务延迟告警统计周期的数量。

incrementalCheckDelayNotice取值为true时必填。

fullCheckReferEndpoint

String

全量数据校验的基准。

取值:

  • all:以源库和目标库数据的合集为基准,校验源库和目标库不一致的数据。

  • src:以源库为基准,校验目标库与源库数据的一致性(不校验目标库比源库多的数据)。

  • dest:以目标库为基准,校验源库与目标库数据的一致性(不校验源库比目标库多的数据)。

fullDataCheck

Boolean

是否进行全量数据校验。

取值:

  • true:进行全量数据校验。

  • false:不进行全量数据校验。

incrementalCheckValidFailNotice

Boolean

是否进行增量校验数据不一致告警。

取值:

  • true:进行增量校验数据不一致告警。

    说明

    如果增量校验任务累计在若干个周期的不一致记录量均大于等于设置的阈值则触发告警。

  • false:不进行增量校验数据不一致告警。

fullCheckNoticeValue

Integer

全量数据校验不一致数据的告警阈值。

fullCheckValidFailNotice取值为true时必填。

incrementalCheckErrorNotice

Boolean

是否进行增量数据校验失败告警。

取值:

  • true:进行增量数据校验失败告警。

    说明

    增量数据校验任务失败则触发告警。

  • false:不进行增量数据校验失败告警。

DestinationEndpoint语法

"DestinationEndpoint": {
  "Role": String,
  "OracleSID": String,
  "UserName": String,
  "OwnerID": String,
  "InstanceID": String,
  "IP": String,
  "Port": String,
  "DatabaseName": String,
  "Region": String,
  "InstanceType": String,
  "EngineName": String,
  "Password": String
}

DestinationEndpoint属性

属性名称

类型

必须

允许更新

描述

约束

InstanceType

String

目标库的实例类型。

取值:

  • ECS:ECS上的自建数据库。

  • LocalInstance:有公网IP的自建数据库。

  • RDS:阿里云RDS实例。

  • DRDS:阿里云PolarDB-X实例。

  • MongoDB:阿里云MongoDB实例。

  • Redis:阿里云Redis实例。

  • PetaData:阿里云HybridDB for MySQL实例。

  • PolarDB:阿里云PolarDB MySQL、PolarDB PostgreSQL。

  • PolarDB_o:阿里云PolarDB O引擎集群。

  • AnalyticDB:阿里云云原生数据仓库AnalyticDB MySQL 3.02.0版本。

  • Greenplum:阿里云云原生数据仓库AnalyticDB PostgreSQL。

Role

String

为拥有目标实例的阿里云账户配置的资源访问管理(RAM角色)的名称。

在不同阿里云账户间进行数据迁移或同步时,需要配置此项。 

OracleSID

String

Oracle数据库的SID信息。

当取值为Oracle,且Oracle数据库为非RAC实例时,本参数才可用且必须传入。

UserName

String

目标库的数据库账号。

迁移不同的数据库所需的权限有所差异,请参见迁移方案概览中对应的配置案例。

OwnerID

String

目的数据库所属的阿里云账号ID。

仅在配置跨阿里云账号的数据迁移时本参数才可用,且必须传入。

InstanceID

String

目标实例ID。

当取值为RDSECSMongoDBRedisDRDSPetaDataOceanBasePolarDBPolarDB_oAnalyticDBGreenplum时,本参数才可用且必须传入对应的实例ID(例如取值为ECS,则需要传入ECS实例ID)。

IP

String

目标库的连接地址。

当取值为LocalInstanceExpress时,本参数才可用且必须传入。

Port

String

目标库的服务端口。

当取值为ECSLocalInstanceExpress时,本参数才可用且必须传入。

DatabaseName

String

待迁入的数据库名称或鉴权数据库名称。

取值:

  • DestinationEndpoint.EngineName取值为PostgreSQLDRDSMongoDB时,本参数才可用且必须传入。

  • DestinationEndpoint.EngineName取值为PostgreSQLDRDS时,传入待迁移的数据库名称;取值为MongoDB时,传入数据库账号的鉴权数据库名称。

Region

String

目标库所属的地域ID。

当取值为LocalInstance时,您可以传入cn-hangzhou或者离自建数据库地理距离最近的地域ID,请参见支持的地域列表

EngineName

String

目标库的数据库类型。

取值:

  • MySQL

  • DRDS

  • SQLServer

  • PostgreSQL

  • PPAS

  • MongoDB

  • Redis

  • PolarDB

  • polardb_pg

说明

当取值为RDSPolarDBECSLocalInstanceExpress时,本参数才可用且必须传入。

Password

String

目标库数据库账号的密码。

SourceEndpoint语法

"SourceEndpoint": {
  "OracleSID": String,
  "UserName": String,
  "InstanceID": String,
  "IP": String,
  "Port": String,
  "VSwitchID": String,
  "DatabaseName": String,
  "EngineName": String,
  "Role": String,
  "OwnerID": String,
  "Region": String,
  "InstanceType": String,
  "Password": String
}

SourceEndpoint属性

属性名称

类型

必须

允许更新

描述

约束

InstanceType

String

源库的实例类型。

取值:

  • RDS:阿里云RDS实例。

  • ECS:ECS上的自建数据库。

  • LocalInstance:有公网IP的自建数据库。

  • Express:通过专线/VPN网关/智能接入网关接入的自建数据库。

  • dg:通过数据库网关DG接入的自建数据库。

  • cen:通过云企业网CEN接入的自建数据库。

  • MongoDB:阿里云MongoDB实例。

  • PolarDB:阿里云PolarDB MySQL、PolarDB PostgreSQL。

  • PolarDB_o:阿里云PolarDB O引擎集群。

OracleSID

String

Oracle数据库的SID信息。

当取值为Oracle,且Oracle数据库为非RAC实例时,本参数才可用且必须传入。

UserName

String

源库的数据库账号。

迁移不同的数据库所需的权限有所差异,请参见迁移方案概览中对应的配置案例。

InstanceID

String

源库的实例ID。

  • SourceEndpoint.InstanceType取值为RDSECSExpressMongoDBPolarDBPolarDB_o时,本参数才可用且必须传入对应的实例ID(例如取值为ECS,则本参数传入ECS实例的ID)。

  • SourceEndpoint.InstanceType取值为Express时,本参数传入VPC ID(即专有网络ID)。

IP

String

源库的连接地址。

当取值为LocalInstanceExpress时,本参数才可用且必须传入。

Port

String

源库的服务端口。

当取值为ECSLocalInstanceExpress时,本参数才可用且必须传入。

VSwitchID

String

用于数据传输链路的vSwitchID。 

DatabaseName

String

待迁移的数据库名称或鉴权数据库名称。

  • SourceEndpoint.EngineName取值为PostgreSQLMongoDB时,本参数才可用且必须传入。

  • SourceEndpoint.EngineName取值为PostgreSQL时,传入待迁移的数据库名称;取值为MongoDB时,传入数据库账号的鉴权数据库名称。

EngineName

String

源库的数据库类型。

取值:

  • MySQL

  • TiDB

  • SQLServer

  • PostgreSQL

  • Oracle

  • MongoDB

  • Redis

  • PolarDB

  • polardb_pg

说明

当取值为RDSPolarDBECSLocalInstanceExpress时,本参数才可用且必须传入。

Role

String

指定源实例的授权角色。

当源实例与目标实例所属阿里云账号不同时,需传入该参数,来指定源实例的授权角色,以允许目标实例阿里云账号访问源实例的实例信息。

说明

角色所需的权限及授权方式,请参见跨阿里云账号任务如何配置RAM授权

OwnerID

String

源实例所属的阿里云账号ID。

仅在配置跨阿里云账号的数据迁移时本参数才可用,且必须传入。

Region

String

源库所属的地域ID。

当取值为LocalInstance时,您可以传入cn-hangzhou或者离自建数据库地理距离最近的地域ID,请参见支持的地域列表

Password

String

源库数据库账号的密码。

返回值

Fn::GetAtt

  • DtsJobId:任务ID。

  • DtsJobName:DTS作业的名称。

  • DtsInstanceId:DTS实例ID。

示例

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  SourceEndpoint:
    AssociationPropertyMetadata:
      Parameters:
        UserName:
          Default: null
          Type: String
          Description:
            en: >-
              The database account of the source database.

              **Note**: In most cases, this parameter is required. The
              permissions that are required for the database account vary with
              the migration or synchronization scenario.
        Password:
          Default: null
          Type: String
          Description:
            en: The password of the source database account.
        InstanceID:
          Default: null
          Type: String
          Description:
            en: >-
              The ID of the source instance. If the source instance is an
              Alibaba Cloud database instance, you must specify the ID of the
              database instance. For example, 

              - If the source instance is an ApsaraDB RDS for MySQL instance,
              you must specify the ID of the ApsaraDB RDS for MySQL instance. 

              - If the source instance is a self-managed database, the value of
              this parameter varies with the value of
              SourceEndpointInstanceType.

              - If InstanceType is set to ECS, you must specify the ID of the
              ECS instance.

              - If InstanceType is set to DG, you must specify the ID of the
              database gateway.

              - If InstanceType is set to EXPRESS or CEN, you must specify the
              ID of the VPC that is connected to the source instance.

              **Note**: If DestinationEndpointInstanceType is set to CEN, you
              must also specify the ID of the CEN instance in the Reserve
              parameter.
        IP:
          Default: null
          Type: String
          Description:
            en: >-
              The IP address of the source instance. 

              **Note**: This parameter is required only when **InstanceType** is
              set to **OTHER**, **EXPRESS**, **DG**, or **CEN**.
        Region:
          Default: null
          Type: String
          Description:
            en: >-
              The ID of the region in which the source instance resides.

              **Note**: If the source instance is an Alibaba Cloud database
              instance, this parameter is required.
        InstanceType:
          Type: String
          Description:
            en: >-
              The type of the source instance. Valid values:

              Alibaba Cloud database instances:

              - **RDS**: ApsaraDB RDS for MySQL instance, ApsaraDB RDS for SQL
              Server instance, ApsaraDB RDS for PostgreSQL instance, or ApsaraDB
              RDS for MariaDB TX instance

              - **PolarDB**: PolarDB for MySQL cluster

              - **REDIS**: ApsaraDB for Redis instance

              - **DISTRIBUTED_POLARDBX10**: PolarDB-X 1.0 (formerly DRDS)
              instance

              - **POLARDBX20**: PolarDB-X 2.0 instance

              - **MONGODB**: ApsaraDB for MongoDB instance

              - **DISTRIBUTED_DMSLOGICDB**: Data Management (DMS) logical
              database

              Self-managed databases:

              - **OTHER**: self-managed database with a public IP address

              - **ECS**: self-managed database hosted on an Elastic Compute
              Service (ECS) instance

              - **EXPRESS**: self-managed database connected over Express
              Connect

              - **CEN**: self-managed database connected over Cloud Enterprise
              Network (CEN)

              - **DG**: self-managed database connected over Database Gateway

              **Note**: If the source instance is a PolarDB for PostgreSQL
              cluster (compatible with Oracle), you must set this parameter to
              **OTHER** or **EXPRESS**. Then, you can connect the PolarDB for
              PostgreSQL cluster to DTS as a self-managed database by using a
              public IP address or Express Connect. If the source instance is a
              self-managed database, you must deploy the network environment for
              the database. 
        VSwitchID:
          Default: null
          Type: String
          Description:
            en: The ID of the vSwitch used for the data shipping link.
        DatabaseName:
          Default: null
          Type: String
          Description:
            en: >-
              The name of the database which contains the objects to be migrated
              in the source instance.

              **Note**: This parameter is required only when the source instance
              is a PolarDB for PostgreSQL cluster (compatible with Oracle), a
              PostgreSQL database, or a MongoDB database.
        EngineName:
          Default: null
          Type: String
          Description:
            en: >-
              The database engine of the source instance. Valid values:

              - **MYSQL**: ApsaraDB RDS for MySQL instance or self-managed MySQL
              database

              - **MARIADB**: ApsaraDB RDS for MariaDB TX instance

              - **PolarDB**: PolarDB for MySQL cluster

              - **POLARDB_O**: PolarDB for PostgreSQL cluster (compatible with
              Oracle)

              - **POLARDBX10**: PolarDB-X 1.0 instance

              - **POLARDBX20**: PolarDB-X 2.0 instance

              - **ORACLE**: self-managed Oracle database

              - **POSTGRESQL**: ApsaraDB RDS for PostgreSQL instance or
              self-managed PostgreSQL database

              - **MSSQL**: ApsaraDB RDS for SQL Server instance or self-managed
              SQL Server database

              - **MONGODB**: ApsaraDB for MongoDB instance or self-managed
              MongoDB database

              - **DB2**: self-managed Db2 for LUW database

              - **AS400**: self-managed Db2 for i database

              - **DMSPOLARDB**: DMS logical database

              - **HBASE**: self-managed HBase database

              - **TERADATA**: Teradata database

              - **TiDB**: TiDB database

              - **REDIS**: ApsaraDB for Redis instance or self-managed Redis
              database

              **Note**: Default value: **MYSQL**.

              If EngineName is set to **MONGODB**, you must also specify the
              architecture type of the **MongoDB** database in the **Reserve**
              parameter.
        Role:
          Default: null
          Type: String
          Description:
            en: >-
              The name of the Resource Access Management (RAM) role configured
              for the Alibaba Cloud account that owns the source instance.

              **Note**: This parameter is required when you migrate or
              synchronize data across different Alibaba Cloud accounts.
        OwnerID:
          Default: null
          Type: String
          Description:
            en: >-
              The ID of the Alibaba Cloud account to which the source database
              belongs.

              **Note**: You can specify this parameter to migrate or synchronize
              data across different Alibaba Cloud accounts. In this case, you
              must specify **Role**.
        OracleSID:
          Default: null
          Type: String
          Description:
            en: >-
              The system ID (SID) of the Oracle database.

              **Note**: This parameter is required only when **EngineName** is
              set to **ORACLE** and the Oracle database is deployed in an
              architecture that is not a Real Application Cluster (RAC).
        Port:
          Default: null
          Type: String
          Description:
            en: >-
              The port number of the source instance.

              **Note**: This parameter is required only when the source instance
              is a self-managed database.
    Type: Json
    Description:
      en: Source instance configuration.
  Checkpoint:
    Default: null
    Type: String
    Description:
      en: >-
        The start offset of incremental data migration or synchronization. This
        value is a UNIX timestamp representing the number of seconds that have
        elapsed since January 1, 1970, 00:00:00 UTC.
  Status:
    Default: null
    Type: String
    Description:
      en: |-
        The status of the resource. Valid values:
        - **Synchronizing**: Start the task.
        - **Suspending**: Suspend the task.
        - **Stopping**: Stop the task.
    AllowedValues:
      - Synchronizing
      - Suspending
      - Stopping
  DisasterRecoveryJob:
    Default: null
    Type: Boolean
    Description:
      en: >-
        Specifies whether the instance is a disaster recovery instance. Valid
        values: **true** and **false**
  DtsJobId:
    Default: null
    Type: String
    Description:
      en: The ID of the DTS task.
  DtsJobName:
    Type: String
    Description:
      en: The name of the DTS instance.
  DataSynchronization:
    Type: Boolean
    Description:
      en: >-
        Specifies whether to perform incremental data migration or incremental
        data synchronization. Default value: **false**. Valid values: **true**
        and **false**.
  SynchronizationDirection:
    Default: null
    Type: String
    Description:
      en: >-
        The synchronization direction. Default value: Forward. Valid values:

        - **Forward**: Data is synchronized from the source database to the
        destination database.

        - **Reverse**: Data is synchronized from the destination database to the
        source database.

        **Note**: The default value is **Forward**.

        The value Reverse takes effect only if the topology of the data
        synchronization task is two-way synchronization.
  DataCheckConfigure:
    Default: null
    AssociationPropertyMetadata:
      Parameters:
        fullCheckErrorNotice:
          Default: null
          Type: Boolean
          Description:
            en: >-
              Specifies whether to trigger an alert if the full data
              verification task fails. Valid values: **true** and **false**.

              **Note**: For example, you set this parameter to **true**. If the
              full data verification task fails, an alert is triggered.
        fullCheckValidFailNotice:
          Default: null
          Type: Boolean
          Description:
            en: >-
              Specifies whether to trigger an alert if inconsistent data is
              detected by the full data verification task. Valid values:
              **true** and **false**.

              **Note**: For example, you set this parameter to true. If the
              number of inconsistent data entries detected by the full data
              verification task is greater than or equal to the threshold that
              you specified, an alert is triggered.
        incrementalCheckValidFailNotice:
          Default: null
          Type: Boolean
          Description:
            en: >-
              Specifies whether to trigger an alert if inconsistent data is
              detected by the incremental data verification task. Valid values:
              **true** and **false**.

              **Note**: For example, you set this parameter to **true**. If the
              cumulative number of inconsistent data entries detected by the
              incremental data verification task in several statistical periods
              is greater than or equal to the threshold that you specified, an
              alert is triggered.
        dataCheckNoticePhone:
          Default: null
          Type: String
          Description:
            en: >-
              The mobile number of the alert contact for a full or incremental
              data verification task. If an alert is triggered for a
              verification task, a text message is sent to notify the alert
              contact.
        fullCheckReferEndpoint:
          Default: null
          Type: String
          Description:
            en: >-
              The benchmark for full data verification. Valid values:

              - **all**: checks the data consistency between the source and
              destination databases based on the source and destination
              databases.

              - **src**: checks the data consistency between the source and
              destination databases based on the source database. Objects that
              exist in the destination database but do not exist in the source
              database are not checked.

              - **dest**: checks the data consistency between the source and
              destination databases based on the destination database. Objects
              that exist in the source database but do not exist in the
              destination database are not checked.
        fullCheckModel:
          Default: null
          Type: Number
          Description:
            en: |-
              The mode of the full data verification task. Valid values:
              - **1**: verifies the data by sampling ratio.
              - **2**: verifies the data by row.
          AllowedValues:
            - 1
            - 2
        incrementalCheckDelayNotice:
          Default: null
          Type: Boolean
          Description:
            en: >-
              Specifies whether to trigger an alert on the data latency of the
              incremental data verification task. Valid values: **true** and
              **false**.

              **Note**: For example, you set this parameter to **true**. If the
              cumulative latency of the incremental data verification task in
              several statistical periods is greater than or equal to the
              threshold that you specified, an alert is triggered.
        incrementalCheckValidFailNoticePeriod:
          Default: null
          Type: Number
          Description:
            en: >-
              The statistical period of an alert on inconsistent data entries
              detected by the incremental data verification task. Valid values:

              - **1**: 1 minute

              - **2**: 5 minutes

              - **3**: 10 minutes

              - **4**: 30 minutes

              **Note**: This parameter is required if the
              **incrementalCheckValidFailNotice** parameter is set to **true**.
          AllowedValues:
            - 1
            - 2
            - 3
            - 4
        incrementalCheckDelayNoticeTimes:
          Default: null
          Type: Number
          Description:
            en: >-
              The number of statistical periods of an alert on the data latency
              of the incremental data verification task.

              **Note**: This parameter is required if the
              **incrementalCheckDelayNotice** parameter is set to **true**.
        fullCheckMaxReadBps:
          Default: null
          MinValue: 0
          Type: Number
          Description:
            en: >-
              The maximum number of bytes that are read per second. Valid
              values: integers from 0 to 9007199254740991.
          MaxValue: 9007199254740991
        incrementalCheckValidFailNoticeTimes:
          Default: null
          Type: Number
          Description:
            en: >-
              The number of statistical periods of an alert on inconsistent data
              entries detected by the incremental data verification task.

              **Note**: This parameter is required if the
              **incrementalCheckValidFailNotice** parameter is set to **true**.
        fullCheckMaxReadRps:
          Default: null
          MinValue: 0
          Type: Number
          Description:
            en: >-
              The maximum number of data rows that are read per second. Valid
              values: integers from 0 to 9007199254740991.
          MaxValue: 9007199254740991
        incrementalCheckValidFailNoticeValue:
          Default: null
          Type: Number
          Description:
            en: >-
              The alert threshold for inconsistent data entries detected by the
              incremental data verification task.

              **Note**: This parameter is required if the
              **incrementalCheckValidFailNotice** parameter is set to **true**.
        fullDataCheck:
          Default: null
          Type: Boolean
          Description:
            en: >-
              Specifies whether to perform a full data verification task. Valid
              values: **true** and **false**.
        fullCheckRatio:
          Default: null
          MinValue: 10
          Type: Number
          Description:
            en: >-
              The sampling ratio of the full data verification task. Valid
              values: integers from 10 to 100. Unit: percent.

              **Note**: This parameter is required if the **fullCheckModel**
              parameter is set to 1.
          MaxValue: 100
        incrementalCheckDelayNoticeValue:
          Default: null
          Type: Number
          Description:
            en: >-
              The alert threshold for the data latency of the incremental data
              verification task. Unit: seconds.

              **Note**: This parameter is required if the
              **incrementalCheckDelayNotice** parameter is set to **true**.
        checkMaximumHourEnable:
          Default: null
          Type: Number
          Description:
            en: >-
              Specifies whether to configure a timeout period for the full data
              verification task.Valid values:

              - **0**: does not configure a timeout period for the full data
              verification task.

              - **1**: configures a timeout period for the full data
              verification task.

              **Note**: This parameter is required if the fullCheckModel
              parameter is set to 1.
          AllowedValues:
            - 0
            - 1
        dataCheckDbList:
          Default: null
          Type: String
          Description:
            en: >-
              The objects whose data is to be verified. The value must be a JSON
              string.
        incrementalCheckErrorNotice:
          Default: null
          Type: Boolean
          Description:
            en: >-
              Specifies whether to trigger an alert if the incremental data
              verification task fails. Valid values: **true** and **false**.

              Note: For example, you set this parameter to **true**. If the
              incremental data verification task fails, an alert is triggered.
        checkMaximumHour:
          Default: null
          MinValue: 1
          Type: Number
          Description:
            en: >-
              The timeout period of the full data verification task. Valid
              values: integers from 1 to 72. Countdown begins the moment the
              full data verification task is started. If the task is not
              complete within the specified timeout period, the task is forcibly
              stopped.
          MaxValue: 72
        incrementalCheckDelayNoticePeriod:
          Default: null
          Type: Number
          Description:
            en: >-
              The statistical period of an alert on the data latency of the
              incremental data verification task. Valid values:

              - **1**: 1 minute

              - **2**: 5 minutes

              - **3**: 10 minutes

              - **4**: 30 minutes

              **Note**: This parameter is required if the
              **incrementalCheckDelayNotice** parameter is set to **true**.
          AllowedValues:
            - 1
            - 2
            - 3
            - 4
        fullCheckFixData:
          Default: null
          Type: Boolean
          Description:
            en: >-
              Specifies whether to replace the inconsistent data. Valid values:
              **true** and **false**. Default value: false.

              **Note**: For example, you set this parameter to true. If the
              destination database has data that is inconsistent with the data
              in the source database, the data values of the destination
              database are replaced with those of the source database.
        fullCheckNoticeValue:
          Default: null
          Type: Number
          Description:
            en: >-
              The alert threshold for inconsistent data entries detected by the
              full data verification task.

              **Note**: This parameter is required if the
              **fullCheckValidFailNotice** parameter is set to **true**.
        incrementalDataCheck:
          Default: null
          Type: Boolean
          Description:
            en: >-
              Specifies whether to perform an incremental data verification
              task. Valid values: **true** and **false**.
    Type: Json
    Description:
      en: >-
        The data verification task for a data migration or synchronization
        instance.
  StructureInitialization:
    Type: Boolean
    Description:
      en: >-
        Specifies whether to perform schema migration or schema synchronization.
        Default value: true. Valid values: **true** and **false**.
  DelayRuleTime:
    Default: null
    Type: Number
    Description:
      en: >-
        The threshold for latency alerts. Unit: seconds. You can set the
        threshold based on your business requirements. To prevent jitters caused
        by network and database overloads, we recommend that you set the
        threshold to more than 10 seconds.
  ErrorPhone:
    Default: null
    Type: String
    Description:
      en: >-
        The mobile numbers that receive status-related alerts. Separate multiple
        mobile numbers with commas (,).

        **Note**: This parameter is available only for users of the China site
        (aliyun.com). Only mobile numbers in the Chinese mainland are supported.
        You can specify up to 10 mobile numbers. Users of the international site
        (alibabacloud.com) cannot receive alerts by using mobile numbers, but
        can configure alert rules for DTS tasks in the CloudMonitor console.
  DtsInstanceId:
    Default: null
    Type: String
    Description:
      en: The ID of the DTS instance.
  DestinationEndpoint:
    AssociationPropertyMetadata:
      Parameters:
        UserName:
          Default: null
          Type: String
          Description:
            en: >-
              The database account of the destination database.

              **Note**: In most cases, this parameter is required. The
              permissions that are required for the database account vary with
              the migration or synchronization scenario.
        Password:
          Default: null
          Type: String
          Description:
            en: The password of the destination database account.
        InstanceID:
          Default: null
          Type: String
          Description:
            en: >-
              The ID of the destination instance. If the destination instance is
              an Alibaba Cloud database instance, you must specify the ID of the
              database instance. For example, 

              - If the destination instance is an ApsaraDB RDS for MySQL
              instance, you must specify the ID of the ApsaraDB RDS for MySQL
              instance. 

              - If the destination instance is a self-managed database, the
              value of this parameter varies with the value of
              SourceEndpointInstanceType.

              - If InstanceType is set to ECS, you must specify the ID of the
              ECS instance.

              - If InstanceType is set to DG, you must specify the ID of the
              database gateway.

              - If InstanceType is set to EXPRESS or CEN, you must specify the
              ID of the VPC that is connected to the destination instance.

              **Note**: If DestinationEndpointInstanceType is set to CEN, you
              must also specify the ID of the CEN instance in the Reserve
              parameter.
        IP:
          Default: null
          Type: String
          Description:
            en: >-
              The IP address of the destination instance. 

              **Note**: This parameter is required only when **InstanceType** is
              set to **OTHER**, **EXPRESS**, **DG**, or **CEN**.
        Region:
          Default: null
          Type: String
          Description:
            en: >-
              The ID of the region in which the destination instance resides.

              **Note**: If the source instance is an Alibaba Cloud database
              instance, this parameter is required.
        InstanceType:
          Type: String
          Description:
            en: >-
              The type of the destination instance. Valid values:

              Alibaba Cloud database instances

              - **RDS**: ApsaraDB RDS for MySQL instance, ApsaraDB RDS for SQL
              Server instance, ApsaraDB RDS for PostgreSQL instance, or ApsaraDB
              RDS for MariaDB TX instance

              - **PolarDB**: PolarDB for MySQL cluster

              - **DISTRIBUTED_POLARDBX10**: PolarDB-X 1.0 (formerly DRDS)
              instance

              - **POLARDBX20**: PolarDB-X 2.0 instance

              - **REDIS**: ApsaraDB for Redis instance

              - **ADS**: AnalyticDB for MySQL V2.0 cluster or AnalyticDB for
              MySQL V3.0 cluster

              - **MONGODB**: ApsaraDB for MongoDB instance

              - **GREENPLUM**: AnalyticDB for PostgreSQL instance

              - **DATAHUB**: DataHub project

              - **ELK**: Elasticsearch cluster

              - **Tablestore**: Tablestore instance

              - **ODPS**: MaxCompute project

              Self-managed databases

              - **OTHER**: self-managed database with a public IP address

              - **ECS**: self-managed database hosted on an ECS instance

              - **EXPRESS**: self-managed database connected over Express
              Connect

              - **CEN**: self-managed database connected over CEN

              - **DG**: self-managed database connected over Database Gateway

              **Note**: If the destination instance is a PolarDB for PostgreSQL
              cluster (compatible with Oracle), you must set this parameter to
              OTHER or EXPRESS. Then, you can connect the PolarDB for PostgreSQL
              cluster (compatible with Oracle) to DTS as a self-managed database
              by using a public IP address or Express Connect.

              If the destination instance is a Message Queue for Apache Kafka
              instance, you must set this parameter to ECS or EXPRESS. Then, you
              can connect the Message Queue for Apache Kafka instance to DTS as
              a self-managed database connected over ECS or Express Connect.

              If the destination instance is a self-managed database, you must
              deploy the network environment for the database.
        Role:
          Default: null
          Type: String
          Description:
            en: >-
              The name of the Resource Access Management (RAM) role configured
              for the Alibaba Cloud account that owns the destination instance.

              **Note**: This parameter is required when you migrate or
              synchronize data across different Alibaba Cloud accounts.
        DatabaseName:
          Default: null
          Type: String
          Description:
            en: >-
              The name of the database which contains the objects to be migrated
              in the destination instance.

              **Note**: This parameter is required only when the destination
              instance is a PolarDB for PostgreSQL cluster (compatible with
              Oracle), a PostgreSQL database, or a MongoDB database.
        EngineName:
          Default: null
          Type: String
          Description:
            en: >-
              The database engine of the destination instance. Valid values:

              - **MYSQL**: ApsaraDB RDS for MySQL instance or self-managed MySQL
              database

              - **MARIADB**: ApsaraDB RDS for MariaDB TX instance

              - **PolarDB**: PolarDB for MySQL cluster

              - **POLARDB_O**: PolarDB for PostgreSQL cluster (compatible with
              Oracle)

              - **POLARDBX10**: PolarDB-X 1.0 instance

              - **POLARDBX20**: PolarDB-X 2.0 instance

              - **ORACLE**: self-managed Oracle database

              - **POSTGRESQL**: ApsaraDB RDS for PostgreSQL instance or
              self-managed PostgreSQL database

              - **MSSQL**: ApsaraDB RDS for SQL Server instance or self-managed
              SQL Server database

              - **ADS**: AnalyticDB for MySQL V2.0 cluster

              - **ADB30**: AnalyticDB for MySQL V3.0 cluster- **MONGODB**:
              ApsaraDB for MongoDB instance or self-managed MongoDB database

              - **GREENPLUM**: AnalyticDB for PostgreSQL instance

              - **KAFKA**: Message Queue for Apache Kafka instance or
              self-managed Kafka cluster

              - **DATAHUB**: DataHub project- **DB2**: self-managed Db2 for LUW
              database

              - **AS400**: self-managed Db2 for i database

              - **ODPS**: MaxCompute project

              - **Tablestore**: Tablestore instance

              - **ELK**: Elasticsearch cluster

              - **REDIS**: ApsaraDB for Redis instance or self-managed Redis
              database

              **Note**: Default value: **MYSQL**.

              If this parameter is set to **KAFKA**, **MONGODB**, or
              **PolarDB**, you must also specify the database information in the
              Reserve parameter.
        OwnerID:
          Default: null
          Type: String
          Description:
            en: >-
              The ID of the Alibaba Cloud account to which the destination
              database belongs.

              **Note**: You can specify this parameter to migrate or synchronize
              data across different Alibaba Cloud accounts. In this case, you
              must specify **Role**.
        OracleSID:
          Default: null
          Type: String
          Description:
            en: >-
              The system ID (SID) of the Oracle database.

              **Note**: This parameter is required only when **EngineName** is
              set to **ORACLE** and the Oracle database is deployed in an
              architecture that is not a Real Application Cluster (RAC).
        Port:
          Default: null
          Type: String
          Description:
            en: >-
              The port number of the destination instance.

              **Note**: This parameter is required only when the destination
              instance is a self-managed database.
    Type: Json
    Description:
      en: Destination instance configuration.
  ErrorNotice:
    Default: null
    Type: Boolean
    Description:
      en: >-
        Specifies whether to monitor the task status. Valid values: **true** and
        **false**.
  FileOssUrl:
    Default: null
    Type: String
    Description:
      en: >-
        The URL of the Object Storage Service (OSS) bucket that stores the files
        related to the DTS task.
  Reserve:
    Default: null
    Type: Json
    Description:
      en: >-
        The reserved parameter of DTS. You can specify this parameter to add
        more configurations of the source or destination instance to the DTS
        task. For example, you can specify the data storage format of the
        destination Kafka database and the ID of the CEN instance. 
  DelayPhone:
    Default: null
    Type: String
    Description:
      en: >-
        The mobile numbers that receive latency-related alerts. Separate
        multiple mobile numbers with commas (,).

        **Note**: This parameter is available only for users of the China site
        (aliyun.com). Only mobile numbers in the Chinese mainland are supported.
        You can specify up to 10 mobile numbers. Users of the international site
        (alibabacloud.com) cannot receive alerts by using mobile numbers, but
        can configure alert rules for DTS tasks in the CloudMonitor console.
  DelayNotice:
    Default: null
    Type: Boolean
    Description:
      en: >-
        Specifies whether to monitor the task latency. Valid values: **true**
        and **false**
  DataInitialization:
    Type: Boolean
    Description:
      en: >-
        Specifies whether to perform full data migration or full data
        synchronization. Default value: **true**. Valid values: **true** and
        **false**.
  DtsBisLabel:
    Default: null
    Type: String
    Description:
      en: >-
        The environment tag of the DTS instance. Valid values: **normal** and
        **online**.
  DbList:
    Type: Json
    Description:
      en: The objects that you want to migrate or synchronize.
  DedicatedClusterId:
    Default: null
    Type: String
    Description:
      en: The ID of the DTS dedicated cluster on which the task runs.
Resources:
  SynchronizationJob:
    Type: 'ALIYUN::DTS::SynchronizationJob2'
    Properties:
      SourceEndpoint:
        Ref: SourceEndpoint
      Checkpoint:
        Ref: Checkpoint
      Status:
        Ref: Status
      DisasterRecoveryJob:
        Ref: DisasterRecoveryJob
      DtsJobId:
        Ref: DtsJobId
      DtsJobName:
        Ref: DtsJobName
      DataSynchronization:
        Ref: DataSynchronization
      SynchronizationDirection:
        Ref: SynchronizationDirection
      DataCheckConfigure:
        Ref: DataCheckConfigure
      StructureInitialization:
        Ref: StructureInitialization
      DelayRuleTime:
        Ref: DelayRuleTime
      ErrorPhone:
        Ref: ErrorPhone
      DtsInstanceId:
        Ref: DtsInstanceId
      DestinationEndpoint:
        Ref: DestinationEndpoint
      ErrorNotice:
        Ref: ErrorNotice
      FileOssUrl:
        Ref: FileOssUrl
      Reserve:
        Ref: Reserve
      DelayPhone:
        Ref: DelayPhone
      DelayNotice:
        Ref: DelayNotice
      DataInitialization:
        Ref: DataInitialization
      DtsBisLabel:
        Ref: DtsBisLabel
      DbList:
        Ref: DbList
      DedicatedClusterId:
        Ref: DedicatedClusterId
Outputs:
  DtsJobName:
    Description: The name of the DTS job.
    Value:
      'Fn::GetAtt':
        - SynchronizationJob
        - DtsJobName
  DtsInstanceId:
    Description: The ID of the DTS instance.
    Value:
      'Fn::GetAtt':
        - SynchronizationJob
        - DtsInstanceId
  DtsJobId:
    Description: The ID of the task.
    Value:
      'Fn::GetAtt':
        - SynchronizationJob
        - DtsJobId
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "SourceEndpoint": {
      "AssociationPropertyMetadata": {
        "Parameters": {
          "UserName": {
            "Default": null,
            "Type": "String",
            "Description": {
              "en": "The database account of the source database.\n**Note**: In most cases, this parameter is required. The permissions that are required for the database account vary with the migration or synchronization scenario."
            }
          },
          "Password": {
            "Default": null,
            "Type": "String",
            "Description": {
              "en": "The password of the source database account."
            }
          },
          "InstanceID": {
            "Default": null,
            "Type": "String",
            "Description": {
              "en": "The ID of the source instance. If the source instance is an Alibaba Cloud database instance, you must specify the ID of the database instance. For example, \n- If the source instance is an ApsaraDB RDS for MySQL instance, you must specify the ID of the ApsaraDB RDS for MySQL instance. \n- If the source instance is a self-managed database, the value of this parameter varies with the value of SourceEndpointInstanceType.\n- If InstanceType is set to ECS, you must specify the ID of the ECS instance.\n- If InstanceType is set to DG, you must specify the ID of the database gateway.\n- If InstanceType is set to EXPRESS or CEN, you must specify the ID of the VPC that is connected to the source instance.\n**Note**: If DestinationEndpointInstanceType is set to CEN, you must also specify the ID of the CEN instance in the Reserve parameter."
            }
          },
          "IP": {
            "Default": null,
            "Type": "String",
            "Description": {
              "en": "The IP address of the source instance. \n**Note**: This parameter is required only when **InstanceType** is set to **OTHER**, **EXPRESS**, **DG**, or **CEN**."
            }
          },
          "Region": {
            "Default": null,
            "Type": "String",
            "Description": {
              "en": "The ID of the region in which the source instance resides.\n**Note**: If the source instance is an Alibaba Cloud database instance, this parameter is required."
            }
          },
          "InstanceType": {
            "Type": "String",
            "Description": {
              "en": "The type of the source instance. Valid values:\nAlibaba Cloud database instances:\n- **RDS**: ApsaraDB RDS for MySQL instance, ApsaraDB RDS for SQL Server instance, ApsaraDB RDS for PostgreSQL instance, or ApsaraDB RDS for MariaDB TX instance\n- **PolarDB**: PolarDB for MySQL cluster\n- **REDIS**: ApsaraDB for Redis instance\n- **DISTRIBUTED_POLARDBX10**: PolarDB-X 1.0 (formerly DRDS) instance\n- **POLARDBX20**: PolarDB-X 2.0 instance\n- **MONGODB**: ApsaraDB for MongoDB instance\n- **DISTRIBUTED_DMSLOGICDB**: Data Management (DMS) logical database\nSelf-managed databases:\n- **OTHER**: self-managed database with a public IP address\n- **ECS**: self-managed database hosted on an Elastic Compute Service (ECS) instance\n- **EXPRESS**: self-managed database connected over Express Connect\n- **CEN**: self-managed database connected over Cloud Enterprise Network (CEN)\n- **DG**: self-managed database connected over Database Gateway\n**Note**: If the source instance is a PolarDB for PostgreSQL cluster (compatible with Oracle), you must set this parameter to **OTHER** or **EXPRESS**. Then, you can connect the PolarDB for PostgreSQL cluster to DTS as a self-managed database by using a public IP address or Express Connect. If the source instance is a self-managed database, you must deploy the network environment for the database. "
            }
          },
          "VSwitchID": {
            "Default": null,
            "Type": "String",
            "Description": {
              "en": "The ID of the vSwitch used for the data shipping link."
            }
          },
          "DatabaseName": {
            "Default": null,
            "Type": "String",
            "Description": {
              "en": "The name of the database which contains the objects to be migrated in the source instance.\n**Note**: This parameter is required only when the source instance is a PolarDB for PostgreSQL cluster (compatible with Oracle), a PostgreSQL database, or a MongoDB database."
            }
          },
          "EngineName": {
            "Default": null,
            "Type": "String",
            "Description": {
              "en": "The database engine of the source instance. Valid values:\n- **MYSQL**: ApsaraDB RDS for MySQL instance or self-managed MySQL database\n- **MARIADB**: ApsaraDB RDS for MariaDB TX instance\n- **PolarDB**: PolarDB for MySQL cluster\n- **POLARDB_O**: PolarDB for PostgreSQL cluster (compatible with Oracle)\n- **POLARDBX10**: PolarDB-X 1.0 instance\n- **POLARDBX20**: PolarDB-X 2.0 instance\n- **ORACLE**: self-managed Oracle database\n- **POSTGRESQL**: ApsaraDB RDS for PostgreSQL instance or self-managed PostgreSQL database\n- **MSSQL**: ApsaraDB RDS for SQL Server instance or self-managed SQL Server database\n- **MONGODB**: ApsaraDB for MongoDB instance or self-managed MongoDB database\n- **DB2**: self-managed Db2 for LUW database\n- **AS400**: self-managed Db2 for i database\n- **DMSPOLARDB**: DMS logical database\n- **HBASE**: self-managed HBase database\n- **TERADATA**: Teradata database\n- **TiDB**: TiDB database\n- **REDIS**: ApsaraDB for Redis instance or self-managed Redis database\n**Note**: Default value: **MYSQL**.\nIf EngineName is set to **MONGODB**, you must also specify the architecture type of the **MongoDB** database in the **Reserve** parameter."
            }
          },
          "Role": {
            "Default": null,
            "Type": "String",
            "Description": {
              "en": "The name of the Resource Access Management (RAM) role configured for the Alibaba Cloud account that owns the source instance.\n**Note**: This parameter is required when you migrate or synchronize data across different Alibaba Cloud accounts."
            }
          },
          "OwnerID": {
            "Default": null,
            "Type": "String",
            "Description": {
              "en": "The ID of the Alibaba Cloud account to which the source database belongs.\n**Note**: You can specify this parameter to migrate or synchronize data across different Alibaba Cloud accounts. In this case, you must specify **Role**."
            }
          },
          "OracleSID": {
            "Default": null,
            "Type": "String",
            "Description": {
              "en": "The system ID (SID) of the Oracle database.\n**Note**: This parameter is required only when **EngineName** is set to **ORACLE** and the Oracle database is deployed in an architecture that is not a Real Application Cluster (RAC)."
            }
          },
          "Port": {
            "Default": null,
            "Type": "String",
            "Description": {
              "en": "The port number of the source instance.\n**Note**: This parameter is required only when the source instance is a self-managed database."
            }
          }
        }
      },
      "Type": "Json",
      "Description": {
        "en": "Source instance configuration."
      }
    },
    "Checkpoint": {
      "Default": null,
      "Type": "String",
      "Description": {
        "en": "The start offset of incremental data migration or synchronization. This value is a UNIX timestamp representing the number of seconds that have elapsed since January 1, 1970, 00:00:00 UTC."
      }
    },
    "Status": {
      "Default": null,
      "Type": "String",
      "Description": {
        "en": "The status of the resource. Valid values:\n- **Synchronizing**: Start the task.\n- **Suspending**: Suspend the task.\n- **Stopping**: Stop the task."
      },
      "AllowedValues": [
        "Synchronizing",
        "Suspending",
        "Stopping"
      ]
    },
    "DisasterRecoveryJob": {
      "Default": null,
      "Type": "Boolean",
      "Description": {
        "en": "Specifies whether the instance is a disaster recovery instance. Valid values: **true** and **false**"
      }
    },
    "DtsJobId": {
      "Default": null,
      "Type": "String",
      "Description": {
        "en": "The ID of the DTS task."
      }
    },
    "DtsJobName": {
      "Type": "String",
      "Description": {
        "en": "The name of the DTS instance."
      }
    },
    "DataSynchronization": {
      "Type": "Boolean",
      "Description": {
        "en": "Specifies whether to perform incremental data migration or incremental data synchronization. Default value: **false**. Valid values: **true** and **false**."
      }
    },
    "SynchronizationDirection": {
      "Default": null,
      "Type": "String",
      "Description": {
        "en": "The synchronization direction. Default value: Forward. Valid values:\n- **Forward**: Data is synchronized from the source database to the destination database.\n- **Reverse**: Data is synchronized from the destination database to the source database.\n**Note**: The default value is **Forward**.\nThe value Reverse takes effect only if the topology of the data synchronization task is two-way synchronization."
      }
    },
    "DataCheckConfigure": {
      "Default": null,
      "AssociationPropertyMetadata": {
        "Parameters": {
          "fullCheckErrorNotice": {
            "Default": null,
            "Type": "Boolean",
            "Description": {
              "en": "Specifies whether to trigger an alert if the full data verification task fails. Valid values: **true** and **false**.\n**Note**: For example, you set this parameter to **true**. If the full data verification task fails, an alert is triggered."
            }
          },
          "fullCheckValidFailNotice": {
            "Default": null,
            "Type": "Boolean",
            "Description": {
              "en": "Specifies whether to trigger an alert if inconsistent data is detected by the full data verification task. Valid values: **true** and **false**.\n**Note**: For example, you set this parameter to true. If the number of inconsistent data entries detected by the full data verification task is greater than or equal to the threshold that you specified, an alert is triggered."
            }
          },
          "incrementalCheckValidFailNotice": {
            "Default": null,
            "Type": "Boolean",
            "Description": {
              "en": "Specifies whether to trigger an alert if inconsistent data is detected by the incremental data verification task. Valid values: **true** and **false**.\n**Note**: For example, you set this parameter to **true**. If the cumulative number of inconsistent data entries detected by the incremental data verification task in several statistical periods is greater than or equal to the threshold that you specified, an alert is triggered."
            }
          },
          "dataCheckNoticePhone": {
            "Default": null,
            "Type": "String",
            "Description": {
              "en": "The mobile number of the alert contact for a full or incremental data verification task. If an alert is triggered for a verification task, a text message is sent to notify the alert contact."
            }
          },
          "fullCheckReferEndpoint": {
            "Default": null,
            "Type": "String",
            "Description": {
              "en": "The benchmark for full data verification. Valid values:\n- **all**: checks the data consistency between the source and destination databases based on the source and destination databases.\n- **src**: checks the data consistency between the source and destination databases based on the source database. Objects that exist in the destination database but do not exist in the source database are not checked.\n- **dest**: checks the data consistency between the source and destination databases based on the destination database. Objects that exist in the source database but do not exist in the destination database are not checked."
            }
          },
          "fullCheckModel": {
            "Default": null,
            "Type": "Number",
            "Description": {
              "en": "The mode of the full data verification task. Valid values:\n- **1**: verifies the data by sampling ratio.\n- **2**: verifies the data by row."
            },
            "AllowedValues": [
              1,
              2
            ]
          },
          "incrementalCheckDelayNotice": {
            "Default": null,
            "Type": "Boolean",
            "Description": {
              "en": "Specifies whether to trigger an alert on the data latency of the incremental data verification task. Valid values: **true** and **false**.\n**Note**: For example, you set this parameter to **true**. If the cumulative latency of the incremental data verification task in several statistical periods is greater than or equal to the threshold that you specified, an alert is triggered."
            }
          },
          "incrementalCheckValidFailNoticePeriod": {
            "Default": null,
            "Type": "Number",
            "Description": {
              "en": "The statistical period of an alert on inconsistent data entries detected by the incremental data verification task. Valid values:\n- **1**: 1 minute\n- **2**: 5 minutes\n- **3**: 10 minutes\n- **4**: 30 minutes\n**Note**: This parameter is required if the **incrementalCheckValidFailNotice** parameter is set to **true**."
            },
            "AllowedValues": [
              1,
              2,
              3,
              4
            ]
          },
          "incrementalCheckDelayNoticeTimes": {
            "Default": null,
            "Type": "Number",
            "Description": {
              "en": "The number of statistical periods of an alert on the data latency of the incremental data verification task.\n**Note**: This parameter is required if the **incrementalCheckDelayNotice** parameter is set to **true**."
            }
          },
          "fullCheckMaxReadBps": {
            "Default": null,
            "MinValue": 0,
            "Type": "Number",
            "Description": {
              "en": "The maximum number of bytes that are read per second. Valid values: integers from 0 to 9007199254740991."
            },
            "MaxValue": 9007199254740991
          },
          "incrementalCheckValidFailNoticeTimes": {
            "Default": null,
            "Type": "Number",
            "Description": {
              "en": "The number of statistical periods of an alert on inconsistent data entries detected by the incremental data verification task.\n**Note**: This parameter is required if the **incrementalCheckValidFailNotice** parameter is set to **true**."
            }
          },
          "fullCheckMaxReadRps": {
            "Default": null,
            "MinValue": 0,
            "Type": "Number",
            "Description": {
              "en": "The maximum number of data rows that are read per second. Valid values: integers from 0 to 9007199254740991."
            },
            "MaxValue": 9007199254740991
          },
          "incrementalCheckValidFailNoticeValue": {
            "Default": null,
            "Type": "Number",
            "Description": {
              "en": "The alert threshold for inconsistent data entries detected by the incremental data verification task.\n**Note**: This parameter is required if the **incrementalCheckValidFailNotice** parameter is set to **true**."
            }
          },
          "fullDataCheck": {
            "Default": null,
            "Type": "Boolean",
            "Description": {
              "en": "Specifies whether to perform a full data verification task. Valid values: **true** and **false**."
            }
          },
          "fullCheckRatio": {
            "Default": null,
            "MinValue": 10,
            "Type": "Number",
            "Description": {
              "en": "The sampling ratio of the full data verification task. Valid values: integers from 10 to 100. Unit: percent.\n**Note**: This parameter is required if the **fullCheckModel** parameter is set to 1."
            },
            "MaxValue": 100
          },
          "incrementalCheckDelayNoticeValue": {
            "Default": null,
            "Type": "Number",
            "Description": {
              "en": "The alert threshold for the data latency of the incremental data verification task. Unit: seconds.\n**Note**: This parameter is required if the **incrementalCheckDelayNotice** parameter is set to **true**."
            }
          },
          "checkMaximumHourEnable": {
            "Default": null,
            "Type": "Number",
            "Description": {
              "en": "Specifies whether to configure a timeout period for the full data verification task.Valid values:\n- **0**: does not configure a timeout period for the full data verification task.\n- **1**: configures a timeout period for the full data verification task.\n**Note**: This parameter is required if the fullCheckModel parameter is set to 1."
            },
            "AllowedValues": [
              0,
              1
            ]
          },
          "dataCheckDbList": {
            "Default": null,
            "Type": "String",
            "Description": {
              "en": "The objects whose data is to be verified. The value must be a JSON string."
            }
          },
          "incrementalCheckErrorNotice": {
            "Default": null,
            "Type": "Boolean",
            "Description": {
              "en": "Specifies whether to trigger an alert if the incremental data verification task fails. Valid values: **true** and **false**.\nNote: For example, you set this parameter to **true**. If the incremental data verification task fails, an alert is triggered."
            }
          },
          "checkMaximumHour": {
            "Default": null,
            "MinValue": 1,
            "Type": "Number",
            "Description": {
              "en": "The timeout period of the full data verification task. Valid values: integers from 1 to 72. Countdown begins the moment the full data verification task is started. If the task is not complete within the specified timeout period, the task is forcibly stopped."
            },
            "MaxValue": 72
          },
          "incrementalCheckDelayNoticePeriod": {
            "Default": null,
            "Type": "Number",
            "Description": {
              "en": "The statistical period of an alert on the data latency of the incremental data verification task. Valid values:\n- **1**: 1 minute\n- **2**: 5 minutes\n- **3**: 10 minutes\n- **4**: 30 minutes\n**Note**: This parameter is required if the **incrementalCheckDelayNotice** parameter is set to **true**."
            },
            "AllowedValues": [
              1,
              2,
              3,
              4
            ]
          },
          "fullCheckFixData": {
            "Default": null,
            "Type": "Boolean",
            "Description": {
              "en": "Specifies whether to replace the inconsistent data. Valid values: **true** and **false**. Default value: false.\n**Note**: For example, you set this parameter to true. If the destination database has data that is inconsistent with the data in the source database, the data values of the destination database are replaced with those of the source database."
            }
          },
          "fullCheckNoticeValue": {
            "Default": null,
            "Type": "Number",
            "Description": {
              "en": "The alert threshold for inconsistent data entries detected by the full data verification task.\n**Note**: This parameter is required if the **fullCheckValidFailNotice** parameter is set to **true**."
            }
          },
          "incrementalDataCheck": {
            "Default": null,
            "Type": "Boolean",
            "Description": {
              "en": "Specifies whether to perform an incremental data verification task. Valid values: **true** and **false**."
            }
          }
        }
      },
      "Type": "Json",
      "Description": {
        "en": "The data verification task for a data migration or synchronization instance."
      }
    },
    "StructureInitialization": {
      "Type": "Boolean",
      "Description": {
        "en": "Specifies whether to perform schema migration or schema synchronization. Default value: true. Valid values: **true** and **false**."
      }
    },
    "DelayRuleTime": {
      "Default": null,
      "Type": "Number",
      "Description": {
        "en": "The threshold for latency alerts. Unit: seconds. You can set the threshold based on your business requirements. To prevent jitters caused by network and database overloads, we recommend that you set the threshold to more than 10 seconds."
      }
    },
    "ErrorPhone": {
      "Default": null,
      "Type": "String",
      "Description": {
        "en": "The mobile numbers that receive status-related alerts. Separate multiple mobile numbers with commas (,).\n**Note**: This parameter is available only for users of the China site (aliyun.com). Only mobile numbers in the Chinese mainland are supported. You can specify up to 10 mobile numbers. Users of the international site (alibabacloud.com) cannot receive alerts by using mobile numbers, but can configure alert rules for DTS tasks in the CloudMonitor console."
      }
    },
    "DtsInstanceId": {
      "Default": null,
      "Type": "String",
      "Description": {
        "en": "The ID of the DTS instance."
      }
    },
    "DestinationEndpoint": {
      "AssociationPropertyMetadata": {
        "Parameters": {
          "UserName": {
            "Default": null,
            "Type": "String",
            "Description": {
              "en": "The database account of the destination database.\n**Note**: In most cases, this parameter is required. The permissions that are required for the database account vary with the migration or synchronization scenario."
            }
          },
          "Password": {
            "Default": null,
            "Type": "String",
            "Description": {
              "en": "The password of the destination database account."
            }
          },
          "InstanceID": {
            "Default": null,
            "Type": "String",
            "Description": {
              "en": "The ID of the destination instance. If the destination instance is an Alibaba Cloud database instance, you must specify the ID of the database instance. For example, \n- If the destination instance is an ApsaraDB RDS for MySQL instance, you must specify the ID of the ApsaraDB RDS for MySQL instance. \n- If the destination instance is a self-managed database, the value of this parameter varies with the value of SourceEndpointInstanceType.\n- If InstanceType is set to ECS, you must specify the ID of the ECS instance.\n- If InstanceType is set to DG, you must specify the ID of the database gateway.\n- If InstanceType is set to EXPRESS or CEN, you must specify the ID of the VPC that is connected to the destination instance.\n**Note**: If DestinationEndpointInstanceType is set to CEN, you must also specify the ID of the CEN instance in the Reserve parameter."
            }
          },
          "IP": {
            "Default": null,
            "Type": "String",
            "Description": {
              "en": "The IP address of the destination instance. \n**Note**: This parameter is required only when **InstanceType** is set to **OTHER**, **EXPRESS**, **DG**, or **CEN**."
            }
          },
          "Region": {
            "Default": null,
            "Type": "String",
            "Description": {
              "en": "The ID of the region in which the destination instance resides.\n**Note**: If the source instance is an Alibaba Cloud database instance, this parameter is required."
            }
          },
          "InstanceType": {
            "Type": "String",
            "Description": {
              "en": "The type of the destination instance. Valid values:\nAlibaba Cloud database instances\n- **RDS**: ApsaraDB RDS for MySQL instance, ApsaraDB RDS for SQL Server instance, ApsaraDB RDS for PostgreSQL instance, or ApsaraDB RDS for MariaDB TX instance\n- **PolarDB**: PolarDB for MySQL cluster\n- **DISTRIBUTED_POLARDBX10**: PolarDB-X 1.0 (formerly DRDS) instance\n- **POLARDBX20**: PolarDB-X 2.0 instance\n- **REDIS**: ApsaraDB for Redis instance\n- **ADS**: AnalyticDB for MySQL V2.0 cluster or AnalyticDB for MySQL V3.0 cluster\n- **MONGODB**: ApsaraDB for MongoDB instance\n- **GREENPLUM**: AnalyticDB for PostgreSQL instance\n- **DATAHUB**: DataHub project\n- **ELK**: Elasticsearch cluster\n- **Tablestore**: Tablestore instance\n- **ODPS**: MaxCompute project\nSelf-managed databases\n- **OTHER**: self-managed database with a public IP address\n- **ECS**: self-managed database hosted on an ECS instance\n- **EXPRESS**: self-managed database connected over Express Connect\n- **CEN**: self-managed database connected over CEN\n- **DG**: self-managed database connected over Database Gateway\n**Note**: If the destination instance is a PolarDB for PostgreSQL cluster (compatible with Oracle), you must set this parameter to OTHER or EXPRESS. Then, you can connect the PolarDB for PostgreSQL cluster (compatible with Oracle) to DTS as a self-managed database by using a public IP address or Express Connect.\nIf the destination instance is a Message Queue for Apache Kafka instance, you must set this parameter to ECS or EXPRESS. Then, you can connect the Message Queue for Apache Kafka instance to DTS as a self-managed database connected over ECS or Express Connect.\nIf the destination instance is a self-managed database, you must deploy the network environment for the database."
            }
          },
          "Role": {
            "Default": null,
            "Type": "String",
            "Description": {
              "en": "The name of the Resource Access Management (RAM) role configured for the Alibaba Cloud account that owns the destination instance.\n**Note**: This parameter is required when you migrate or synchronize data across different Alibaba Cloud accounts."
            }
          },
          "DatabaseName": {
            "Default": null,
            "Type": "String",
            "Description": {
              "en": "The name of the database which contains the objects to be migrated in the destination instance.\n**Note**: This parameter is required only when the destination instance is a PolarDB for PostgreSQL cluster (compatible with Oracle), a PostgreSQL database, or a MongoDB database."
            }
          },
          "EngineName": {
            "Default": null,
            "Type": "String",
            "Description": {
              "en": "The database engine of the destination instance. Valid values:\n- **MYSQL**: ApsaraDB RDS for MySQL instance or self-managed MySQL database\n- **MARIADB**: ApsaraDB RDS for MariaDB TX instance\n- **PolarDB**: PolarDB for MySQL cluster\n- **POLARDB_O**: PolarDB for PostgreSQL cluster (compatible with Oracle)\n- **POLARDBX10**: PolarDB-X 1.0 instance\n- **POLARDBX20**: PolarDB-X 2.0 instance\n- **ORACLE**: self-managed Oracle database\n- **POSTGRESQL**: ApsaraDB RDS for PostgreSQL instance or self-managed PostgreSQL database\n- **MSSQL**: ApsaraDB RDS for SQL Server instance or self-managed SQL Server database\n- **ADS**: AnalyticDB for MySQL V2.0 cluster\n- **ADB30**: AnalyticDB for MySQL V3.0 cluster- **MONGODB**: ApsaraDB for MongoDB instance or self-managed MongoDB database\n- **GREENPLUM**: AnalyticDB for PostgreSQL instance\n- **KAFKA**: Message Queue for Apache Kafka instance or self-managed Kafka cluster\n- **DATAHUB**: DataHub project- **DB2**: self-managed Db2 for LUW database\n- **AS400**: self-managed Db2 for i database\n- **ODPS**: MaxCompute project\n- **Tablestore**: Tablestore instance\n- **ELK**: Elasticsearch cluster\n- **REDIS**: ApsaraDB for Redis instance or self-managed Redis database\n**Note**: Default value: **MYSQL**.\nIf this parameter is set to **KAFKA**, **MONGODB**, or **PolarDB**, you must also specify the database information in the Reserve parameter."
            }
          },
          "OwnerID": {
            "Default": null,
            "Type": "String",
            "Description": {
              "en": "The ID of the Alibaba Cloud account to which the destination database belongs.\n**Note**: You can specify this parameter to migrate or synchronize data across different Alibaba Cloud accounts. In this case, you must specify **Role**."
            }
          },
          "OracleSID": {
            "Default": null,
            "Type": "String",
            "Description": {
              "en": "The system ID (SID) of the Oracle database.\n**Note**: This parameter is required only when **EngineName** is set to **ORACLE** and the Oracle database is deployed in an architecture that is not a Real Application Cluster (RAC)."
            }
          },
          "Port": {
            "Default": null,
            "Type": "String",
            "Description": {
              "en": "The port number of the destination instance.\n**Note**: This parameter is required only when the destination instance is a self-managed database."
            }
          }
        }
      },
      "Type": "Json",
      "Description": {
        "en": "Destination instance configuration."
      }
    },
    "ErrorNotice": {
      "Default": null,
      "Type": "Boolean",
      "Description": {
        "en": "Specifies whether to monitor the task status. Valid values: **true** and **false**."
      }
    },
    "FileOssUrl": {
      "Default": null,
      "Type": "String",
      "Description": {
        "en": "The URL of the Object Storage Service (OSS) bucket that stores the files related to the DTS task."
      }
    },
    "Reserve": {
      "Default": null,
      "Type": "Json",
      "Description": {
        "en": "The reserved parameter of DTS. You can specify this parameter to add more configurations of the source or destination instance to the DTS task. For example, you can specify the data storage format of the destination Kafka database and the ID of the CEN instance. "
      }
    },
    "DelayPhone": {
      "Default": null,
      "Type": "String",
      "Description": {
        "en": "The mobile numbers that receive latency-related alerts. Separate multiple mobile numbers with commas (,).\n**Note**: This parameter is available only for users of the China site (aliyun.com). Only mobile numbers in the Chinese mainland are supported. You can specify up to 10 mobile numbers. Users of the international site (alibabacloud.com) cannot receive alerts by using mobile numbers, but can configure alert rules for DTS tasks in the CloudMonitor console."
      }
    },
    "DelayNotice": {
      "Default": null,
      "Type": "Boolean",
      "Description": {
        "en": "Specifies whether to monitor the task latency. Valid values: **true** and **false**"
      }
    },
    "DataInitialization": {
      "Type": "Boolean",
      "Description": {
        "en": "Specifies whether to perform full data migration or full data synchronization. Default value: **true**. Valid values: **true** and **false**."
      }
    },
    "DtsBisLabel": {
      "Default": null,
      "Type": "String",
      "Description": {
        "en": "The environment tag of the DTS instance. Valid values: **normal** and **online**."
      }
    },
    "DbList": {
      "Type": "Json",
      "Description": {
        "en": "The objects that you want to migrate or synchronize."
      }
    },
    "DedicatedClusterId": {
      "Default": null,
      "Type": "String",
      "Description": {
        "en": "The ID of the DTS dedicated cluster on which the task runs."
      }
    }
  },
  "Resources": {
    "SynchronizationJob": {
      "Type": "ALIYUN::DTS::SynchronizationJob2",
      "Properties": {
        "SourceEndpoint": {
          "Ref": "SourceEndpoint"
        },
        "Checkpoint": {
          "Ref": "Checkpoint"
        },
        "Status": {
          "Ref": "Status"
        },
        "DisasterRecoveryJob": {
          "Ref": "DisasterRecoveryJob"
        },
        "DtsJobId": {
          "Ref": "DtsJobId"
        },
        "DtsJobName": {
          "Ref": "DtsJobName"
        },
        "DataSynchronization": {
          "Ref": "DataSynchronization"
        },
        "SynchronizationDirection": {
          "Ref": "SynchronizationDirection"
        },
        "DataCheckConfigure": {
          "Ref": "DataCheckConfigure"
        },
        "StructureInitialization": {
          "Ref": "StructureInitialization"
        },
        "DelayRuleTime": {
          "Ref": "DelayRuleTime"
        },
        "ErrorPhone": {
          "Ref": "ErrorPhone"
        },
        "DtsInstanceId": {
          "Ref": "DtsInstanceId"
        },
        "DestinationEndpoint": {
          "Ref": "DestinationEndpoint"
        },
        "ErrorNotice": {
          "Ref": "ErrorNotice"
        },
        "FileOssUrl": {
          "Ref": "FileOssUrl"
        },
        "Reserve": {
          "Ref": "Reserve"
        },
        "DelayPhone": {
          "Ref": "DelayPhone"
        },
        "DelayNotice": {
          "Ref": "DelayNotice"
        },
        "DataInitialization": {
          "Ref": "DataInitialization"
        },
        "DtsBisLabel": {
          "Ref": "DtsBisLabel"
        },
        "DbList": {
          "Ref": "DbList"
        },
        "DedicatedClusterId": {
          "Ref": "DedicatedClusterId"
        }
      }
    }
  },
  "Outputs": {
    "DtsJobName": {
      "Description": "The name of the DTS job.",
      "Value": {
        "Fn::GetAtt": [
          "SynchronizationJob",
          "DtsJobName"
        ]
      }
    },
    "DtsInstanceId": {
      "Description": "The ID of the DTS instance.",
      "Value": {
        "Fn::GetAtt": [
          "SynchronizationJob",
          "DtsInstanceId"
        ]
      }
    },
    "DtsJobId": {
      "Description": "The ID of the task.",
      "Value": {
        "Fn::GetAtt": [
          "SynchronizationJob",
          "DtsJobId"
        ]
      }
    }
  }
}