ALIYUN::DTS::SynchronizationJob is used to purchase a synchronization instance and configure a synchronization task.

Syntax

{
  "Type": "ALIYUN::DTS::SynchronizationJob",
  "Properties": {
    "SynchronizationJobClass": String,
    "SourceEndpoint": Map,
    "PayType": String,
    "DataInitialization": Boolean,
    "Period": String,
    "DestRegion": String,
    "SourceRegion": String,
    "UsedTime": Integer,
    "SynchronizationObjects": List,
    "NetworkType": String,
    "DestinationEndpoint": Map,
    "StructureInitialization": Boolean,
    "Topology": String
  }
}

Properties

PropertyTypeRequiredEditableDescriptionConstraint
SynchronizationJobClassStringYesNoThe type of the synchronization instance.Default value: small. Valid values:
  • micro
  • small
  • medium
  • large
SourceEndpointMapYesNoThe configurations of the source instance.For more information, see SourceEndpoint properties.
PayTypeStringNoNoThe billing method.Valid values:
  • Postpaid
  • Prepaid
DataInitializationBooleanNoNoSpecifies whether to initialize full data before synchronization.Default value: true. Valid values:
  • true:
  • false
PeriodStringNoNoThe billing cycle of the subscription instance.Valid values:
  • Year
  • Month
This parameter takes effect only when PayType is set to Prepaid.
DestRegionStringYesNoThe region where the destination instance is deployed.None
SourceRegionStringYesNoThe region where the source instance is deployed.None
UsedTimeIntegerNoNoThe subscription duration of the subscription instance.This parameter takes effect only when PayType is set to Prepaid.
SynchronizationObjectsListNoNoThe objects to be synchronized.For more information, see SynchronizationObjects properties.
NetworkTypeStringNoNoThe type of the data transmission network that is used for cross-region synchronization.Default value: Internet. Valid values:
  • Internet
  • Intranet
DestinationEndpointMapYesNoThe synchronization channel configurations.For more information, see DestinationEndpoint properties.
StructureInitializationBooleanNoNoSpecifies whether to initialize the schema before synchronization.Default value: true. Valid values:
  • true
  • false
TopologyStringNoNoThe synchronization topology.Default value: oneway. Valid values:
  • oneway
  • bidirectional
This parameter can be set to bidirectional only for synchronization between two MySQL instances.

SourceEndpoint syntax

"SourceEndpoint": {
  "UserName": String,
  "InstanceId": String,
  "IP": String,
  "Port": String,
  "Role": String,
  "OwnerID": String,
  "Password": String,
  "InstanceType": String,
  "InstanceTypeForCreation": String
}

SourceEndpoint properties

PropertyTypeRequiredEditableDescriptionConstraint
UserNameStringNoNoThe username that is used to connect to the source instance.This parameter is required when the source instance is an ECS instance or an on-premises database that is connected over an Express Connect circuit. You do not need to specify this parameter when the source instance is an ApsaraDB for Redis instance.
InstanceIdStringNoNoThe ID of the source instance.None
IPStringNoNoThe IP address of the source instance.This parameter is required when the source instance is an on-premises database that is connected over an Express Connect circuit.
PortStringNoNoThe port on which the source instance is listening.This parameter is required when the source instance is an ECS instance or an on-premises database that is connected over an Express Connect circuit.
RoleStringNoNoThe RAM role that the Alibaba Cloud account of the source instance assigns to the Alibaba Cloud account of the destination instance. This parameter is available if the source and destination instances belong to different Alibaba Cloud accounts. For more information about role permissions and how to grant permissions to a role, see Configure RAM authorization for cross-account data migration and synchronization.None
OwnerIDStringNoNoThe ID of the Alibaba Cloud account to which the source instance belongs. This parameter is available if the source and destination instances belong to different Alibaba Cloud accounts.None
PasswordStringNoNoThe password that is used to connect to the source instance.This parameter is required when the source instance is an ECS instance or an on-premises database that is connected over an Express Connect circuit.
InstanceTypeStringYesNoThe type of the source instance.Valid values:
  • Redis: ApsaraDB for Redis instance
  • RDS: ApsaraDB RDS instance
  • POLARDB: PolarDB for MySQL cluster
  • ECS: self-managed database that is hosted on ECS
  • Express: self-managed database that is connected over Express Connect
  • dg: self-managed database that is connected over Database Gateway
  • cen: self-managed database that is connected over Cloud Enterprise Network (CEN)
