All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::DTS::SynchronizationJob

Last Updated:Mar 20, 2024

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

Note

We recommend that you use ALIYUN::DTS::Instance to purchase a Data Transmission Service (DTS) instance and ALIYUN::DTS::SynchronizationJob2 to configure a data 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

Property

Type

Required

Editable

Description

Constraint

SynchronizationJobClass

String

Yes

No

The specification of the data synchronization instance.

Valid values:

  • micro

  • small (default)

  • medium

  • large

SourceEndpoint

Map

Yes

No

The configurations of the source instance.

For more information, see SourceEndpoint properties.

PayType

String

No

No

The billing method.

Valid values:

  • Postpaid

  • Prepaid

DataInitialization

Boolean

No

No

Specifies whether to perform initial full data synchronization before the data synchronization task.

Valid values:

  • true (default)

  • false

Period

String

No

No

The unit of the subscription duration.

Valid values:

  • Year

  • Month

This property takes effect when PayType is set to Prepaid.

DestRegion

String

Yes

No

The region ID of the destination instance.

None.

SourceRegion

String

Yes

No

The region ID of the source instance.

None.

UsedTime

Integer

No

No

The subscription duration of the data synchronization instance.

This property takes effect when PayType is set to Prepaid.

SynchronizationObjects

List

No

No

The objects that you want to synchronize.

For more information, see SynchronizationObjects properties.

NetworkType

String

No

No

The type of the data transmission network that you want to use for cross-region synchronization.

Valid values:

  • Internet (default)

  • Intranet

DestinationEndpoint

Map

Yes

No

The configurations of the destination instance.

For more information, see DestinationEndpoint properties.

StructureInitialization

Boolean

No

No

Specifies whether to perform initial schema synchronization before the data synchronization task.

Valid values:

  • true (default)

  • false

Topology

String

No

No

The synchronization topology.

Valid values:

  • oneway (default)

  • bidirectional

You can set this property to bidirectional only for synchronization between MySQL data.

SourceEndpoint syntax

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

SourceEndpoint properties

Property

Type

Required

Editable

Description

Constraint

UserName

String

No

No

The username that is used to access the source instance.

You must specify this property when the source instance is an Elastic Compute Service (ECS) instance or an on-premises database that is connected over an Express Connect circuit. You do not need to specify this property when the source instance is an ApsaraDB for Redis instance.

InstanceId

String

No

No

The ID of the source instance.

None.

IP

String

No

No

The IP address of the source instance.

You must specify this property when the source instance is an on-premises database that is connected over an Express Connect circuit.

Port

String

No

No

The listening port of the source instance.

You must specify this property when the source instance is an ECS instance or an on-premises database that is connected over an Express Connect circuit.

Role

String

No

No

The name of the Resource Access Management (RAM) role authorized by the Alibaba Cloud account to which the source instance belongs. This property takes effect when the source and destination instances belong to different Alibaba Cloud accounts. For more information about the permissions of the RAM role and how to grant the permissions to the RAM role, see Configure RAM authorization for cross-account DTS tasks.

None.

OwnerID

String

No

No

The ID of the Alibaba Cloud account to which the source instance belongs. This property takes effect when the source and destination instances belong to different Alibaba Cloud accounts.

None.

Password

String

No

No

The password that is used to access the source instance.

You must specify this property when the source instance is an ECS instance or an on-premises database that is connected over an Express Connect circuit.

InstanceType

String

Yes

No

The 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 an ECS instance

  • Express: self-managed database that is connected over an Express Connect circuit

  • dg: self-managed database that is connected over Database Gateway (DG)

  • cen: self-managed database that is connected over Cloud Enterprise Network (CEN)

InstanceTypeForCreation

String

No

No

The type of the source instance for the synchronization channel.

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

Property

Type

Required

Editable

Description

Constraint

TableExcludes

List

No

No

The names of tables that you do not want to synchronize from the source database.

None.

NewSchemaName

String

No

No

The mapped name of the schema that you want to synchronize to the destination instance.

None.

NewDBName

String

No

No

The mapped name of the database that you want to synchronize to the destination instance.

None.

TableIncludes

List

No

No

The names of tables that you want to synchronize from the source database.

None.

SchemaName

String

No

No

The name of the schema that you want to synchronize.

None.

DBName

String

No

No

The name of the database that you want to synchronize.

None.

TableExcludes syntax

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

TableExcludes property

Property

Type

Required

Editable

Description

Constraint

TableName

String

No

No

The table name.

None.

TableIncludes syntax

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

TableIncludes properties

Property

Type

Required

Editable

Description

Constraint

TableName

String

No

No

The name of the table that you want to synchronize.

None.

FilterCondition

String

No

No

The filter condition.

None.

ColumnExcludes

List

No

No

The names of the columns that you do not want to synchronize.

None.

ColumnIncludes

List

No

No

The names of the columns that you want to synchronize.

None.

NewTableName

String

No

No

The mapped name of the table that you want to synchronize to the destination instance.

None.

ColumnExcludes syntax

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

ColumnExcludes property

Property

Type

Required

Editable

Description

Constraint

ColumnName

String

No

No

The name of the column that you do not want to synchronize.

None.

ColumnIncludes syntax

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

ColumnIncludes properties

Property

Type

Required

Editable

Description

Constraint

NewColumnName

String

No

No

The mapped name of the column that you want to synchronize to the destination instance.

None.

ColumnName

String

No

No

The name of the column that you want to synchronize.

None.

DestinationEndpoint syntax

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

DestinationEndpoint properties

Property

Type

Required

Editable

Description

Constraint

UserName

String

No

No

The username that is used to access the destination instance.

You must specify this property 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 property when the destination instance is an ApsaraDB for Redis instance.

InstanceId

String

No

No

The ID of the destination instance.

  • If the destination instance is a MaxCompute project, set the value to the name of the MaxCompute project.

  • If the destination instance is an AnalyticDB for MySQL cluster, set the value to the ID of the AnalyticDB for MySQL cluster.

  • If the destination instance is a DataHub project, set the value to the name of the DataHub project.

IP

String

No

No

The IP address of the destination instance.

You must specify this property when the destination instance is an on-premises database that is connected over an Express Connect circuit.

InstanceType

String

Yes

No

The type of the destination instance.

Valid values:

  • Redis: ApsaraDB for Redis instance

  • RDS (default): ApsaraDB RDS instance

  • POLARDB: PolarDB for MySQL cluster

  • ECS: self-managed database that is hosted on an ECS instance

  • Express: self-managed database that is connected over an Express Connect circuit

  • MaxCompute: MaxCompute project

  • DataHub: DataHub project

  • AnalyticDB: AnalyticDB for MySQL V2.0 cluster

  • AnalyticDB30: AnalyticDB for MySQL V3.0 cluster

InstanceTypeForCreation

String

No

No

The type of the destination instance for the synchronization channel.

Valid values:

  • MySQL

  • PolarDB

  • Redis

  • MaxCompute

  • DataHub

  • Kafka

  • Elasticsearch

  • Tablestore

Password

String

No

No

The password that is used to access the destination instance.

You must specify this property when the destination instance is an ECS instance or an on-premises database that is connected over an Express Connect circuit.

Port

String

No

No

The listening port of the destination instance.

You must specify this property when the destination instance is an ECS instance or an on-premises database that is connected over an Express Connect circuit.

Return values

Fn::GetAtt

SynchronizationJobId: the ID of the data synchronization instance.

Examples

  • YAML format

    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
  • JSON format

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