-
Notifications
You must be signed in to change notification settings - Fork 141
/
Copy pathresource_tc_ckafka_datahub_task.go
11002 lines (9999 loc) · 404 KB
/
resource_tc_ckafka_datahub_task.go
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
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
package ckafka
import (
"context"
"log"
"time"
tccommon "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/common"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
ckafka "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ckafka/v20190819"
"github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/internal/helper"
)
func ResourceTencentCloudCkafkaDatahubTask() *schema.Resource {
return &schema.Resource{
Create: resourceTencentCloudCkafkaDatahubTaskCreate,
Read: resourceTencentCloudCkafkaDatahubTaskRead,
Update: resourceTencentCloudCkafkaDatahubTaskUpdate,
Delete: resourceTencentCloudCkafkaDatahubTaskDelete,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},
Schema: map[string]*schema.Schema{
"task_name": {
Required: true,
Type: schema.TypeString,
Description: "name of the task.",
},
"task_type": {
Required: true,
ForceNew: true,
Type: schema.TypeString,
Description: "type of the task, SOURCE(data input), SINK(data output).",
},
"source_resource": {
Optional: true,
ForceNew: true,
Type: schema.TypeList,
MaxItems: 1,
Description: "data resource.",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"type": {
Type: schema.TypeString,
Required: true,
Description: "resource type.",
},
"kafka_param": {
Type: schema.TypeList,
MaxItems: 1,
Optional: true,
Description: "ckafka configuration, required when Type is KAFKA.",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"self_built": {
Type: schema.TypeBool,
Required: true,
Description: "whether the cluster is built by yourself instead of cloud product.",
},
"resource": {
Type: schema.TypeString,
Required: true,
Description: "instance resource.",
},
"topic": {
Type: schema.TypeString,
Optional: true,
Description: "Topic name, use `,` when more than 1 topic.",
},
"offset_type": {
Type: schema.TypeString,
Optional: true,
Description: "Offset type, from beginning:earliest, from latest:latest, from specific time:timestamp.",
},
"start_time": {
Type: schema.TypeInt,
Optional: true,
Description: "when Offset type timestamp is required.",
},
"resource_name": {
Type: schema.TypeString,
Optional: true,
Description: "instance name.",
},
"zone_id": {
Type: schema.TypeInt,
Optional: true,
Description: "Zone ID.",
},
"topic_id": {
Type: schema.TypeString,
Optional: true,
Description: "Topic id.",
},
"partition_num": {
Type: schema.TypeInt,
Optional: true,
Description: "the partition num of the topic.",
},
"enable_toleration": {
Type: schema.TypeBool,
Optional: true,
Description: "enable dead letter queue.",
},
"qps_limit": {
Type: schema.TypeInt,
Optional: true,
Description: "Qps(query per seconds) limit.",
},
"table_mappings": {
Type: schema.TypeList,
Optional: true,
Description: "maps of table to topic, required when multi topic is selected.",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"database": {
Type: schema.TypeString,
Required: true,
Description: "database name.",
},
"table": {
Type: schema.TypeString,
Required: true,
Description: "table name,use, to separate.",
},
"topic": {
Type: schema.TypeString,
Required: true,
Description: "Topic name.",
},
"topic_id": {
Type: schema.TypeString,
Required: true,
Description: "Topic ID.",
},
},
},
},
"use_table_mapping": {
Type: schema.TypeBool,
Optional: true,
Description: "whether to use multi table.",
},
"use_auto_create_topic": {
Type: schema.TypeBool,
Optional: true,
Description: "Does the used topic need to be automatically created (currently only supports SOURCE inflow tasks, if you do not use to distribute to multiple topics, you need to fill in the topic name that needs to be automatically created in the Topic field).",
},
"compression_type": {
Type: schema.TypeString,
Optional: true,
Description: "Whether to compress when writing to the Topic, if it is not enabled, fill in none, if it is enabled, fill in open.",
},
"msg_multiple": {
Type: schema.TypeInt,
Optional: true,
Description: "1 source topic message is amplified into msg Multiple and written to the target topic (this parameter is currently only applicable to ckafka flowing into ckafka).",
},
},
},
},
"event_bus_param": {
Type: schema.TypeList,
MaxItems: 1,
Optional: true,
Description: "EB configuration, required when type is EB.",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"type": {
Type: schema.TypeString,
Required: true,
Description: "resource type, EB_COS/EB_ES/EB_CLS.",
},
"self_built": {
Type: schema.TypeBool,
Required: true,
Description: "Whether it is a self-built cluster.",
},
"resource": {
Type: schema.TypeString,
Required: true,
Description: "instance id.",
},
"namespace": {
Type: schema.TypeString,
Optional: true,
Description: "SCF namespace.",
},
"function_name": {
Type: schema.TypeString,
Optional: true,
Description: "SCF function name.",
},
"qualifier": {
Type: schema.TypeString,
Optional: true,
Description: "SCF version and alias.",
},
},
},
},
"mongo_db_param": {
Type: schema.TypeList,
MaxItems: 1,
Optional: true,
Description: "MongoDB config, Required when Type is MONGODB.",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"database": {
Type: schema.TypeString,
Required: true,
Description: "MongoDB database name.",
},
"collection": {
Type: schema.TypeString,
Required: true,
Description: "MongoDB collection.",
},
"copy_existing": {
Type: schema.TypeBool,
Required: true,
Description: "Whether to copy the stock data, the default parameter is true.",
},
"resource": {
Type: schema.TypeString,
Required: true,
Description: "resource id.",
},
"ip": {
Type: schema.TypeString,
Optional: true,
Description: "Mongo DB connection ip.",
},
"port": {
Type: schema.TypeInt,
Optional: true,
Description: "MongoDB connection port.",
},
"user_name": {
Type: schema.TypeString,
Optional: true,
Description: "MongoDB database user name.",
},
"password": {
Type: schema.TypeString,
Optional: true,
Description: "MongoDB database password.",
},
"listening_event": {
Type: schema.TypeString,
Optional: true,
Description: "Listening event type, if it is empty, it means select all. Values include insert, update, replace, delete, invalidate, drop, dropdatabase, rename, used between multiple types, separated by commas.",
},
"read_preference": {
Type: schema.TypeString,
Optional: true,
Description: "Master-slave priority, default master node.",
},
"pipeline": {
Type: schema.TypeString,
Optional: true,
Description: "aggregation pipeline.",
},
"self_built": {
Type: schema.TypeBool,
Optional: true,
Description: "Whether it is a self-built cluster.",
},
},
},
},
"es_param": {
Type: schema.TypeList,
MaxItems: 1,
Optional: true,
Description: "Es configuration, required when Type is ES.",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"resource": {
Type: schema.TypeString,
Required: true,
Description: "Resource.",
},
"port": {
Type: schema.TypeInt,
Optional: true,
Description: "Es connection port.",
},
"user_name": {
Type: schema.TypeString,
Optional: true,
Description: "Es UserName.",
},
"password": {
Type: schema.TypeString,
Optional: true,
Description: "Es Password.",
},
"self_built": {
Type: schema.TypeBool,
Optional: true,
Description: "Whether it is a self-built cluster.",
},
"service_vip": {
Type: schema.TypeString,
Optional: true,
Description: "instance vip.",
},
"uniq_vpc_id": {
Type: schema.TypeString,
Optional: true,
Description: "instance vpc id.",
},
"drop_invalid_message": {
Type: schema.TypeBool,
Optional: true,
Description: "Whether Es discards the message of parsing failure.",
},
"index": {
Type: schema.TypeString,
Optional: true,
Description: "Es index name.",
},
"date_format": {
Type: schema.TypeString,
Optional: true,
Description: "Es date suffix.",
},
"content_key": {
Type: schema.TypeString,
Optional: true,
Description: "key for data in non-json format.",
},
"drop_invalid_json_message": {
Type: schema.TypeBool,
Optional: true,
Description: "Whether Es discards messages in non-json format.",
},
"document_id_field": {
Type: schema.TypeString,
Optional: true,
Description: "The field name of the document ID value dumped into Es.",
},
"index_type": {
Type: schema.TypeString,
Optional: true,
Description: "Es custom index name type, STRING, JSONPATH, the default is STRING.",
},
"drop_cls": {
Type: schema.TypeList,
MaxItems: 1,
Optional: true,
Description: "When the member parameter Drop Invalid Message To Cls is set to true, the Drop Invalid Message parameter is invalid.",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"drop_invalid_message_to_cls": {
Type: schema.TypeBool,
Optional: true,
Description: "Whether to deliver to cls.",
},
"drop_cls_region": {
Type: schema.TypeString,
Optional: true,
Description: "The region where the cls is delivered.",
},
"drop_cls_owneruin": {
Type: schema.TypeString,
Optional: true,
Description: "Delivery account of cls.",
},
"drop_cls_topic_id": {
Type: schema.TypeString,
Optional: true,
Description: "topic of cls.",
},
"drop_cls_log_set": {
Type: schema.TypeString,
Optional: true,
Description: "cls log set.",
},
},
},
},
"database_primary_key": {
Type: schema.TypeString,
Optional: true,
Description: "When the message dumped to ES is the binlog of Database, if you need to synchronize database operations, that is, fill in the primary key of the database table when adding, deleting, and modifying operations to ES.",
},
"drop_dlq": {
Type: schema.TypeList,
MaxItems: 1,
Optional: true,
Description: "dead letter queue.",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"type": {
Type: schema.TypeString,
Required: true,
Description: "type, DLQ dead letter queue, IGNORE_ERROR|DROP.",
},
"kafka_param": {
Type: schema.TypeList,
MaxItems: 1,
Optional: true,
Description: "Ckafka type dlq.",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"self_built": {
Type: schema.TypeBool,
Required: true,
Description: "Whether it is a self-built cluster.",
},
"resource": {
Type: schema.TypeString,
Required: true,
Description: "resource id.",
},
"topic": {
Type: schema.TypeString,
Optional: true,
Description: "Topic name, multiple separated by `,`.",
},
"offset_type": {
Type: schema.TypeString,
Optional: true,
Description: "Offset type, initial position earliest, latest position latest, time point position timestamp.",
},
"start_time": {
Type: schema.TypeInt,
Optional: true,
Description: "It must be passed when the Offset type is timestamp, and the time stamp is passed, accurate to the second.",
},
"resource_name": {
Type: schema.TypeString,
Optional: true,
Description: "resource id name.",
},
"zone_id": {
Type: schema.TypeInt,
Optional: true,
Description: "Zone ID.",
},
"topic_id": {
Type: schema.TypeString,
Optional: true,
Description: "Topic Id.",
},
"partition_num": {
Type: schema.TypeInt,
Optional: true,
Description: "Partition num.",
},
"enable_toleration": {
Type: schema.TypeBool,
Optional: true,
Description: "Enable the fault-tolerant instance and enable the dead-letter queue.",
},
"qps_limit": {
Type: schema.TypeInt,
Optional: true,
Description: "Qps limit.",
},
"table_mappings": {
Type: schema.TypeList,
Optional: true,
Description: "The route from Table to Topic must be passed when the Distribute to multiple topics switch is turned on.",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"database": {
Type: schema.TypeString,
Required: true,
Description: "database name.",
},
"table": {
Type: schema.TypeString,
Required: true,
Description: "Table name, multiple tables, separated by (commas).",
},
"topic": {
Type: schema.TypeString,
Required: true,
Description: "Topic name.",
},
"topic_id": {
Type: schema.TypeString,
Required: true,
Description: "Topic ID.",
},
},
},
},
"use_table_mapping": {
Type: schema.TypeBool,
Optional: true,
Description: "Distribute to multiple topics switch, the default is false.",
},
"use_auto_create_topic": {
Type: schema.TypeBool,
Optional: true,
Description: "whether the used topic need to be automatically created (currently only supports SOURCE inflow tasks, if you do not use to distribute to multiple topics, you need to fill in the topic name that needs to be automatically created in the Topic field).",
},
"compression_type": {
Type: schema.TypeString,
Optional: true,
Description: "Whether to compress when writing to the Topic, if it is not enabled, fill in none, if it is enabled, fill in open.",
},
"msg_multiple": {
Type: schema.TypeInt,
Optional: true,
Description: "1 source topic message is amplified into msg Multiple and written to the target topic (this parameter is currently only applicable to ckafka flowing into ckafka).",
},
},
},
},
"retry_interval": {
Type: schema.TypeInt,
Optional: true,
Description: "retry interval.",
},
"max_retry_attempts": {
Type: schema.TypeInt,
Optional: true,
Description: "retry times.",
},
"topic_param": {
Type: schema.TypeList,
MaxItems: 1,
Optional: true,
Description: "DIP Topic type dead letter queue.",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"resource": {
Type: schema.TypeString,
Required: true,
Description: "The topic name of the topic sold separately.",
},
"offset_type": {
Type: schema.TypeString,
Optional: true,
Description: "Offset type, initial position earliest, latest position latest, time point position timestamp.",
},
"start_time": {
Type: schema.TypeInt,
Optional: true,
Description: "It must be passed when the Offset type is timestamp, and the time stamp is passed, accurate to the second.",
},
"topic_id": {
Type: schema.TypeString,
Optional: true,
Description: "TopicId.",
},
"compression_type": {
Type: schema.TypeString,
Optional: true,
Description: "Whether to perform compression when writing a topic, if it is not enabled, fill in none, if it is enabled, you can choose one of gzip, snappy, lz4 to fill in.",
},
"use_auto_create_topic": {
Type: schema.TypeBool,
Optional: true,
Description: "whether the used topic need to be automatically created (currently only supports SOURCE inflow tasks).",
},
"msg_multiple": {
Type: schema.TypeInt,
Optional: true,
Description: "1 source topic message is amplified into msg Multiple and written to the target topic (this parameter is currently only applicable to ckafka flowing into ckafka).",
},
},
},
},
"dlq_type": {
Type: schema.TypeString,
Optional: true,
Description: "dlq type, CKAFKA|TOPIC.",
},
},
},
},
},
},
},
"tdw_param": {
Type: schema.TypeList,
MaxItems: 1,
Optional: true,
Description: "Tdw configuration, required when Type is TDW.",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"bid": {
Type: schema.TypeString,
Required: true,
Description: "Tdw bid.",
},
"tid": {
Type: schema.TypeString,
Required: true,
Description: "Tdw tid.",
},
"is_domestic": {
Type: schema.TypeBool,
Optional: true,
Description: "default true.",
},
"tdw_host": {
Type: schema.TypeString,
Optional: true,
Description: "TDW address, defalt tl-tdbank-tdmanager.tencent-distribute.com.",
},
"tdw_port": {
Type: schema.TypeInt,
Optional: true,
Description: "TDW port, default 8099.",
},
},
},
},
"dts_param": {
Type: schema.TypeList,
MaxItems: 1,
Optional: true,
Description: "Dts configuration, required when Type is DTS.",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"resource": {
Type: schema.TypeString,
Required: true,
Description: "Dts instance Id.",
},
"ip": {
Type: schema.TypeString,
Optional: true,
Description: "Dts connection ip.",
},
"port": {
Type: schema.TypeInt,
Optional: true,
Description: "Dts connection port.",
},
"topic": {
Type: schema.TypeString,
Optional: true,
Description: "Dts topic.",
},
"group_id": {
Type: schema.TypeString,
Optional: true,
Description: "Dts consumer group Id.",
},
"group_user": {
Type: schema.TypeString,
Optional: true,
Description: "Dts account.",
},
"group_password": {
Type: schema.TypeString,
Optional: true,
Description: "Dts consumer group passwd.",
},
"tran_sql": {
Type: schema.TypeBool,
Optional: true,
Description: "False to synchronize the original data, true to synchronize the parsed json format data, the default is true.",
},
},
},
},
"click_house_param": {
Type: schema.TypeList,
MaxItems: 1,
Optional: true,
Description: "ClickHouse config, Type CLICKHOUSE requierd.",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"cluster": {
Type: schema.TypeString,
Required: true,
Description: "ClickHouse cluster.",
},
"database": {
Type: schema.TypeString,
Required: true,
Description: "ClickHouse database name.",
},
"table": {
Type: schema.TypeString,
Required: true,
Description: "ClickHouse table.",
},
"schema": {
Type: schema.TypeList,
Required: true,
Description: "ClickHouse schema.",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"column_name": {
Type: schema.TypeString,
Required: true,
Description: "column name.",
},
"json_key": {
Type: schema.TypeString,
Required: true,
Description: "The json Key name corresponding to this column.",
},
"type": {
Type: schema.TypeString,
Required: true,
Description: "type of table column.",
},
"allow_null": {
Type: schema.TypeBool,
Required: true,
Description: "Whether the column item is allowed to be empty.",
},
},
},
},
"resource": {
Type: schema.TypeString,
Required: true,
Description: "resource id.",
},
"ip": {
Type: schema.TypeString,
Optional: true,
Description: "ClickHouse ip.",
},
"port": {
Type: schema.TypeInt,
Optional: true,
Description: "ClickHouse port.",
},
"user_name": {
Type: schema.TypeString,
Optional: true,
Description: "ClickHouse user name.",
},
"password": {
Type: schema.TypeString,
Optional: true,
Description: "ClickHouse passwd.",
},
"service_vip": {
Type: schema.TypeString,
Optional: true,
Description: "instance vip.",
},
"uniq_vpc_id": {
Type: schema.TypeString,
Optional: true,
Description: "instance vpc id.",
},
"self_built": {
Type: schema.TypeBool,
Optional: true,
Description: "Whether it is a self-built cluster.",
},
"drop_invalid_message": {
Type: schema.TypeBool,
Optional: true,
Description: "Whether ClickHouse discards the message that fails to parse, the default is true.",
},
"type": {
Type: schema.TypeString,
Optional: true,
Description: "ClickHouse type, emr-clickhouse: emr;cdw-clickhouse: cdwch; selfBuilt: ``.",
},
"drop_cls": {
Type: schema.TypeList,
MaxItems: 1,
Optional: true,
Description: "When the member parameter Drop Invalid Message To Cls is set to true, the Drop Invalid Message parameter is invalid.",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"drop_invalid_message_to_cls": {
Type: schema.TypeBool,
Optional: true,
Description: "Whether to deliver to cls.",
},
"drop_cls_region": {
Type: schema.TypeString,
Optional: true,
Description: "cls region.",
},
"drop_cls_owneruin": {
Type: schema.TypeString,
Optional: true,
Description: "cls account.",
},
"drop_cls_topic_id": {
Type: schema.TypeString,
Optional: true,
Description: "cls topicId.",
},
"drop_cls_log_set": {
Type: schema.TypeString,
Optional: true,
Description: "cls LogSet id.",
},
},
},
},
},
},
},
"cls_param": {
Type: schema.TypeList,
MaxItems: 1,
Optional: true,
Description: "Cls configuration, Required when Type is CLS.",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"decode_json": {
Type: schema.TypeBool,
Required: true,
Description: "Whether the produced information is in json format.",
},
"resource": {
Type: schema.TypeString,
Required: true,
Description: "cls id.",
},
"log_set": {
Type: schema.TypeString,
Optional: true,
Description: "LogSet id.",
},
"content_key": {
Type: schema.TypeString,
Optional: true,
Description: "Required when Decode Json is false.",
},
"time_field": {
Type: schema.TypeString,
Optional: true,
Description: "Specify the content of a field in the message as the time of the cls log. The format of the field content needs to be a second-level timestamp.",
},
},
},
},
"cos_param": {
Type: schema.TypeList,
MaxItems: 1,
Optional: true,
Description: "Cos configuration, required when Type is COS.",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"bucket_name": {
Type: schema.TypeString,
Required: true,
Description: "cos bucket name.",
},
"region": {
Type: schema.TypeString,
Required: true,
Description: "region code.",
},
"object_key": {
Type: schema.TypeString,
Optional: true,
Description: "ObjectKey.",
},
"aggregate_batch_size": {
Type: schema.TypeInt,
Optional: true,
Description: "The size of aggregated messages MB.",
},
"aggregate_interval": {
Type: schema.TypeInt,
Optional: true,
Description: "time interval.",
},
"format_output_type": {
Type: schema.TypeString,
Optional: true,
Description: "The file format after message aggregation csv|json.",
},
"object_key_prefix": {
Type: schema.TypeString,
Optional: true,
Description: "Dumped object directory prefix.",
},
"directory_time_format": {
Type: schema.TypeString,
Optional: true,
Description: "Partition format formatted according to strptime time.",
},
},
},
},
"my_sql_param": {
Type: schema.TypeList,
MaxItems: 1,
Optional: true,
Description: "MySQL configuration, Required when Type is MYSQL.",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"database": {
Type: schema.TypeString,
Required: true,
Description: "MySQL database name, * is the whole database.",
},
"table": {
Type: schema.TypeString,
Required: true,
Description: "The name of the MySQL data table, is the non-system table in all the monitored databases, which can be separated by, to monitor multiple data tables, but the data table needs to be filled in the format of data database name.data table name, when a regular expression needs to be filled in, the format is data database name.data table name.",
},
"resource": {
Type: schema.TypeString,
Required: true,
Description: "MySQL connection Id.",
},
"snapshot_mode": {
Type: schema.TypeString,
Optional: true,
Description: "whether to Copy inventory information (schema_only does not copy, initial full amount), the default is initial.",
},
"ddl_topic": {
Type: schema.TypeString,
Optional: true,
Description: "The Topic that stores the Ddl information of My SQL, if it is empty, it will not be stored by default.",
},
"data_source_monitor_mode": {
Type: schema.TypeString,
Optional: true,
Description: "TABLE indicates that the read item is a table, QUERY indicates that the read item is a query.",
},
"data_source_monitor_resource": {
Type: schema.TypeString,
Optional: true,
Description: "When DataMonitorMode=TABLE, pass in the Table that needs to be read; when DataMonitorMode=QUERY, pass in the query sql statement that needs to be read.",
},
"data_source_increment_mode": {
Type: schema.TypeString,
Optional: true,
Description: "TIMESTAMP indicates that the incremental column is of timestamp type, INCREMENT indicates that the incremental column is of self-incrementing id type'.",
},
"data_source_increment_column": {
Type: schema.TypeString,
Optional: true,
Description: "The name of the column to be monitored.",
},
"data_source_start_from": {
Type: schema.TypeString,
Optional: true,
Description: "HEAD means copy stock + incremental data, TAIL means copy only incremental data.",
},
"data_target_insert_mode": {
Type: schema.TypeString,
Optional: true,
Description: "INSERT means insert using Insert mode, UPSERT means insert using Upsert mode.",
},
"data_target_primary_key_field": {
Type: schema.TypeString,
Optional: true,
Description: "When DataInsertMode=UPSERT, pass in the primary key that the current upsert depends on.",
},
"data_target_record_mapping": {
Type: schema.TypeList,
Optional: true,
Description: "Mapping relationship between tables and messages.",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"json_key": {
Type: schema.TypeString,
Optional: true,
Description: "The key name of the message.",
},
"type": {
Type: schema.TypeString,
Optional: true,
Description: "message type.",
},
"allow_null": {
Type: schema.TypeBool,
Optional: true,
Description: "Whether the message is allowed to be empty.",
},
"column_name": {
Type: schema.TypeString,
Optional: true,
Description: "Corresponding mapping column name.",
},
"extra_info": {
Type: schema.TypeString,
Optional: true,
Description: "Database table extra fields.",
},
"column_size": {
Type: schema.TypeString,
Optional: true,
Description: "current column size.",
},
"decimal_digits": {
Type: schema.TypeString,
Optional: true,