InstanceTypeForCreationStringNoNoThe type of the source instance for synchronization channel configurations.Valid values:
  • MySQL
  • PolarDB
  • Redis
  • SQLServer
  • PostgreSQL
  • PolarDB-X (formerly known as DRDS)

SynchronizationObjects syntax

"SynchronizationObjects": [
  {
    "TableExcludes": List,
    "NewSchemaName": String,
    "NewDBName": String,
    "TableIncludes": List,
    "SchemaName": String,
    "DBName": String
  }
]

SynchronizationObjects properties

PropertyTypeRequiredEditableDescriptionConstraint
TableExcludesListNoNoThe names of tables not to be synchronized from the source database.None
NewSchemaNameStringNoNoThe mapped name of the source schema in the destination instance.None
NewDBNameStringNoNoThe mapped name of the source database in the destination instance.None
TableIncludesListNoNoThe table to be synchronized.None
SchemaNameStringNoNoThe name of the schema to be synchronized.None
DBNameStringNoNoThe name of the database to be synchronized.None

TableExcludes syntax

"TableExcludes": [
  {
    "TableName": String
  }
]

TableExcludes properties

PropertyTypeRequiredEditableDescriptionConstraint
TableNameStringNoNoThe name of the table.None

TableIncludes syntax

"TableIncludes": [
  {
    "TableName": String,
    "FilterCondition": String,
    "ColumnExcludes": List,
    "ColumnIncludes": List,
    "NewTableName": String
  }
]

TableIncludes properties

PropertyTypeRequiredEditableDescriptionConstraint
TableNameStringNoNoThe name of the table to be synchronized.None
FilterConditionStringNoNoThe filter condition.None
ColumnExcludesListNoNoThe name of the column not to be synchronized.None
ColumnIncludesListNoNoThe name of the column to be synchronized.None
NewTableNameStringNoNoThe mapped name of the source table in the destination instance.None

ColumnExcludes syntax

"ColumnExcludes": [
  {
    "ColumnName": String
  }
]

ColumnExcludes properties

PropertyTypeRequiredEditableDescriptionConstraint
ColumnNameStringNoNoThe name of the column not to be synchronized.None

ColumnIncludes syntax

"ColumnIncludes": [
  {
    "NewColumnName": String,
    "ColumnName": String
  }
]

ColumnIncludes properties

PropertyTypeRequiredEditableDescriptionConstraint
NewColumnNameStringNoNoThe mapped name of the source column in the destination instance.None
ColumnNameStringNoNoThe name of the column to be synchronized.None

DestinationEndpoint syntax

"DestinationEndpoint": {
  "UserName": String,
  "InstanceId": String,
  "IP": String,
  "InstanceType": String,
  "Password": String,
  "InstanceTypeForCreation": String,
  "Port": String
}

DestinationEndpoint properties

PropertyTypeRequiredEditableDescriptionConstraint
UserNameStringNoNoThe username that is used to connect to the destination instance.This parameter is required when the destination instance is an ECS instance or an on-premises database that is connected over an Express Connect circuit. You do not need to specify this parameter when the source instance is an ApsaraDB for Redis instance.
InstanceIdStringNoNoThe ID of the destination instance.
  • If the destination instance is a MaxCompute project, set the parameter to the name of the MaxCompute project.
  • If the destination instance is an AnalyticDB for MySQL cluster, set the parameter to the ID of the AnalyticDB for MySQL cluster.
  • If the destination instance is a DataHub project, set the parameter to the name of the DataHub project.
