forked from aliyun/ros-templates
-
Notifications
You must be signed in to change notification settings - Fork 1
/
flink-hologres-data-warehouse.yml
392 lines (390 loc) · 11.9 KB
/
flink-hologres-data-warehouse.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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
ROSTemplateFormatVersion: '2015-09-01'
Description:
zh: 基于Flink+Hologres搭建实时数仓。
en: Build real-time warehouse based on Flink+Hologres.
Parameters:
FlinkZoneId:
Type: String
Label:
en: Available Zone ID
zh-cn: 可用区ID
Description:
en: Availability Zone ID,<br><b>note: <font color='blue'>It is used to create
VSwitch and used for Flink instance.</font></b>
zh-cn: 可用区ID。<br><b>注:用于创建VSwitch,并给Flink实例使用。
AssociationProperty: ZoneId
HologresZoneId:
Type: String
Label:
en: Available Zone ID
zh-cn: 可用区ID
Description:
en: Availability Zone ID,<br><b>note: <font color='blue'>It is used to create
VSwitch and used for Hologres instance.</font></b>
zh-cn: 可用区ID。<br><b>注:用于创建VSwitch,并给Hologres实例使用。
AssociationProperty: ZoneId
BucketName:
Type: String
Label:
en: Bucket Name
zh-cn: 存储空间名称
Description:
en: The name must be 3 to 63 bytes in length, The name must start and end with
a lowercase letter or digit.The name can contain only lowercase letters, digits,
and hyphens (-).;<br><b>note:<font color='blue'>A bucket name must be globally
unique within OSS. Bucket names cannot be changed after the bucket is created.</b></font>
zh-cn: 长度为3~63个字符,必须以小写字母或数字开头和结尾,可以包含小写字母、数字和连字符(-);<br><b>注:<font color='blue'>需要全网唯一性,已经存在的不能在创建。</b></font>
AssociationProperty: AutoCompleteInput
AssociationPropertyMetadata:
Length: 10
Prefix: bucket-create-by-ros-
CharacterClasses:
- Class: lowercase
min: 1
FlinkInstanceName:
Type: String
Label:
en: Flink Instance Name
zh-cn: Flink实例名称
Description:
en: The name must be 1 to 60 bytes in length, The name must start and end with
a lowercase letter.The name can contain only lowercase letters, digits, and
hyphens (-).;<br><b>note:<font color='blue'>A instance name must be globally
unique within Flink. The name cannot be changed after the flink instance is
created.</b></font>
zh-cn: 长度为1~60个字符,必须以小写字母开头和结尾,可以包含小写字母、数字和连字符(-);<br><b>注:<font color='blue'>需要全网唯一性,已经存在的不能在创建。</b></font>
AssociationProperty: AutoCompleteInput
AssociationPropertyMetadata:
Length: 10
Prefix: instance-create-by-ros-
CharacterClasses:
- Class: lowercase
min: 1
HologresInstanceName:
Type: String
Label:
en: Hologres Instance Name
zh-cn: Hologres实例名称
Description:
en: The name must be 2 to 64 bytes in length.
zh-cn: 长度为2~64个字符。
AssociationProperty: AutoCompleteInput
AssociationPropertyMetadata:
Length: 10
Prefix: instance-create-by-ros-
CharacterClasses:
- Class: lowercase
min: 1
DBInstanceNetType:
Type: String
Label:
en: Instance Net Type
zh-cn: 实例网络类型
Description:
en: RDS Instance Net Type
zh-cn: RDS实例网络类型
AllowedValues:
- Intranet
- Internet
Default: Intranet
EngineVersion:
Type: String
Label:
en: Engine Version
zh-cn: 数据库版本号
AssociationProperty: ALIYUN::RDS::Engine::EngineVersion
AssociationPropertyMetadata:
Engine: MySQL
Default: "8.0"
DBInstanceStorageType:
Type: String
Label:
zh-cn: 实例存储类型
en: Storage Type
Description:
zh-cn: 实例存储类型;<br>请参见详细信息:<a href='https://help.aliyun.com/document_detail/69795.html'
target='_blank'><b><font color='blue'>存储类型</font></b></a>
en: The storage type of DB instance; see detail <a href='https://www.alibabacloud.com/help/en/apsaradb-for-rds/latest/storage-types'
target='_blank'><b><font color=''blue''>Storage types</font></b></a>'
AllowedValues:
- local_ssd
- cloud_ssd
- cloud_essd
- cloud_essd2
- cloud_essd3
Default: cloud_essd
DBInstanceClass:
Type: String
Label:
en: Instance Class
zh-cn: 实例规格
AssociationProperty: ALIYUN::RDS::Instance::InstanceType
AssociationPropertyMetadata:
ZoneId: ${FlinkZoneId}
EngineVersion: ${EngineVersion}
DBInstanceStorageType: ${DBInstanceStorageType}
Engine: MySQL
Category: HighAvailability
DBInstanceStorage:
Type: Number
Label:
en: Instance Storage
zh-cn: 实例存储
Description:
en: 'Incrementing in every 5G, unit: GB'
zh-cn: 每5G递增,单位:GB
ConstraintDescription:
en: '[5, 2000] Incrementing in every 5G, unit: GB'
zh-cn: '[5, 2000] 每 5G 递增,单位:GB'
MinValue: 5
MaxValue: 2000
Default: 20
RdsUserType:
Type: String
Label:
zh-cn: 账号类型
en: RDS Account Type
Description:
zh-cn: '数据库账号类型,<b><font color=''blue''>可选值:</font></b><br>[Normal: <font color=''green''>普通账号</font>]<br>[Super: <font color=''green''>高权限账号</font>]'
en: 'Database account type, <b><font color=''blue''>AllowedValues: </font></b><br>[Normal: <font color=''green''>Ordinary account</font>]<br>[Super: <font color=''green''>High-privilege account</font>]'
AllowedValues:
- Super
- Normal
Default: Super
DBName:
Type: String
Label:
zh-cn: 数据库名称
en: DB Name
Description:
zh-cn: 数据库名称,由小写字母、数字及特殊字符(-_)组成,以字母开头,字母或数字结尾,最多64个字符。
en: Database name, consisting of lowercase letters, Numbers, and special characters (-_), starting with letters, ending with letters or Numbers, up to 64 characters.
Default: demodb
RdsAccountName:
Type: String
Label:
zh-cn: 账号
en: Account
Description:
zh-cn: 2~256个字符,以中文、英文字母开头,可以包含可以包含数字、中文、英文、下划线、短横线。
en: 2~256 characters, beginning with Chinese and English letters, can contain can contain Numbers, Chinese, English, underline, dash line.
Default: demouser
RdsAccountPwd:
Type: String
Label:
zh-cn: 帐号密码
en: Account Password
Description:
zh-cn: 长度8-32个字符,可包含大小字母、数字及特殊符号(包含:!@#$%^&*-+=_)。
en: 'Length 8-32 characters, can contain size letters, Numbers and special symbols (including:!@ # $% ^ & * - + = _).'
ConstraintDescription:
zh-cn: 8-32个字符,可包含大小字母、数字及特殊符号(包含:!@#$%^&*-+=_)。
en: '8-32 characters, can contain size letters, Numbers and special symbols (including:!@ # $% ^ & * - + = _).'
AllowedPattern: '^(?=.*[A-Z])(?=.*[a-z])(?=.*\d)(?=.*[!@#$%^&*\-+=_]).{8,32}$'
NoEcho: true
Resources:
VPC:
Type: ALIYUN::ECS::VPC
Properties:
VpcName: vpc-create-by-ros
CidrBlock: 192.168.0.0/16
FlinkVSwitch:
Type: ALIYUN::ECS::VSwitch
Properties:
ZoneId:
Ref: FlinkZoneId
VpcId:
Ref: VPC
VSwitchName: vsw-create-by-ros
CidrBlock: 192.168.0.0/24
HologresVSwitch:
Type: ALIYUN::ECS::VSwitch
Properties:
ZoneId:
Ref: HologresZoneId
VpcId:
Ref: VPC
VSwitchName: vsw-create-by-ros
CidrBlock: 192.168.255.0/24
OSSBucket:
Type: ALIYUN::OSS::Bucket
Properties:
BucketName:
Ref: BucketName
FlinkInstance:
Type: ALIYUN::Flink::Instance
Properties:
ZoneId:
Ref: FlinkZoneId
VpcId:
Ref: VPC
VSwitchIds:
- Ref: FlinkVSwitch
InstanceName:
Ref: FlinkInstanceName
ChargeType: Postpaid
Bucket:
Ref: OSSBucket
HologresInstance:
Type: ALIYUN::Hologram::Instance
Properties:
ZoneId:
Ref: HologresZoneId
ProductCode: hologram_postpay_public_cn
Endpoints:
- VpcId:
Ref: VPC
VSwitchId:
Ref: HologresVSwitch
Type: VPCSingleTunnel
InstanceType: Standard
PaymentType: PostPaid
PricingCycle: Hour
Cpu: 8
InstanceName:
Ref: HologresInstanceName
InitialDatabases: order_dw
Rds:
Type: ALIYUN::RDS::DBInstance
Properties:
EngineVersion:
Ref: EngineVersion
DBInstanceClass:
Ref: DBInstanceClass
DBInstanceNetType:
Ref: DBInstanceNetType
SecurityIPList: 0.0.0.0/0
Category: HighAvailability
DBInstanceStorageType:
Ref: DBInstanceStorageType
DBInstanceStorage:
Ref: DBInstanceStorage
Engine: MySQL
VpcId:
Ref: VPC
VSwitchId:
Ref: FlinkVSwitch
AllocatePublicConnection: true
DBMappings:
- CharacterSetName: utf8
DBName:
Ref: DBName
RdsDatabase:
Type: ALIYUN::RDS::Database
Properties:
CharacterSetName: utf8
DBInstanceId:
Ref: Rds
DBName: order_dw
RdsAccount:
DependsOn:
- Rds
Type: ALIYUN::RDS::Account
Properties:
DBInstanceId:
Ref: Rds
AccountPassword:
Ref: RdsAccountPwd
AccountType:
Ref: RdsUserType
AccountName:
Ref: RdsAccountName
Metadata:
'ALIYUN::ROS::Interface':
ParameterGroups:
- Parameters:
- FlinkZoneId
- HologresZoneId
Label:
default:
en: Availability Zone
zh-cn: 可用区配置
- Parameters:
- DBInstanceNetType
- EngineVersion
- DBInstanceStorageType
- DBInstanceStorage
- DBInstanceClass
- DBName
- RdsUserType
- RdsAccountName
- RdsAccountPwd
Label:
en: RDS Configuration
zh-cn: RDS配置
- Parameters:
- BucketName
Label:
default:
en: OSS
zh-cn: OSS配置
- Parameters:
- FlinkInstanceName
Label:
default:
en: Flink
zh-cn: Flink配置
- Parameters:
- HologresInstanceName
Label:
default:
en: Hologres
zh-cn: Hologres配置
TemplateTags:
- 'acs:technical-solution:data-analysis:Flink+Hologres搭建实时数仓-tech_solu_15'
Outputs:
PublicConnectionString:
Description:
zh-cn: 公网连接命令行。
en: Rds Public Connection command line.
Value:
Fn::Sub:
- mysql -h${PublicConnectionString} -u${RdsAccountName} -P${RdsPublicPort} -p
- PublicConnectionString:
Fn::GetAtt:
- Rds
- PublicConnectionString
RdsAccountName:
Ref: RdsAccountName
RdsPublicPort:
Fn::GetAtt:
- Rds
- PublicPort
RdsPublicConnectionString:
Description:
zh-cn: 公网连接地址。
en: Rds Public Connection address.
Value:
Fn::GetAtt:
- Rds
- PublicConnectionString
RdsPublicPort:
Description:
zh-cn: 数据库实例公网端口
en: Public network port of the database instance
Value:
Fn::GetAtt:
- Rds
- PublicPort
RdsInnerConnectionString:
Description:
zh-cn: 内网连接地址。
en: Rds Inner Connection address.
Value:
Fn::GetAtt:
- Rds
- InnerConnectionString
RdsInnerPort:
Description:
zh-cn: 数据库实例内网端口
en: Inner network port of the database instance
Value:
Fn::GetAtt:
- Rds
- InnerPort
RdsAccountName:
Description:
zh-cn: 账号
en: Account
Value:
Ref: RdsAccountName