forked from aliyun/ros-templates
-
Notifications
You must be signed in to change notification settings - Fork 1
/
dts.yml
165 lines (165 loc) · 4.05 KB
/
dts.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
ROSTemplateFormatVersion: '2015-09-01'
Description: DTS MigrationJob/SynchronizationJob resource example
Parameters:
VpcId:
Type: String
AssociationProperty: ALIYUN::ECS::VPC::VPCId
VSwitchId:
Type: String
AssociationProperty: ALIYUN::ECS::VSwitch::VSwitchId
AssociationPropertyMetadata:
VpcId: VpcId
InstanceId:
Type: String
RdsDBName:
Type: String
RdsUserName:
Type: String
MinLength: 2
MaxLength: 16
RdsUserPassword:
Type: String
MinLength: 8
MaxLength: 32
NoEcho: true
DtsMigrationJobName:
Type: String
ConsumerGroupPassword:
Type: String
Description: Password of consumer group.
ConsumerGroupUserName:
Type: String
Description: User name of consumer group.
ConsumerGroupName:
Type: String
Description: Consumer group name.
SubscriptionInstanceName:
Type: String
Resources:
DtsMigrationJob:
Type: ALIYUN::DTS::MigrationJob
Properties:
MigrationJobClass: small
MigrationJobName:
Ref: DtsMigrationJobName
MigrationMode:
StructureIntialization: true
DataSynchronization: true
DataIntialization: true
SourceEndpoint:
UserName:
Ref: RdsUserName
InstanceID:
Ref: InstanceId
Region:
Ref: ALIYUN::Region
InstanceType: RDS
Password:
Ref: RdsUserPassword
Port: '3306'
DestinationEndpoint:
EngineName: MySQL
Port: '3306'
Region:
Ref: ALIYUN::Region
InstanceID:
Ref: InstanceId
Password:
Ref: RdsUserPassword
UserName:
Ref: RdsUserName
InstanceType: RDS
MigrationObject:
- DBName:
Ref: RdsDBName
SynchronizationJob:
Type: ALIYUN::DTS::SynchronizationJob
Properties:
SynchronizationJobClass: small
SourceEndpoint:
InstanceId:
Ref: InstanceId
InstanceTypeForCreation: MySQL
InstanceType: RDS
PayType: Postpaid
DataInitialization: false
DestRegion:
Ref: ALIYUN::Region
SourceRegion:
Ref: ALIYUN::Region
NetworkType: Internet
DestinationEndpoint:
InstanceId:
Ref: InstanceId
InstanceTypeForCreation: MySQL
InstanceType: RDS
StructureInitialization: false
DependsOn: DtsMigrationJob
SubscriptionInstance:
Type: ALIYUN::DTS::SubscriptionInstance
Properties:
SourceEndpointInstanceType: MySQL
Configuration:
SubscriptionObject:
- DBName:
Ref: RdsDBName
SubscriptionDataType:
DDL: true
DML: false
SubscriptionInstanceName:
Ref: SubscriptionInstanceName
SourceEndpoint:
InstanceType: RDS
UserName:
Ref: RdsUserName
Password:
Ref: RdsUserPassword
InstanceID:
Ref: InstanceId
SubscriptionInstanceNetworkType: vpc
SubscriptionInstance:
VPCId:
Ref: VpcId
VSwitchId:
Ref: VSwitchId
ConsumerGroup:
Type: ALIYUN::DTS::ConsumerGroup
Properties:
ConsumerGroupPassword:
Ref: ConsumerGroupPassword
ConsumerGroupUserName:
Ref: ConsumerGroupUserName
ConsumerGroupName:
Ref: ConsumerGroupName
SubscriptionInstanceId:
Ref: SubscriptionInstance
DependsOn: SubscriptionInstance
Outputs:
MigrationJobId:
Value:
Fn::GetAtt:
- DtsMigrationJob
- MigrationJobId
SynchronizationJobId:
Value:
Fn::GetAtt:
- SynchronizationJob
- SynchronizationJobId
SubscriptionInstanceId:
Description: The ID of Data subscription instance.
Value:
Fn::GetAtt:
- SubscriptionInstance
- SubscriptionInstanceId
ConsumerGroupID:
Description: Consumer group ID
Value:
Fn::GetAtt:
- ConsumerGroup
- ConsumerGroupID
ConsumerGroupName:
Description: Consumer group name
Value:
Fn::GetAtt:
- ConsumerGroup
- ConsumerGroupName