IPStringNoNoThe IP address of the destination instance.This parameter is required when the destination instance is an on-premises database that is connected over an Express Connect circuit.
InstanceTypeStringYesNoThe type of the destination instance.Default values: RDS. Valid values:
  • Redis: ApsaraDB for Redis instance
  • RDS: ApsaraDB RDS instance
  • POLARDB: PolarDB for MySQL cluster
  • ECS: self-managed database that is hosted on ECS
  • Express: user-created database that is connected over Express Connect
  • MaxCompute: MaxCompute project
  • DataHub: DataHub project
  • AnalyticDB: AnalyticDB for MySQL V2.0 cluster
  • AnalyticDB30: AnalyticDB for MySQL V3.0 cluster
InstanceTypeForCreationStringNoNoThe type of the destination instance for synchronization channel configurations.Valid values:
  • MySQL
  • PolarDB
  • Redis
  • MaxCompute
  • DataHub
  • Kafka
  • Elasticsearch
  • Tablestore
PasswordStringNoNoThe password that is used to connect to the destination instance.This parameter is required when the destination instance is an ECS instance or an on-premises database that is connected over an Express Connect circuit.
PortStringNoNoThe port on which the destination instance is listening.This parameter is required when the destination instance is an ECS instance or an on-premises database that is connected over an Express Connect circuit.

Response parameters

Fn::GetAtt

SynchronizationJobId: the ID of the synchronization instance.

Examples

  • YAMLformat

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters:
      RdsId:
        Type: String
        AssociationProperty: ALIYUN::RDS::Instance::InstanceId
    Resources:
      SynchronizationJob:
        Type: ALIYUN::DTS::SynchronizationJob
        Properties:
          SynchronizationJobClass: small
          SourceEndpoint:
            InstanceId:
              Ref: RdsId
            InstanceTypeForCreation: MySQL
            InstanceType: RDS
          PayType: Postpaid
          DataInitialization: false
          DestRegion:
            Ref: ALIYUN::Region
          SourceRegion:
            Ref: ALIYUN::Region
          NetworkType: Internet
          DestinationEndpoint:
            InstanceId:
              Ref: RdsId
            InstanceTypeForCreation: MySQL
            InstanceType: RDS
          StructureInitialization: false
    Outputs:
      SynchronizationJobId:
        Description: Synchronization instance ID
        Value:
          Fn::GetAtt:
            - SynchronizationJob
            - SynchronizationJobId
  • JSONformat

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
        "RdsId": {
          "Type": "String",
          "AssociationProperty": "ALIYUN::RDS::Instance::InstanceId"
        }
      },
      "Resources": {
        "SynchronizationJob": {
          "Type": "ALIYUN::DTS::SynchronizationJob",
          "Properties": {
            "SynchronizationJobClass": "small",
            "SourceEndpoint": {
              "InstanceId": {
                "Ref": "RdsId"
              },
              "InstanceTypeForCreation": "MySQL",
              "InstanceType": "RDS"
            },
            "PayType": "Postpaid",
            "DataInitialization": false,
            "DestRegion": {
              "Ref": "ALIYUN::Region"
            },
            "SourceRegion": {
              "Ref": "ALIYUN::Region"
            },
            "NetworkType": "Internet",
            "DestinationEndpoint": {
              "InstanceId": {
                "Ref": "RdsId"
              },
              "InstanceTypeForCreation": "MySQL",
              "InstanceType": "RDS"
            },
            "StructureInitialization": false
          }
        }
      },
      "Outputs": {
        "SynchronizationJobId": {
          "Description": "Synchronization instance ID",
          "Value": {
            "Fn::GetAtt": [
              "SynchronizationJob",
              "SynchronizationJobId"
            ]
          }
        }
      }
    }