ALIYUN::DTS::SynchronizationJob类型用于购买同步实例、配置同步作业。
语法
{
"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
}
}
属性
属性名称 |
类型 |
必须 |
允许更新 |
描述 |
约束 |
SynchronizationJobClass |
String |
是 |
否 |
同步实例规格。 |
取值:
- micro
- small(默认值)
- medium
- large
|
SourceEndpoint |
Map |
是 |
否 |
源实例配置。 |
详情请参见SourceEndpoint属性。
|
PayType |
String |
否 |
否 |
付费类型。 |
取值:
- Postpaid:后付费。
- Prepaid:预付费。
|
DataInitialization |
Boolean |
否 |
否 |
同步之前是否进行全量数据初始化。 |
取值:
|
Period |
String |
否 |
否 |
预付费周期。 |
取值:
PayType取值为Prepaid时生效。
|
DestRegion |
String |
是 |
否 |
目标实例所在的地域。 |
无 |
SourceRegion |
String |
是 |
否 |
源实例所在的地域。 |
无 |
UsedTime |
Integer |
否 |
否 |
预付费类型实例订购时长。 |
PayType取值为Prepaid时此参数生效。 |
SynchronizationObjects |
List |
否 |
否 |
同步对象。 |
详情请参见SynchronizationObjects属性。
|
NetworkType |
String |
否 |
否 |
当进行跨地域同步时,使用的数据传输网络类型。 |
取值:
|
DestinationEndpoint |
Map |
是 |
否 |
同步链路配置。 |
详情请参见DestinationEndpoint属性。
|
StructureInitialization |
Boolean |
否 |
否 |
同步之前是否进行结构对象初始化。 |
取值:
|
Topology |
String |
否 |
否 |
同步拓扑。 |
取值:
- oneway(默认值)
- bidirectional
只有MySQL之间的同步时,此参数才能取值bidirectional。
|
SourceEndpoint语法
"SourceEndpoint": {
"UserName": String,
"InstanceId": String,
"IP": String,
"Port": String,
"Role": String,
"OwnerID": String,
"Password": String,
"InstanceType": String,
"InstanceTypeForCreation": String
}
SourceEndpoint属性
属性名称 |
类型 |
必须 |
允许更新 |
描述 |
约束 |
UserName |
String |
否 |
否 |
源实例的访问账号。 |
当源实例为ECS或通过专线接入的本地数据库时,必须指定此参数。当源数据库为Redis时,无需指定此参数。 |
InstanceId |
String |
否 |
否 |
源实例的ID。 |
无 |
IP |
String |
否 |
否 |
源实例的IP地址。 |
当源实例为通过专线接入的本地数据库时,必须指定此参数。 |
Port |
String |
否 |
否 |
源实例的监听端口。 |
当源实例为ECS或通过专线接入的本地数据库时,必须指定此参数。 |
Role |
String |
否 |
否 |
当源实例与目标实例不属于同一个阿里云账号时,此参数为源实例所属账号对目标实例所属账号的授权角色。角色的相关权限及授权步骤,请参见DTS跨账号数据迁移或同步支持的实例类型。
|
无 |
OwnerID |
String |
否 |
否 |
当源实例与目标实例不属于同一个阿里云账号时,此参数为源实例所属阿里云账号的UID。 |
无 |
Password |
String |
否 |
否 |
源实例的访问密码。 |
当源实例为ECS或通过专线接入的本地数据库时,必须指定此参数。 |
InstanceType |
String |
是 |
否 |
源实例的类型。 |
取值:
- Redis:阿里云Redis实例。
- RDS:阿里云RDS实例。
- POLARDB:阿里云PolarDB MySQL集群 。
- ECS:ECS上的自建数据库。
- Express:通过专线接入的自建数据库。
- dg:通过数据库网关DG接入的自建数据库。
- cen:通过云企业网CEN接入的自建数据库。
|
InstanceTypeForCreation |
String |
否 |
否 |
同步链路的源实例类型。 |
取值:
- MySQL
- PolarDB
- Redis
- SQLServer
- PostgreSQL
- PolarDB-X(原DRDS升级版)
|
SynchronizationObjects 语法
"SynchronizationObjects": [
{
"TableExcludes": List,
"NewSchemaName": String,
"NewDBName": String,
"TableIncludes": List,
"SchemaName": String,
"DBName": String
}
]
SynchronizationObjects属性
属性名称 |
类型 |
必须 |
允许更新 |
描述 |
约束 |
TableExcludes |
List |
否 |
否 |
待同步数据库不需要同步的表名。 |
无 |
NewSchemaName |
String |
否 |
否 |
待同步Schema在目标实例中映射的Schema名。 |
无 |
NewDBName |
String |
否 |
否 |
待同步数据库在目标实例中映射的库名。 |
无 |
TableIncludes |
List |
否 |
否 |
待同步表。 |
无 |
SchemaName |
String |
否 |
否 |
待同步Schema名。 |
无 |
DBName |
String |
否 |
否 |
待同步数据库名。 |
无 |
TableExcludes语法
"TableExcludes": [
{
"TableName": String
}
]
TableExcludes属性
属性名称 |
类型 |
必须 |
允许更新 |
描述 |
约束 |
TableName |
String |
否 |
否 |
表名 |
无 |
TableIncludes语法
"TableIncludes": [
{
"TableName": String,
"FilterCondition": String,
"ColumnExcludes": List,
"ColumnIncludes": List,
"NewTableName": String
}
]
TableIncludes属性
属性名称 |
类型 |
必须 |
允许更新 |
描述 |
约束 |
TableName |
String |
否 |
否 |
待同步的表名。 |
无 |
FilterCondition |
String |
否 |
否 |
过滤条件。 |
无 |
ColumnExcludes |
List |
否 |
否 |
不同步的列。 |
无 |
ColumnIncludes |
List |
否 |
否 |
需同步的列。 |
无 |
NewTableName |
String |
否 |
否 |
待同步表在目标实例映射的表名。 |
无 |
ColumnExcludes语法
"ColumnExcludes": [
{
"ColumnName": String
}
]
ColumnExcludes属性
属性名称 |
类型 |
必须 |
允许更新 |
描述 |
约束 |
ColumnName |
String |
否 |
否 |
不同步的列名 |
无 |
ColumnIncludes语法
"ColumnIncludes": [
{
"NewColumnName": String,
"ColumnName": String
}
]
ColumnIncludes属性
属性名称 |
类型 |
必须 |
允许更新 |
描述 |
约束 |
NewColumnName |
String |
否 |
否 |
待同步列在目标实例中映射的列名。 |
无 |
ColumnName |
String |
否 |
否 |
需同步的列名。 |
无 |
DestinationEndpoint语法
"DestinationEndpoint": {
"UserName": String,
"InstanceId": String,
"IP": String,
"InstanceType": String,
"Password": String,
"InstanceTypeForCreation": String,
"Port": String
}
DestinationEndpoint属性
属性名称 |
类型 |
必须 |
允许更新 |
描述 |
约束 |
UserName |
String |
否 |
否 |
目标实例的访问账号。 |
当目标实例为ECS或通过专线接入的本地数据库时,必须指定此参数。当目标数据库为Redis时,无需指定此参数。 |
InstanceId |
String |
否 |
否 |
目标实例的ID。 |
- 当目标实例为MaxCompute时,指定MaxCompute实例中的Project名称。
- 当目标实例为阿里云分析型数据库MySQL版时,指定分析型数据库MySQL版的集群ID。
- 当目标实例为DataHub时,指定DataHub实例中的Project名称。
|
IP |
String |
否 |
否 |
目标实例IP地址。 |
当目标实例为通过专线接入的本地数据库时,必须指定此参数。 |
InstanceType |
String |
是 |
否 |
目标实例的类型。 |
取值:
- Redis:阿里云Redis实例。
- RDS(默认值):阿里云RDS实例。
- POLARDB:阿里云PolarDB MySQL集群。
- ECS:ECS上的自建数据库。
- Express:通过专线接入的本地数据库。
- MaxCompute:阿里云MaxCompute实例。
- DataHub:阿里云DataHub实例。
- AnalyticDB:阿里云分析型数据库MySQL版(2.0)。
- AnalyticDB30:阿里云分析型数据库MySQL版(3.0)。
|
InstanceTypeForCreation |
String |
否 |
否 |
同步链路的目标实例类型。 |
取值:
- MySQL
- PolarDB
- Redis
- MaxCompute
- DataHub
- Kafka
- Elasticsearch
- Tablestore
|
Password |
String |
否 |
否 |
目标实例的访问密码。 |
当目标实例为ECS或通过专线接入的本地数据库时,必须指定此参数。 |
Port |
String |
否 |
否 |
目标实例监听端口。 |
当目标实例为ECS或通过专线接入的本地数据库时,必须指定此参数。 |
返回值
Fn::GetAtt
SynchronizationJobId:同步实例ID。
示例
JSON
格式
{
"ROSTemplateFormatVersion": "2015-09-01",
"Parameters": {
"SynchronizationObjects": {
"Type": "Json",
"Description": "Objects that need to be synchronized"
},
"Period": {
"Type": "String",
"Description": "If prepaid payment type, then the parameters specified in the purchase package instance or instances as examples of a monthly subscription, which can be:\nYear: Annual, Month: monthly",
"AllowedValues": [
"Year",
"Month"
]
},
"PayType": {
"Type": "String",
"Description": "Payment type, which include:\nPostpaid: postpaid type, Prepaid: Prepaid type. Default is Postpaid",
"AllowedValues": [
"Postpaid",
"Prepaid"
],
"Default": "Postpaid"
},
"Topology": {
"Type": "String",
"Description": "Synchronous topology, the value includes: oneway, bidirectional.the default value is: oneway, only MySQL-> MySQL synchronization, this parameter can receive the value bidirectional"
},
"SourceRegion": {
"Type": "String",
"Description": "Region where the synchronization source instance is located."
},
"DataInitialization": {
"Type": "Boolean",
"Description": "Whether to perform full data initialization before synchronization. The values include:true: means full data initialization\nfalse: no full data initialization\nThe default value is: true",
"AllowedValues": [
"true",
"false"
],
"Default": true
},
"NetworkType": {
"Type": "String",
"Description": "When synchronization geographies, the type of data transmission network used. Value include: Internet, Intranet. The default value is: Internet",
"AllowedValues": [
"Internet",
"Intranet"
]
},
"DestinationEndpoint": {
"Type": "Json",
"Description": "Migration target configuration"
},
"SourceEndpoint": {
"Type": "Json",
"Description": "Migration source configuration"
},
"UsedTime": {
"Type": "Number",
"Description": "f the payment type is prepaid, then this parameter is the length of the purchase, and parameters such as 1, 2, 3 can be passed in as needed"
},
"StructureInitialization": {
"Type": "Boolean",
"Description": "Whether to initialize the structure object before synchronization. The values include:true: indicates that the structure object is initialized\nfalse: no result object initialization\nThe default value is: true",
"AllowedValues": [
"true",
"false"
],
"Default": true
},
"SynchronizationJobClass": {
"Type": "String",
"Description": "Synchronous instance specifications, which can be:\nmicro, small, medium, large and so on. The default value is: small"
},
"DestRegion": {
"Type": "String",
"Description": "Region where the synchronization target instance is located."
}
},
"Resources": {
"SynchronizationJob": {
"Type": "ALIYUN::DTS::SynchronizationJob",
"Properties": {
"SynchronizationObjects": {
"Ref": "SynchronizationObjects"
},
"Period": {
"Ref": "Period"
},
"PayType": {
"Ref": "PayType"
},
"Topology": {
"Ref": "Topology"
},
"SourceRegion": {
"Ref": "SourceRegion"
},
"DataInitialization": {
"Ref": "DataInitialization"
},
"NetworkType": {
"Ref": "NetworkType"
},
"DestinationEndpoint": {
"Ref": "DestinationEndpoint"
},
"SourceEndpoint": {
"Ref": "SourceEndpoint"
},
"UsedTime": {
"Ref": "UsedTime"
},
"StructureInitialization": {
"Ref": "StructureInitialization"
},
"SynchronizationJobClass": {
"Ref": "SynchronizationJobClass"
},
"DestRegion": {
"Ref": "DestRegion"
}
}
}
},
"Outputs": {
"SynchronizationJobId": {
"Description": "Synchronization instance ID",
"Value": {
"Fn::GetAtt": [
"SynchronizationJob",
"SynchronizationJobId"
]
}
}
}
}
YAML
格式
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
SynchronizationObjects:
Type: Json
Description: Objects that need to be synchronized
Period:
Type: String
Description: >-
If prepaid payment type, then the parameters specified in the purchase
package instance or instances as examples of a monthly subscription, which
can be:
Year: Annual, Month: monthly
AllowedValues:
- Year
- Month
PayType:
Type: String
Description: |-
Payment type, which include:
Postpaid: postpaid type, Prepaid: Prepaid type. Default is Postpaid
AllowedValues:
- Postpaid
- Prepaid
Default: Postpaid
Topology:
Type: String
Description: >-
Synchronous topology, the value includes: oneway, bidirectional.the
default value is: oneway, only MySQL-> MySQL synchronization, this
parameter can receive the value bidirectional
SourceRegion:
Type: String
Description: Region where the synchronization source instance is located.
DataInitialization:
Type: Boolean
Description: >-
Whether to perform full data initialization before synchronization. The
values include:true: means full data initialization
false: no full data initialization
The default value is: true
AllowedValues:
- 'true'
- 'false'
Default: true
NetworkType:
Type: String
Description: >-
When synchronization geographies, the type of data transmission network
used. Value include: Internet, Intranet. The default value is: Internet
AllowedValues:
- Internet
- Intranet
DestinationEndpoint:
Type: Json
Description: Migration target configuration
SourceEndpoint:
Type: Json
Description: Migration source configuration
UsedTime:
Type: Number
Description: >-
f the payment type is prepaid, then this parameter is the length of the
purchase, and parameters such as 1, 2, 3 can be passed in as needed
StructureInitialization:
Type: Boolean
Description: >-
Whether to initialize the structure object before synchronization. The
values include:true: indicates that the structure object is initialized
false: no result object initialization
The default value is: true
AllowedValues:
- 'true'
- 'false'
Default: true
SynchronizationJobClass:
Type: String
Description: |-
Synchronous instance specifications, which can be:
micro, small, medium, large and so on. The default value is: small
DestRegion:
Type: String
Description: Region where the synchronization target instance is located.
Resources:
SynchronizationJob:
Type: 'ALIYUN::DTS::SynchronizationJob'
Properties:
SynchronizationObjects:
Ref: SynchronizationObjects
Period:
Ref: Period
PayType:
Ref: PayType
Topology:
Ref: Topology
SourceRegion:
Ref: SourceRegion
DataInitialization:
Ref: DataInitialization
NetworkType:
Ref: NetworkType
DestinationEndpoint:
Ref: DestinationEndpoint
SourceEndpoint:
Ref: SourceEndpoint
UsedTime:
Ref: UsedTime
StructureInitialization:
Ref: StructureInitialization
SynchronizationJobClass:
Ref: SynchronizationJobClass
DestRegion:
Ref: DestRegion
Outputs:
SynchronizationJobId:
Description: Synchronization instance ID
Value:
'Fn::GetAtt':
- SynchronizationJob
- SynchronizationJobId
在文档使用中是否遇到以下问题
更多建议
匿名提交