/
dbCluster.go
622 lines (555 loc) · 28.4 KB
/
dbCluster.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
// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package clickhouse
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Provides a Click House DBCluster resource.
//
// For information about Click House DBCluster and how to use it, see [What is DBCluster](https://www.alibabacloud.com/help/zh/clickhouse/latest/api-clickhouse-2019-11-11-createdbinstance).
//
// > **NOTE:** Available since v1.134.0.
//
// ## Example Usage
//
// # Basic Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/clickhouse"
// "github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vpc"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// cfg := config.New(ctx, "")
// name := "tf-example"
// if param := cfg.Get("name"); param != "" {
// name = param
// }
// _default, err := clickhouse.GetRegions(ctx, &clickhouse.GetRegionsArgs{
// Current: pulumi.BoolRef(true),
// }, nil)
// if err != nil {
// return err
// }
// defaultNetwork, err := vpc.NewNetwork(ctx, "default", &vpc.NetworkArgs{
// VpcName: pulumi.String(name),
// CidrBlock: pulumi.String("10.4.0.0/16"),
// })
// if err != nil {
// return err
// }
// defaultSwitch, err := vpc.NewSwitch(ctx, "default", &vpc.SwitchArgs{
// VswitchName: pulumi.String(name),
// CidrBlock: pulumi.String("10.4.0.0/24"),
// VpcId: defaultNetwork.ID(),
// ZoneId: pulumi.String(_default.Regions[0].ZoneIds[0].ZoneId),
// })
// if err != nil {
// return err
// }
// _, err = clickhouse.NewDbCluster(ctx, "default", &clickhouse.DbClusterArgs{
// DbClusterVersion: pulumi.String("22.8.5.29"),
// Category: pulumi.String("Basic"),
// DbClusterClass: pulumi.String("S8"),
// DbClusterNetworkType: pulumi.String("vpc"),
// DbNodeGroupCount: pulumi.Int(1),
// PaymentType: pulumi.String("PayAsYouGo"),
// DbNodeStorage: pulumi.String("500"),
// StorageType: pulumi.String("cloud_essd"),
// VswitchId: defaultSwitch.ID(),
// VpcId: defaultNetwork.ID(),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## Import
//
// Click House DBCluster can be imported using the id, e.g.
//
// ```sh
// $ pulumi import alicloud:clickhouse/dbCluster:DbCluster example <id>
// ```
type DbCluster struct {
pulumi.CustomResourceState
// The Category of DBCluster. Valid values: `Basic`,`HighAvailability`.
Category pulumi.StringOutput `pulumi:"category"`
// (Available since v1.196.0) - The connection string of the cluster.
ConnectionString pulumi.StringOutput `pulumi:"connectionString"`
// The db cluster access white list. See `dbClusterAccessWhiteList` below.
DbClusterAccessWhiteLists DbClusterDbClusterAccessWhiteListArrayOutput `pulumi:"dbClusterAccessWhiteLists"`
// The DBCluster class. According to the category, dbClusterClass has two value ranges:
// * Under the condition that the category is the `Basic`, Valid values: `LS20`, `LS40`, `LS80`,`S8`, `S16`, `S32`, `S64`,`S80`, `S104`.
// * Under the condition that the category is the `HighAvailability`, Valid values: `LC20`, `LC40`, `LC80`,`C8`, `C16`, `C32`, `C64`, `C80`, `C104`.
DbClusterClass pulumi.StringOutput `pulumi:"dbClusterClass"`
// The DBCluster description.
DbClusterDescription pulumi.StringOutput `pulumi:"dbClusterDescription"`
// The DBCluster network type. Valid values: `vpc`.
DbClusterNetworkType pulumi.StringOutput `pulumi:"dbClusterNetworkType"`
// The DBCluster version. Valid values: `20.3.10.75`, `20.8.7.15`, `21.8.10.19`, `22.8.5.29`. **NOTE:** `19.15.2.2` is no longer supported. From version 1.191.0, `dbClusterVersion` can be set to `22.8.5.29`.
DbClusterVersion pulumi.StringOutput `pulumi:"dbClusterVersion"`
// The db node group count. The number should between 1 and 48.
DbNodeGroupCount pulumi.IntOutput `pulumi:"dbNodeGroupCount"`
// The db node storage.
DbNodeStorage pulumi.StringOutput `pulumi:"dbNodeStorage"`
// Key management service KMS key ID. It is valid and required when encryptionType is `CloudDisk`.
EncryptionKey pulumi.StringPtrOutput `pulumi:"encryptionKey"`
// Currently only supports ECS disk encryption, with a value of CloudDisk, not encrypted when empty.
EncryptionType pulumi.StringPtrOutput `pulumi:"encryptionType"`
// The maintenance window of DBCluster. Valid format: `hh:mmZ-hh:mm Z`.
MaintainTime pulumi.StringOutput `pulumi:"maintainTime"`
// The payment type of the resource. Valid values: `PayAsYouGo`,`Subscription`.
PaymentType pulumi.StringOutput `pulumi:"paymentType"`
// Pre-paid cluster of the pay-as-you-go cycle. It is valid and required when paymentType is `Subscription`. Valid values: `Month`, `Year`.
Period pulumi.StringPtrOutput `pulumi:"period"`
// (Available since v1.196.0) The connection port of the cluster.
Port pulumi.StringOutput `pulumi:"port"`
// The status of the resource. Valid values: `Running`,`Creating`,`Deleting`,`Restarting`,`Preparing`.
Status pulumi.StringOutput `pulumi:"status"`
// Storage type of DBCluster. Valid values: `cloudEssd`, `cloudEfficiency`, `cloudEssdPl2`, `cloudEssdPl3`.
StorageType pulumi.StringOutput `pulumi:"storageType"`
// The used time of DBCluster. It is valid and required when paymentType is `Subscription`.
UsedTime pulumi.StringPtrOutput `pulumi:"usedTime"`
// The id of the VPC.
VpcId pulumi.StringOutput `pulumi:"vpcId"`
// The vswitch id of DBCluster.
VswitchId pulumi.StringPtrOutput `pulumi:"vswitchId"`
// The zone ID of the instance.
ZoneId pulumi.StringOutput `pulumi:"zoneId"`
}
// NewDbCluster registers a new resource with the given unique name, arguments, and options.
func NewDbCluster(ctx *pulumi.Context,
name string, args *DbClusterArgs, opts ...pulumi.ResourceOption) (*DbCluster, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.Category == nil {
return nil, errors.New("invalid value for required argument 'Category'")
}
if args.DbClusterClass == nil {
return nil, errors.New("invalid value for required argument 'DbClusterClass'")
}
if args.DbClusterNetworkType == nil {
return nil, errors.New("invalid value for required argument 'DbClusterNetworkType'")
}
if args.DbClusterVersion == nil {
return nil, errors.New("invalid value for required argument 'DbClusterVersion'")
}
if args.DbNodeGroupCount == nil {
return nil, errors.New("invalid value for required argument 'DbNodeGroupCount'")
}
if args.DbNodeStorage == nil {
return nil, errors.New("invalid value for required argument 'DbNodeStorage'")
}
if args.PaymentType == nil {
return nil, errors.New("invalid value for required argument 'PaymentType'")
}
if args.StorageType == nil {
return nil, errors.New("invalid value for required argument 'StorageType'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource DbCluster
err := ctx.RegisterResource("alicloud:clickhouse/dbCluster:DbCluster", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetDbCluster gets an existing DbCluster resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetDbCluster(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *DbClusterState, opts ...pulumi.ResourceOption) (*DbCluster, error) {
var resource DbCluster
err := ctx.ReadResource("alicloud:clickhouse/dbCluster:DbCluster", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering DbCluster resources.
type dbClusterState struct {
// The Category of DBCluster. Valid values: `Basic`,`HighAvailability`.
Category *string `pulumi:"category"`
// (Available since v1.196.0) - The connection string of the cluster.
ConnectionString *string `pulumi:"connectionString"`
// The db cluster access white list. See `dbClusterAccessWhiteList` below.
DbClusterAccessWhiteLists []DbClusterDbClusterAccessWhiteList `pulumi:"dbClusterAccessWhiteLists"`
// The DBCluster class. According to the category, dbClusterClass has two value ranges:
// * Under the condition that the category is the `Basic`, Valid values: `LS20`, `LS40`, `LS80`,`S8`, `S16`, `S32`, `S64`,`S80`, `S104`.
// * Under the condition that the category is the `HighAvailability`, Valid values: `LC20`, `LC40`, `LC80`,`C8`, `C16`, `C32`, `C64`, `C80`, `C104`.
DbClusterClass *string `pulumi:"dbClusterClass"`
// The DBCluster description.
DbClusterDescription *string `pulumi:"dbClusterDescription"`
// The DBCluster network type. Valid values: `vpc`.
DbClusterNetworkType *string `pulumi:"dbClusterNetworkType"`
// The DBCluster version. Valid values: `20.3.10.75`, `20.8.7.15`, `21.8.10.19`, `22.8.5.29`. **NOTE:** `19.15.2.2` is no longer supported. From version 1.191.0, `dbClusterVersion` can be set to `22.8.5.29`.
DbClusterVersion *string `pulumi:"dbClusterVersion"`
// The db node group count. The number should between 1 and 48.
DbNodeGroupCount *int `pulumi:"dbNodeGroupCount"`
// The db node storage.
DbNodeStorage *string `pulumi:"dbNodeStorage"`
// Key management service KMS key ID. It is valid and required when encryptionType is `CloudDisk`.
EncryptionKey *string `pulumi:"encryptionKey"`
// Currently only supports ECS disk encryption, with a value of CloudDisk, not encrypted when empty.
EncryptionType *string `pulumi:"encryptionType"`
// The maintenance window of DBCluster. Valid format: `hh:mmZ-hh:mm Z`.
MaintainTime *string `pulumi:"maintainTime"`
// The payment type of the resource. Valid values: `PayAsYouGo`,`Subscription`.
PaymentType *string `pulumi:"paymentType"`
// Pre-paid cluster of the pay-as-you-go cycle. It is valid and required when paymentType is `Subscription`. Valid values: `Month`, `Year`.
Period *string `pulumi:"period"`
// (Available since v1.196.0) The connection port of the cluster.
Port *string `pulumi:"port"`
// The status of the resource. Valid values: `Running`,`Creating`,`Deleting`,`Restarting`,`Preparing`.
Status *string `pulumi:"status"`
// Storage type of DBCluster. Valid values: `cloudEssd`, `cloudEfficiency`, `cloudEssdPl2`, `cloudEssdPl3`.
StorageType *string `pulumi:"storageType"`
// The used time of DBCluster. It is valid and required when paymentType is `Subscription`.
UsedTime *string `pulumi:"usedTime"`
// The id of the VPC.
VpcId *string `pulumi:"vpcId"`
// The vswitch id of DBCluster.
VswitchId *string `pulumi:"vswitchId"`
// The zone ID of the instance.
ZoneId *string `pulumi:"zoneId"`
}
type DbClusterState struct {
// The Category of DBCluster. Valid values: `Basic`,`HighAvailability`.
Category pulumi.StringPtrInput
// (Available since v1.196.0) - The connection string of the cluster.
ConnectionString pulumi.StringPtrInput
// The db cluster access white list. See `dbClusterAccessWhiteList` below.
DbClusterAccessWhiteLists DbClusterDbClusterAccessWhiteListArrayInput
// The DBCluster class. According to the category, dbClusterClass has two value ranges:
// * Under the condition that the category is the `Basic`, Valid values: `LS20`, `LS40`, `LS80`,`S8`, `S16`, `S32`, `S64`,`S80`, `S104`.
// * Under the condition that the category is the `HighAvailability`, Valid values: `LC20`, `LC40`, `LC80`,`C8`, `C16`, `C32`, `C64`, `C80`, `C104`.
DbClusterClass pulumi.StringPtrInput
// The DBCluster description.
DbClusterDescription pulumi.StringPtrInput
// The DBCluster network type. Valid values: `vpc`.
DbClusterNetworkType pulumi.StringPtrInput
// The DBCluster version. Valid values: `20.3.10.75`, `20.8.7.15`, `21.8.10.19`, `22.8.5.29`. **NOTE:** `19.15.2.2` is no longer supported. From version 1.191.0, `dbClusterVersion` can be set to `22.8.5.29`.
DbClusterVersion pulumi.StringPtrInput
// The db node group count. The number should between 1 and 48.
DbNodeGroupCount pulumi.IntPtrInput
// The db node storage.
DbNodeStorage pulumi.StringPtrInput
// Key management service KMS key ID. It is valid and required when encryptionType is `CloudDisk`.
EncryptionKey pulumi.StringPtrInput
// Currently only supports ECS disk encryption, with a value of CloudDisk, not encrypted when empty.
EncryptionType pulumi.StringPtrInput
// The maintenance window of DBCluster. Valid format: `hh:mmZ-hh:mm Z`.
MaintainTime pulumi.StringPtrInput
// The payment type of the resource. Valid values: `PayAsYouGo`,`Subscription`.
PaymentType pulumi.StringPtrInput
// Pre-paid cluster of the pay-as-you-go cycle. It is valid and required when paymentType is `Subscription`. Valid values: `Month`, `Year`.
Period pulumi.StringPtrInput
// (Available since v1.196.0) The connection port of the cluster.
Port pulumi.StringPtrInput
// The status of the resource. Valid values: `Running`,`Creating`,`Deleting`,`Restarting`,`Preparing`.
Status pulumi.StringPtrInput
// Storage type of DBCluster. Valid values: `cloudEssd`, `cloudEfficiency`, `cloudEssdPl2`, `cloudEssdPl3`.
StorageType pulumi.StringPtrInput
// The used time of DBCluster. It is valid and required when paymentType is `Subscription`.
UsedTime pulumi.StringPtrInput
// The id of the VPC.
VpcId pulumi.StringPtrInput
// The vswitch id of DBCluster.
VswitchId pulumi.StringPtrInput
// The zone ID of the instance.
ZoneId pulumi.StringPtrInput
}
func (DbClusterState) ElementType() reflect.Type {
return reflect.TypeOf((*dbClusterState)(nil)).Elem()
}
type dbClusterArgs struct {
// The Category of DBCluster. Valid values: `Basic`,`HighAvailability`.
Category string `pulumi:"category"`
// The db cluster access white list. See `dbClusterAccessWhiteList` below.
DbClusterAccessWhiteLists []DbClusterDbClusterAccessWhiteList `pulumi:"dbClusterAccessWhiteLists"`
// The DBCluster class. According to the category, dbClusterClass has two value ranges:
// * Under the condition that the category is the `Basic`, Valid values: `LS20`, `LS40`, `LS80`,`S8`, `S16`, `S32`, `S64`,`S80`, `S104`.
// * Under the condition that the category is the `HighAvailability`, Valid values: `LC20`, `LC40`, `LC80`,`C8`, `C16`, `C32`, `C64`, `C80`, `C104`.
DbClusterClass string `pulumi:"dbClusterClass"`
// The DBCluster description.
DbClusterDescription *string `pulumi:"dbClusterDescription"`
// The DBCluster network type. Valid values: `vpc`.
DbClusterNetworkType string `pulumi:"dbClusterNetworkType"`
// The DBCluster version. Valid values: `20.3.10.75`, `20.8.7.15`, `21.8.10.19`, `22.8.5.29`. **NOTE:** `19.15.2.2` is no longer supported. From version 1.191.0, `dbClusterVersion` can be set to `22.8.5.29`.
DbClusterVersion string `pulumi:"dbClusterVersion"`
// The db node group count. The number should between 1 and 48.
DbNodeGroupCount int `pulumi:"dbNodeGroupCount"`
// The db node storage.
DbNodeStorage string `pulumi:"dbNodeStorage"`
// Key management service KMS key ID. It is valid and required when encryptionType is `CloudDisk`.
EncryptionKey *string `pulumi:"encryptionKey"`
// Currently only supports ECS disk encryption, with a value of CloudDisk, not encrypted when empty.
EncryptionType *string `pulumi:"encryptionType"`
// The maintenance window of DBCluster. Valid format: `hh:mmZ-hh:mm Z`.
MaintainTime *string `pulumi:"maintainTime"`
// The payment type of the resource. Valid values: `PayAsYouGo`,`Subscription`.
PaymentType string `pulumi:"paymentType"`
// Pre-paid cluster of the pay-as-you-go cycle. It is valid and required when paymentType is `Subscription`. Valid values: `Month`, `Year`.
Period *string `pulumi:"period"`
// The status of the resource. Valid values: `Running`,`Creating`,`Deleting`,`Restarting`,`Preparing`.
Status *string `pulumi:"status"`
// Storage type of DBCluster. Valid values: `cloudEssd`, `cloudEfficiency`, `cloudEssdPl2`, `cloudEssdPl3`.
StorageType string `pulumi:"storageType"`
// The used time of DBCluster. It is valid and required when paymentType is `Subscription`.
UsedTime *string `pulumi:"usedTime"`
// The id of the VPC.
VpcId *string `pulumi:"vpcId"`
// The vswitch id of DBCluster.
VswitchId *string `pulumi:"vswitchId"`
// The zone ID of the instance.
ZoneId *string `pulumi:"zoneId"`
}
// The set of arguments for constructing a DbCluster resource.
type DbClusterArgs struct {
// The Category of DBCluster. Valid values: `Basic`,`HighAvailability`.
Category pulumi.StringInput
// The db cluster access white list. See `dbClusterAccessWhiteList` below.
DbClusterAccessWhiteLists DbClusterDbClusterAccessWhiteListArrayInput
// The DBCluster class. According to the category, dbClusterClass has two value ranges:
// * Under the condition that the category is the `Basic`, Valid values: `LS20`, `LS40`, `LS80`,`S8`, `S16`, `S32`, `S64`,`S80`, `S104`.
// * Under the condition that the category is the `HighAvailability`, Valid values: `LC20`, `LC40`, `LC80`,`C8`, `C16`, `C32`, `C64`, `C80`, `C104`.
DbClusterClass pulumi.StringInput
// The DBCluster description.
DbClusterDescription pulumi.StringPtrInput
// The DBCluster network type. Valid values: `vpc`.
DbClusterNetworkType pulumi.StringInput
// The DBCluster version. Valid values: `20.3.10.75`, `20.8.7.15`, `21.8.10.19`, `22.8.5.29`. **NOTE:** `19.15.2.2` is no longer supported. From version 1.191.0, `dbClusterVersion` can be set to `22.8.5.29`.
DbClusterVersion pulumi.StringInput
// The db node group count. The number should between 1 and 48.
DbNodeGroupCount pulumi.IntInput
// The db node storage.
DbNodeStorage pulumi.StringInput
// Key management service KMS key ID. It is valid and required when encryptionType is `CloudDisk`.
EncryptionKey pulumi.StringPtrInput
// Currently only supports ECS disk encryption, with a value of CloudDisk, not encrypted when empty.
EncryptionType pulumi.StringPtrInput
// The maintenance window of DBCluster. Valid format: `hh:mmZ-hh:mm Z`.
MaintainTime pulumi.StringPtrInput
// The payment type of the resource. Valid values: `PayAsYouGo`,`Subscription`.
PaymentType pulumi.StringInput
// Pre-paid cluster of the pay-as-you-go cycle. It is valid and required when paymentType is `Subscription`. Valid values: `Month`, `Year`.
Period pulumi.StringPtrInput
// The status of the resource. Valid values: `Running`,`Creating`,`Deleting`,`Restarting`,`Preparing`.
Status pulumi.StringPtrInput
// Storage type of DBCluster. Valid values: `cloudEssd`, `cloudEfficiency`, `cloudEssdPl2`, `cloudEssdPl3`.
StorageType pulumi.StringInput
// The used time of DBCluster. It is valid and required when paymentType is `Subscription`.
UsedTime pulumi.StringPtrInput
// The id of the VPC.
VpcId pulumi.StringPtrInput
// The vswitch id of DBCluster.
VswitchId pulumi.StringPtrInput
// The zone ID of the instance.
ZoneId pulumi.StringPtrInput
}
func (DbClusterArgs) ElementType() reflect.Type {
return reflect.TypeOf((*dbClusterArgs)(nil)).Elem()
}
type DbClusterInput interface {
pulumi.Input
ToDbClusterOutput() DbClusterOutput
ToDbClusterOutputWithContext(ctx context.Context) DbClusterOutput
}
func (*DbCluster) ElementType() reflect.Type {
return reflect.TypeOf((**DbCluster)(nil)).Elem()
}
func (i *DbCluster) ToDbClusterOutput() DbClusterOutput {
return i.ToDbClusterOutputWithContext(context.Background())
}
func (i *DbCluster) ToDbClusterOutputWithContext(ctx context.Context) DbClusterOutput {
return pulumi.ToOutputWithContext(ctx, i).(DbClusterOutput)
}
// DbClusterArrayInput is an input type that accepts DbClusterArray and DbClusterArrayOutput values.
// You can construct a concrete instance of `DbClusterArrayInput` via:
//
// DbClusterArray{ DbClusterArgs{...} }
type DbClusterArrayInput interface {
pulumi.Input
ToDbClusterArrayOutput() DbClusterArrayOutput
ToDbClusterArrayOutputWithContext(context.Context) DbClusterArrayOutput
}
type DbClusterArray []DbClusterInput
func (DbClusterArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*DbCluster)(nil)).Elem()
}
func (i DbClusterArray) ToDbClusterArrayOutput() DbClusterArrayOutput {
return i.ToDbClusterArrayOutputWithContext(context.Background())
}
func (i DbClusterArray) ToDbClusterArrayOutputWithContext(ctx context.Context) DbClusterArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(DbClusterArrayOutput)
}
// DbClusterMapInput is an input type that accepts DbClusterMap and DbClusterMapOutput values.
// You can construct a concrete instance of `DbClusterMapInput` via:
//
// DbClusterMap{ "key": DbClusterArgs{...} }
type DbClusterMapInput interface {
pulumi.Input
ToDbClusterMapOutput() DbClusterMapOutput
ToDbClusterMapOutputWithContext(context.Context) DbClusterMapOutput
}
type DbClusterMap map[string]DbClusterInput
func (DbClusterMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*DbCluster)(nil)).Elem()
}
func (i DbClusterMap) ToDbClusterMapOutput() DbClusterMapOutput {
return i.ToDbClusterMapOutputWithContext(context.Background())
}
func (i DbClusterMap) ToDbClusterMapOutputWithContext(ctx context.Context) DbClusterMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(DbClusterMapOutput)
}
type DbClusterOutput struct{ *pulumi.OutputState }
func (DbClusterOutput) ElementType() reflect.Type {
return reflect.TypeOf((**DbCluster)(nil)).Elem()
}
func (o DbClusterOutput) ToDbClusterOutput() DbClusterOutput {
return o
}
func (o DbClusterOutput) ToDbClusterOutputWithContext(ctx context.Context) DbClusterOutput {
return o
}
// The Category of DBCluster. Valid values: `Basic`,`HighAvailability`.
func (o DbClusterOutput) Category() pulumi.StringOutput {
return o.ApplyT(func(v *DbCluster) pulumi.StringOutput { return v.Category }).(pulumi.StringOutput)
}
// (Available since v1.196.0) - The connection string of the cluster.
func (o DbClusterOutput) ConnectionString() pulumi.StringOutput {
return o.ApplyT(func(v *DbCluster) pulumi.StringOutput { return v.ConnectionString }).(pulumi.StringOutput)
}
// The db cluster access white list. See `dbClusterAccessWhiteList` below.
func (o DbClusterOutput) DbClusterAccessWhiteLists() DbClusterDbClusterAccessWhiteListArrayOutput {
return o.ApplyT(func(v *DbCluster) DbClusterDbClusterAccessWhiteListArrayOutput { return v.DbClusterAccessWhiteLists }).(DbClusterDbClusterAccessWhiteListArrayOutput)
}
// The DBCluster class. According to the category, dbClusterClass has two value ranges:
// * Under the condition that the category is the `Basic`, Valid values: `LS20`, `LS40`, `LS80`,`S8`, `S16`, `S32`, `S64`,`S80`, `S104`.
// * Under the condition that the category is the `HighAvailability`, Valid values: `LC20`, `LC40`, `LC80`,`C8`, `C16`, `C32`, `C64`, `C80`, `C104`.
func (o DbClusterOutput) DbClusterClass() pulumi.StringOutput {
return o.ApplyT(func(v *DbCluster) pulumi.StringOutput { return v.DbClusterClass }).(pulumi.StringOutput)
}
// The DBCluster description.
func (o DbClusterOutput) DbClusterDescription() pulumi.StringOutput {
return o.ApplyT(func(v *DbCluster) pulumi.StringOutput { return v.DbClusterDescription }).(pulumi.StringOutput)
}
// The DBCluster network type. Valid values: `vpc`.
func (o DbClusterOutput) DbClusterNetworkType() pulumi.StringOutput {
return o.ApplyT(func(v *DbCluster) pulumi.StringOutput { return v.DbClusterNetworkType }).(pulumi.StringOutput)
}
// The DBCluster version. Valid values: `20.3.10.75`, `20.8.7.15`, `21.8.10.19`, `22.8.5.29`. **NOTE:** `19.15.2.2` is no longer supported. From version 1.191.0, `dbClusterVersion` can be set to `22.8.5.29`.
func (o DbClusterOutput) DbClusterVersion() pulumi.StringOutput {
return o.ApplyT(func(v *DbCluster) pulumi.StringOutput { return v.DbClusterVersion }).(pulumi.StringOutput)
}
// The db node group count. The number should between 1 and 48.
func (o DbClusterOutput) DbNodeGroupCount() pulumi.IntOutput {
return o.ApplyT(func(v *DbCluster) pulumi.IntOutput { return v.DbNodeGroupCount }).(pulumi.IntOutput)
}
// The db node storage.
func (o DbClusterOutput) DbNodeStorage() pulumi.StringOutput {
return o.ApplyT(func(v *DbCluster) pulumi.StringOutput { return v.DbNodeStorage }).(pulumi.StringOutput)
}
// Key management service KMS key ID. It is valid and required when encryptionType is `CloudDisk`.
func (o DbClusterOutput) EncryptionKey() pulumi.StringPtrOutput {
return o.ApplyT(func(v *DbCluster) pulumi.StringPtrOutput { return v.EncryptionKey }).(pulumi.StringPtrOutput)
}
// Currently only supports ECS disk encryption, with a value of CloudDisk, not encrypted when empty.
func (o DbClusterOutput) EncryptionType() pulumi.StringPtrOutput {
return o.ApplyT(func(v *DbCluster) pulumi.StringPtrOutput { return v.EncryptionType }).(pulumi.StringPtrOutput)
}
// The maintenance window of DBCluster. Valid format: `hh:mmZ-hh:mm Z`.
func (o DbClusterOutput) MaintainTime() pulumi.StringOutput {
return o.ApplyT(func(v *DbCluster) pulumi.StringOutput { return v.MaintainTime }).(pulumi.StringOutput)
}
// The payment type of the resource. Valid values: `PayAsYouGo`,`Subscription`.
func (o DbClusterOutput) PaymentType() pulumi.StringOutput {
return o.ApplyT(func(v *DbCluster) pulumi.StringOutput { return v.PaymentType }).(pulumi.StringOutput)
}
// Pre-paid cluster of the pay-as-you-go cycle. It is valid and required when paymentType is `Subscription`. Valid values: `Month`, `Year`.
func (o DbClusterOutput) Period() pulumi.StringPtrOutput {
return o.ApplyT(func(v *DbCluster) pulumi.StringPtrOutput { return v.Period }).(pulumi.StringPtrOutput)
}
// (Available since v1.196.0) The connection port of the cluster.
func (o DbClusterOutput) Port() pulumi.StringOutput {
return o.ApplyT(func(v *DbCluster) pulumi.StringOutput { return v.Port }).(pulumi.StringOutput)
}
// The status of the resource. Valid values: `Running`,`Creating`,`Deleting`,`Restarting`,`Preparing`.
func (o DbClusterOutput) Status() pulumi.StringOutput {
return o.ApplyT(func(v *DbCluster) pulumi.StringOutput { return v.Status }).(pulumi.StringOutput)
}
// Storage type of DBCluster. Valid values: `cloudEssd`, `cloudEfficiency`, `cloudEssdPl2`, `cloudEssdPl3`.
func (o DbClusterOutput) StorageType() pulumi.StringOutput {
return o.ApplyT(func(v *DbCluster) pulumi.StringOutput { return v.StorageType }).(pulumi.StringOutput)
}
// The used time of DBCluster. It is valid and required when paymentType is `Subscription`.
func (o DbClusterOutput) UsedTime() pulumi.StringPtrOutput {
return o.ApplyT(func(v *DbCluster) pulumi.StringPtrOutput { return v.UsedTime }).(pulumi.StringPtrOutput)
}
// The id of the VPC.
func (o DbClusterOutput) VpcId() pulumi.StringOutput {
return o.ApplyT(func(v *DbCluster) pulumi.StringOutput { return v.VpcId }).(pulumi.StringOutput)
}
// The vswitch id of DBCluster.
func (o DbClusterOutput) VswitchId() pulumi.StringPtrOutput {
return o.ApplyT(func(v *DbCluster) pulumi.StringPtrOutput { return v.VswitchId }).(pulumi.StringPtrOutput)
}
// The zone ID of the instance.
func (o DbClusterOutput) ZoneId() pulumi.StringOutput {
return o.ApplyT(func(v *DbCluster) pulumi.StringOutput { return v.ZoneId }).(pulumi.StringOutput)
}
type DbClusterArrayOutput struct{ *pulumi.OutputState }
func (DbClusterArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*DbCluster)(nil)).Elem()
}
func (o DbClusterArrayOutput) ToDbClusterArrayOutput() DbClusterArrayOutput {
return o
}
func (o DbClusterArrayOutput) ToDbClusterArrayOutputWithContext(ctx context.Context) DbClusterArrayOutput {
return o
}
func (o DbClusterArrayOutput) Index(i pulumi.IntInput) DbClusterOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *DbCluster {
return vs[0].([]*DbCluster)[vs[1].(int)]
}).(DbClusterOutput)
}
type DbClusterMapOutput struct{ *pulumi.OutputState }
func (DbClusterMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*DbCluster)(nil)).Elem()
}
func (o DbClusterMapOutput) ToDbClusterMapOutput() DbClusterMapOutput {
return o
}
func (o DbClusterMapOutput) ToDbClusterMapOutputWithContext(ctx context.Context) DbClusterMapOutput {
return o
}
func (o DbClusterMapOutput) MapIndex(k pulumi.StringInput) DbClusterOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *DbCluster {
return vs[0].(map[string]*DbCluster)[vs[1].(string)]
}).(DbClusterOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*DbClusterInput)(nil)).Elem(), &DbCluster{})
pulumi.RegisterInputType(reflect.TypeOf((*DbClusterArrayInput)(nil)).Elem(), DbClusterArray{})
pulumi.RegisterInputType(reflect.TypeOf((*DbClusterMapInput)(nil)).Elem(), DbClusterMap{})
pulumi.RegisterOutputType(DbClusterOutput{})
pulumi.RegisterOutputType(DbClusterArrayOutput{})
pulumi.RegisterOutputType(DbClusterMapOutput{})
}