/
dragonfly.go
729 lines (655 loc) · 43.2 KB
/
dragonfly.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
// 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 aiven
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-aiven/sdk/v6/go/aiven/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// The Dragonfly resource allows the creation and management of Aiven Dragonfly services.
type Dragonfly struct {
pulumi.CustomResourceState
// Additional disk space. Possible values depend on the service type, the cloud provider and the project. Therefore,
// reducing will result in the service rebalancing.
AdditionalDiskSpace pulumi.StringPtrOutput `pulumi:"additionalDiskSpace"`
// Defines where the cloud provider and region where the service is hosted in. This can be changed freely after service is
// created. Changing the value will trigger a potentially lengthy migration process for the service. Format is cloud
// provider name (`aws`, `azure`, `do` `google`, `upcloud`, etc.), dash, and the cloud provider specific region name. These
// are documented on each Cloud provider's own support articles, like [here for
// Google](https://cloud.google.com/compute/docs/regions-zones/) and [here for
// AWS](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.RegionsAndAvailabilityZones.html).
CloudName pulumi.StringPtrOutput `pulumi:"cloudName"`
// Service component information objects
Components DragonflyComponentArrayOutput `pulumi:"components"`
// Service disk space. Possible values depend on the service type, the cloud provider and the project. Therefore, reducing
// will result in the service rebalancing.
//
// Deprecated: This will be removed in v5.0.0. Please use `additionalDiskSpace` to specify the space to be added to the default `diskSpace` defined by the plan.
DiskSpace pulumi.StringPtrOutput `pulumi:"diskSpace"`
// The maximum disk space of the service, possible values depend on the service type, the cloud provider and the project.
DiskSpaceCap pulumi.StringOutput `pulumi:"diskSpaceCap"`
// The default disk space of the service, possible values depend on the service type, the cloud provider and the project.
// Its also the minimum value for `disk_space`
DiskSpaceDefault pulumi.StringOutput `pulumi:"diskSpaceDefault"`
// The default disk space step of the service, possible values depend on the service type, the cloud provider and the
// project. `disk_space` needs to increment from `disk_space_default` by increments of this size.
DiskSpaceStep pulumi.StringOutput `pulumi:"diskSpaceStep"`
// Disk space that service is currently using
DiskSpaceUsed pulumi.StringOutput `pulumi:"diskSpaceUsed"`
// Dragonfly server provided values
Dragonflies DragonflyDragonflyArrayOutput `pulumi:"dragonflies"`
// Dragonfly user configurable settings
DragonflyUserConfig DragonflyDragonflyUserConfigPtrOutput `pulumi:"dragonflyUserConfig"`
// Day of week when maintenance operations should be performed. One monday, tuesday, wednesday, etc.
MaintenanceWindowDow pulumi.StringPtrOutput `pulumi:"maintenanceWindowDow"`
// Time of day when maintenance operations should be performed. UTC time in HH:mm:ss format.
MaintenanceWindowTime pulumi.StringPtrOutput `pulumi:"maintenanceWindowTime"`
// Defines what kind of computing resources are allocated for the service. It can be changed after creation, though there
// are some restrictions when going to a smaller plan such as the new plan must have sufficient amount of disk space to
// store all current data and switching to a plan with fewer nodes might not be supported. The basic plan names are
// `hobbyist`, `startup-x`, `business-x` and `premium-x` where `x` is (roughly) the amount of memory on each node (also
// other attributes like number of CPUs and amount of disk space varies but naming is based on memory). The available
// options can be seem from the [Aiven pricing page](https://aiven.io/pricing).
Plan pulumi.StringOutput `pulumi:"plan"`
// Identifies the project this resource belongs to. To set up proper dependencies please refer to this variable as a
// reference. Changing this property forces recreation of the resource.
Project pulumi.StringOutput `pulumi:"project"`
// Specifies the VPC the service should run in. If the value is not set the service is not run inside a VPC. When set, the
// value should be given as a reference to set up dependencies correctly and the VPC must be in the same cloud and region
// as the service itself. Project can be freely moved to and from VPC after creation but doing so triggers migration to new
// servers so the operation can take significant amount of time to complete if the service has a lot of data.
ProjectVpcId pulumi.StringPtrOutput `pulumi:"projectVpcId"`
// The hostname of the service.
ServiceHost pulumi.StringOutput `pulumi:"serviceHost"`
// Service integrations to specify when creating a service. Not applied after initial service creation
ServiceIntegrations DragonflyServiceIntegrationArrayOutput `pulumi:"serviceIntegrations"`
// Specifies the actual name of the service. The name cannot be changed later without destroying and re-creating the
// service so name should be picked based on intended service usage rather than current attributes.
ServiceName pulumi.StringOutput `pulumi:"serviceName"`
// Password used for connecting to the service, if applicable
ServicePassword pulumi.StringOutput `pulumi:"servicePassword"`
// The port of the service
ServicePort pulumi.IntOutput `pulumi:"servicePort"`
// Aiven internal service type code
ServiceType pulumi.StringOutput `pulumi:"serviceType"`
// URI for connecting to the service. Service specific info is under "kafka", "pg", etc.
ServiceUri pulumi.StringOutput `pulumi:"serviceUri"`
// Username used for connecting to the service, if applicable
ServiceUsername pulumi.StringOutput `pulumi:"serviceUsername"`
// Service state. One of `POWEROFF`, `REBALANCING`, `REBUILDING` or `RUNNING`
State pulumi.StringOutput `pulumi:"state"`
// Static IPs that are going to be associated with this service. Please assign a value using the 'toset' function. Once a
// static ip resource is in the 'assigned' state it cannot be unbound from the node again
StaticIps pulumi.StringArrayOutput `pulumi:"staticIps"`
// Tags are key-value pairs that allow you to categorize services.
Tags DragonflyTagArrayOutput `pulumi:"tags"`
// Defines the email addresses that will receive alerts about upcoming maintenance updates or warnings about service
// instability.
TechEmails DragonflyTechEmailArrayOutput `pulumi:"techEmails"`
// Prevents the service from being deleted. It is recommended to set this to `true` for all production services to prevent
// unintentional service deletion. This does not shield against deleting databases or topics but for services with backups
// much of the content can at least be restored from backup in case accidental deletion is done.
TerminationProtection pulumi.BoolPtrOutput `pulumi:"terminationProtection"`
}
// NewDragonfly registers a new resource with the given unique name, arguments, and options.
func NewDragonfly(ctx *pulumi.Context,
name string, args *DragonflyArgs, opts ...pulumi.ResourceOption) (*Dragonfly, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.Plan == nil {
return nil, errors.New("invalid value for required argument 'Plan'")
}
if args.Project == nil {
return nil, errors.New("invalid value for required argument 'Project'")
}
if args.ServiceName == nil {
return nil, errors.New("invalid value for required argument 'ServiceName'")
}
secrets := pulumi.AdditionalSecretOutputs([]string{
"servicePassword",
"serviceUri",
})
opts = append(opts, secrets)
opts = internal.PkgResourceDefaultOpts(opts)
var resource Dragonfly
err := ctx.RegisterResource("aiven:index/dragonfly:Dragonfly", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetDragonfly gets an existing Dragonfly 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 GetDragonfly(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *DragonflyState, opts ...pulumi.ResourceOption) (*Dragonfly, error) {
var resource Dragonfly
err := ctx.ReadResource("aiven:index/dragonfly:Dragonfly", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Dragonfly resources.
type dragonflyState struct {
// Additional disk space. Possible values depend on the service type, the cloud provider and the project. Therefore,
// reducing will result in the service rebalancing.
AdditionalDiskSpace *string `pulumi:"additionalDiskSpace"`
// Defines where the cloud provider and region where the service is hosted in. This can be changed freely after service is
// created. Changing the value will trigger a potentially lengthy migration process for the service. Format is cloud
// provider name (`aws`, `azure`, `do` `google`, `upcloud`, etc.), dash, and the cloud provider specific region name. These
// are documented on each Cloud provider's own support articles, like [here for
// Google](https://cloud.google.com/compute/docs/regions-zones/) and [here for
// AWS](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.RegionsAndAvailabilityZones.html).
CloudName *string `pulumi:"cloudName"`
// Service component information objects
Components []DragonflyComponent `pulumi:"components"`
// Service disk space. Possible values depend on the service type, the cloud provider and the project. Therefore, reducing
// will result in the service rebalancing.
//
// Deprecated: This will be removed in v5.0.0. Please use `additionalDiskSpace` to specify the space to be added to the default `diskSpace` defined by the plan.
DiskSpace *string `pulumi:"diskSpace"`
// The maximum disk space of the service, possible values depend on the service type, the cloud provider and the project.
DiskSpaceCap *string `pulumi:"diskSpaceCap"`
// The default disk space of the service, possible values depend on the service type, the cloud provider and the project.
// Its also the minimum value for `disk_space`
DiskSpaceDefault *string `pulumi:"diskSpaceDefault"`
// The default disk space step of the service, possible values depend on the service type, the cloud provider and the
// project. `disk_space` needs to increment from `disk_space_default` by increments of this size.
DiskSpaceStep *string `pulumi:"diskSpaceStep"`
// Disk space that service is currently using
DiskSpaceUsed *string `pulumi:"diskSpaceUsed"`
// Dragonfly server provided values
Dragonflies []DragonflyDragonfly `pulumi:"dragonflies"`
// Dragonfly user configurable settings
DragonflyUserConfig *DragonflyDragonflyUserConfig `pulumi:"dragonflyUserConfig"`
// Day of week when maintenance operations should be performed. One monday, tuesday, wednesday, etc.
MaintenanceWindowDow *string `pulumi:"maintenanceWindowDow"`
// Time of day when maintenance operations should be performed. UTC time in HH:mm:ss format.
MaintenanceWindowTime *string `pulumi:"maintenanceWindowTime"`
// Defines what kind of computing resources are allocated for the service. It can be changed after creation, though there
// are some restrictions when going to a smaller plan such as the new plan must have sufficient amount of disk space to
// store all current data and switching to a plan with fewer nodes might not be supported. The basic plan names are
// `hobbyist`, `startup-x`, `business-x` and `premium-x` where `x` is (roughly) the amount of memory on each node (also
// other attributes like number of CPUs and amount of disk space varies but naming is based on memory). The available
// options can be seem from the [Aiven pricing page](https://aiven.io/pricing).
Plan *string `pulumi:"plan"`
// Identifies the project this resource belongs to. To set up proper dependencies please refer to this variable as a
// reference. Changing this property forces recreation of the resource.
Project *string `pulumi:"project"`
// Specifies the VPC the service should run in. If the value is not set the service is not run inside a VPC. When set, the
// value should be given as a reference to set up dependencies correctly and the VPC must be in the same cloud and region
// as the service itself. Project can be freely moved to and from VPC after creation but doing so triggers migration to new
// servers so the operation can take significant amount of time to complete if the service has a lot of data.
ProjectVpcId *string `pulumi:"projectVpcId"`
// The hostname of the service.
ServiceHost *string `pulumi:"serviceHost"`
// Service integrations to specify when creating a service. Not applied after initial service creation
ServiceIntegrations []DragonflyServiceIntegration `pulumi:"serviceIntegrations"`
// Specifies the actual name of the service. The name cannot be changed later without destroying and re-creating the
// service so name should be picked based on intended service usage rather than current attributes.
ServiceName *string `pulumi:"serviceName"`
// Password used for connecting to the service, if applicable
ServicePassword *string `pulumi:"servicePassword"`
// The port of the service
ServicePort *int `pulumi:"servicePort"`
// Aiven internal service type code
ServiceType *string `pulumi:"serviceType"`
// URI for connecting to the service. Service specific info is under "kafka", "pg", etc.
ServiceUri *string `pulumi:"serviceUri"`
// Username used for connecting to the service, if applicable
ServiceUsername *string `pulumi:"serviceUsername"`
// Service state. One of `POWEROFF`, `REBALANCING`, `REBUILDING` or `RUNNING`
State *string `pulumi:"state"`
// Static IPs that are going to be associated with this service. Please assign a value using the 'toset' function. Once a
// static ip resource is in the 'assigned' state it cannot be unbound from the node again
StaticIps []string `pulumi:"staticIps"`
// Tags are key-value pairs that allow you to categorize services.
Tags []DragonflyTag `pulumi:"tags"`
// Defines the email addresses that will receive alerts about upcoming maintenance updates or warnings about service
// instability.
TechEmails []DragonflyTechEmail `pulumi:"techEmails"`
// Prevents the service from being deleted. It is recommended to set this to `true` for all production services to prevent
// unintentional service deletion. This does not shield against deleting databases or topics but for services with backups
// much of the content can at least be restored from backup in case accidental deletion is done.
TerminationProtection *bool `pulumi:"terminationProtection"`
}
type DragonflyState struct {
// Additional disk space. Possible values depend on the service type, the cloud provider and the project. Therefore,
// reducing will result in the service rebalancing.
AdditionalDiskSpace pulumi.StringPtrInput
// Defines where the cloud provider and region where the service is hosted in. This can be changed freely after service is
// created. Changing the value will trigger a potentially lengthy migration process for the service. Format is cloud
// provider name (`aws`, `azure`, `do` `google`, `upcloud`, etc.), dash, and the cloud provider specific region name. These
// are documented on each Cloud provider's own support articles, like [here for
// Google](https://cloud.google.com/compute/docs/regions-zones/) and [here for
// AWS](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.RegionsAndAvailabilityZones.html).
CloudName pulumi.StringPtrInput
// Service component information objects
Components DragonflyComponentArrayInput
// Service disk space. Possible values depend on the service type, the cloud provider and the project. Therefore, reducing
// will result in the service rebalancing.
//
// Deprecated: This will be removed in v5.0.0. Please use `additionalDiskSpace` to specify the space to be added to the default `diskSpace` defined by the plan.
DiskSpace pulumi.StringPtrInput
// The maximum disk space of the service, possible values depend on the service type, the cloud provider and the project.
DiskSpaceCap pulumi.StringPtrInput
// The default disk space of the service, possible values depend on the service type, the cloud provider and the project.
// Its also the minimum value for `disk_space`
DiskSpaceDefault pulumi.StringPtrInput
// The default disk space step of the service, possible values depend on the service type, the cloud provider and the
// project. `disk_space` needs to increment from `disk_space_default` by increments of this size.
DiskSpaceStep pulumi.StringPtrInput
// Disk space that service is currently using
DiskSpaceUsed pulumi.StringPtrInput
// Dragonfly server provided values
Dragonflies DragonflyDragonflyArrayInput
// Dragonfly user configurable settings
DragonflyUserConfig DragonflyDragonflyUserConfigPtrInput
// Day of week when maintenance operations should be performed. One monday, tuesday, wednesday, etc.
MaintenanceWindowDow pulumi.StringPtrInput
// Time of day when maintenance operations should be performed. UTC time in HH:mm:ss format.
MaintenanceWindowTime pulumi.StringPtrInput
// Defines what kind of computing resources are allocated for the service. It can be changed after creation, though there
// are some restrictions when going to a smaller plan such as the new plan must have sufficient amount of disk space to
// store all current data and switching to a plan with fewer nodes might not be supported. The basic plan names are
// `hobbyist`, `startup-x`, `business-x` and `premium-x` where `x` is (roughly) the amount of memory on each node (also
// other attributes like number of CPUs and amount of disk space varies but naming is based on memory). The available
// options can be seem from the [Aiven pricing page](https://aiven.io/pricing).
Plan pulumi.StringPtrInput
// Identifies the project this resource belongs to. To set up proper dependencies please refer to this variable as a
// reference. Changing this property forces recreation of the resource.
Project pulumi.StringPtrInput
// Specifies the VPC the service should run in. If the value is not set the service is not run inside a VPC. When set, the
// value should be given as a reference to set up dependencies correctly and the VPC must be in the same cloud and region
// as the service itself. Project can be freely moved to and from VPC after creation but doing so triggers migration to new
// servers so the operation can take significant amount of time to complete if the service has a lot of data.
ProjectVpcId pulumi.StringPtrInput
// The hostname of the service.
ServiceHost pulumi.StringPtrInput
// Service integrations to specify when creating a service. Not applied after initial service creation
ServiceIntegrations DragonflyServiceIntegrationArrayInput
// Specifies the actual name of the service. The name cannot be changed later without destroying and re-creating the
// service so name should be picked based on intended service usage rather than current attributes.
ServiceName pulumi.StringPtrInput
// Password used for connecting to the service, if applicable
ServicePassword pulumi.StringPtrInput
// The port of the service
ServicePort pulumi.IntPtrInput
// Aiven internal service type code
ServiceType pulumi.StringPtrInput
// URI for connecting to the service. Service specific info is under "kafka", "pg", etc.
ServiceUri pulumi.StringPtrInput
// Username used for connecting to the service, if applicable
ServiceUsername pulumi.StringPtrInput
// Service state. One of `POWEROFF`, `REBALANCING`, `REBUILDING` or `RUNNING`
State pulumi.StringPtrInput
// Static IPs that are going to be associated with this service. Please assign a value using the 'toset' function. Once a
// static ip resource is in the 'assigned' state it cannot be unbound from the node again
StaticIps pulumi.StringArrayInput
// Tags are key-value pairs that allow you to categorize services.
Tags DragonflyTagArrayInput
// Defines the email addresses that will receive alerts about upcoming maintenance updates or warnings about service
// instability.
TechEmails DragonflyTechEmailArrayInput
// Prevents the service from being deleted. It is recommended to set this to `true` for all production services to prevent
// unintentional service deletion. This does not shield against deleting databases or topics but for services with backups
// much of the content can at least be restored from backup in case accidental deletion is done.
TerminationProtection pulumi.BoolPtrInput
}
func (DragonflyState) ElementType() reflect.Type {
return reflect.TypeOf((*dragonflyState)(nil)).Elem()
}
type dragonflyArgs struct {
// Additional disk space. Possible values depend on the service type, the cloud provider and the project. Therefore,
// reducing will result in the service rebalancing.
AdditionalDiskSpace *string `pulumi:"additionalDiskSpace"`
// Defines where the cloud provider and region where the service is hosted in. This can be changed freely after service is
// created. Changing the value will trigger a potentially lengthy migration process for the service. Format is cloud
// provider name (`aws`, `azure`, `do` `google`, `upcloud`, etc.), dash, and the cloud provider specific region name. These
// are documented on each Cloud provider's own support articles, like [here for
// Google](https://cloud.google.com/compute/docs/regions-zones/) and [here for
// AWS](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.RegionsAndAvailabilityZones.html).
CloudName *string `pulumi:"cloudName"`
// Service disk space. Possible values depend on the service type, the cloud provider and the project. Therefore, reducing
// will result in the service rebalancing.
//
// Deprecated: This will be removed in v5.0.0. Please use `additionalDiskSpace` to specify the space to be added to the default `diskSpace` defined by the plan.
DiskSpace *string `pulumi:"diskSpace"`
// Dragonfly user configurable settings
DragonflyUserConfig *DragonflyDragonflyUserConfig `pulumi:"dragonflyUserConfig"`
// Day of week when maintenance operations should be performed. One monday, tuesday, wednesday, etc.
MaintenanceWindowDow *string `pulumi:"maintenanceWindowDow"`
// Time of day when maintenance operations should be performed. UTC time in HH:mm:ss format.
MaintenanceWindowTime *string `pulumi:"maintenanceWindowTime"`
// Defines what kind of computing resources are allocated for the service. It can be changed after creation, though there
// are some restrictions when going to a smaller plan such as the new plan must have sufficient amount of disk space to
// store all current data and switching to a plan with fewer nodes might not be supported. The basic plan names are
// `hobbyist`, `startup-x`, `business-x` and `premium-x` where `x` is (roughly) the amount of memory on each node (also
// other attributes like number of CPUs and amount of disk space varies but naming is based on memory). The available
// options can be seem from the [Aiven pricing page](https://aiven.io/pricing).
Plan string `pulumi:"plan"`
// Identifies the project this resource belongs to. To set up proper dependencies please refer to this variable as a
// reference. Changing this property forces recreation of the resource.
Project string `pulumi:"project"`
// Specifies the VPC the service should run in. If the value is not set the service is not run inside a VPC. When set, the
// value should be given as a reference to set up dependencies correctly and the VPC must be in the same cloud and region
// as the service itself. Project can be freely moved to and from VPC after creation but doing so triggers migration to new
// servers so the operation can take significant amount of time to complete if the service has a lot of data.
ProjectVpcId *string `pulumi:"projectVpcId"`
// Service integrations to specify when creating a service. Not applied after initial service creation
ServiceIntegrations []DragonflyServiceIntegration `pulumi:"serviceIntegrations"`
// Specifies the actual name of the service. The name cannot be changed later without destroying and re-creating the
// service so name should be picked based on intended service usage rather than current attributes.
ServiceName string `pulumi:"serviceName"`
// Static IPs that are going to be associated with this service. Please assign a value using the 'toset' function. Once a
// static ip resource is in the 'assigned' state it cannot be unbound from the node again
StaticIps []string `pulumi:"staticIps"`
// Tags are key-value pairs that allow you to categorize services.
Tags []DragonflyTag `pulumi:"tags"`
// Defines the email addresses that will receive alerts about upcoming maintenance updates or warnings about service
// instability.
TechEmails []DragonflyTechEmail `pulumi:"techEmails"`
// Prevents the service from being deleted. It is recommended to set this to `true` for all production services to prevent
// unintentional service deletion. This does not shield against deleting databases or topics but for services with backups
// much of the content can at least be restored from backup in case accidental deletion is done.
TerminationProtection *bool `pulumi:"terminationProtection"`
}
// The set of arguments for constructing a Dragonfly resource.
type DragonflyArgs struct {
// Additional disk space. Possible values depend on the service type, the cloud provider and the project. Therefore,
// reducing will result in the service rebalancing.
AdditionalDiskSpace pulumi.StringPtrInput
// Defines where the cloud provider and region where the service is hosted in. This can be changed freely after service is
// created. Changing the value will trigger a potentially lengthy migration process for the service. Format is cloud
// provider name (`aws`, `azure`, `do` `google`, `upcloud`, etc.), dash, and the cloud provider specific region name. These
// are documented on each Cloud provider's own support articles, like [here for
// Google](https://cloud.google.com/compute/docs/regions-zones/) and [here for
// AWS](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.RegionsAndAvailabilityZones.html).
CloudName pulumi.StringPtrInput
// Service disk space. Possible values depend on the service type, the cloud provider and the project. Therefore, reducing
// will result in the service rebalancing.
//
// Deprecated: This will be removed in v5.0.0. Please use `additionalDiskSpace` to specify the space to be added to the default `diskSpace` defined by the plan.
DiskSpace pulumi.StringPtrInput
// Dragonfly user configurable settings
DragonflyUserConfig DragonflyDragonflyUserConfigPtrInput
// Day of week when maintenance operations should be performed. One monday, tuesday, wednesday, etc.
MaintenanceWindowDow pulumi.StringPtrInput
// Time of day when maintenance operations should be performed. UTC time in HH:mm:ss format.
MaintenanceWindowTime pulumi.StringPtrInput
// Defines what kind of computing resources are allocated for the service. It can be changed after creation, though there
// are some restrictions when going to a smaller plan such as the new plan must have sufficient amount of disk space to
// store all current data and switching to a plan with fewer nodes might not be supported. The basic plan names are
// `hobbyist`, `startup-x`, `business-x` and `premium-x` where `x` is (roughly) the amount of memory on each node (also
// other attributes like number of CPUs and amount of disk space varies but naming is based on memory). The available
// options can be seem from the [Aiven pricing page](https://aiven.io/pricing).
Plan pulumi.StringInput
// Identifies the project this resource belongs to. To set up proper dependencies please refer to this variable as a
// reference. Changing this property forces recreation of the resource.
Project pulumi.StringInput
// Specifies the VPC the service should run in. If the value is not set the service is not run inside a VPC. When set, the
// value should be given as a reference to set up dependencies correctly and the VPC must be in the same cloud and region
// as the service itself. Project can be freely moved to and from VPC after creation but doing so triggers migration to new
// servers so the operation can take significant amount of time to complete if the service has a lot of data.
ProjectVpcId pulumi.StringPtrInput
// Service integrations to specify when creating a service. Not applied after initial service creation
ServiceIntegrations DragonflyServiceIntegrationArrayInput
// Specifies the actual name of the service. The name cannot be changed later without destroying and re-creating the
// service so name should be picked based on intended service usage rather than current attributes.
ServiceName pulumi.StringInput
// Static IPs that are going to be associated with this service. Please assign a value using the 'toset' function. Once a
// static ip resource is in the 'assigned' state it cannot be unbound from the node again
StaticIps pulumi.StringArrayInput
// Tags are key-value pairs that allow you to categorize services.
Tags DragonflyTagArrayInput
// Defines the email addresses that will receive alerts about upcoming maintenance updates or warnings about service
// instability.
TechEmails DragonflyTechEmailArrayInput
// Prevents the service from being deleted. It is recommended to set this to `true` for all production services to prevent
// unintentional service deletion. This does not shield against deleting databases or topics but for services with backups
// much of the content can at least be restored from backup in case accidental deletion is done.
TerminationProtection pulumi.BoolPtrInput
}
func (DragonflyArgs) ElementType() reflect.Type {
return reflect.TypeOf((*dragonflyArgs)(nil)).Elem()
}
type DragonflyInput interface {
pulumi.Input
ToDragonflyOutput() DragonflyOutput
ToDragonflyOutputWithContext(ctx context.Context) DragonflyOutput
}
func (*Dragonfly) ElementType() reflect.Type {
return reflect.TypeOf((**Dragonfly)(nil)).Elem()
}
func (i *Dragonfly) ToDragonflyOutput() DragonflyOutput {
return i.ToDragonflyOutputWithContext(context.Background())
}
func (i *Dragonfly) ToDragonflyOutputWithContext(ctx context.Context) DragonflyOutput {
return pulumi.ToOutputWithContext(ctx, i).(DragonflyOutput)
}
// DragonflyArrayInput is an input type that accepts DragonflyArray and DragonflyArrayOutput values.
// You can construct a concrete instance of `DragonflyArrayInput` via:
//
// DragonflyArray{ DragonflyArgs{...} }
type DragonflyArrayInput interface {
pulumi.Input
ToDragonflyArrayOutput() DragonflyArrayOutput
ToDragonflyArrayOutputWithContext(context.Context) DragonflyArrayOutput
}
type DragonflyArray []DragonflyInput
func (DragonflyArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Dragonfly)(nil)).Elem()
}
func (i DragonflyArray) ToDragonflyArrayOutput() DragonflyArrayOutput {
return i.ToDragonflyArrayOutputWithContext(context.Background())
}
func (i DragonflyArray) ToDragonflyArrayOutputWithContext(ctx context.Context) DragonflyArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(DragonflyArrayOutput)
}
// DragonflyMapInput is an input type that accepts DragonflyMap and DragonflyMapOutput values.
// You can construct a concrete instance of `DragonflyMapInput` via:
//
// DragonflyMap{ "key": DragonflyArgs{...} }
type DragonflyMapInput interface {
pulumi.Input
ToDragonflyMapOutput() DragonflyMapOutput
ToDragonflyMapOutputWithContext(context.Context) DragonflyMapOutput
}
type DragonflyMap map[string]DragonflyInput
func (DragonflyMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Dragonfly)(nil)).Elem()
}
func (i DragonflyMap) ToDragonflyMapOutput() DragonflyMapOutput {
return i.ToDragonflyMapOutputWithContext(context.Background())
}
func (i DragonflyMap) ToDragonflyMapOutputWithContext(ctx context.Context) DragonflyMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(DragonflyMapOutput)
}
type DragonflyOutput struct{ *pulumi.OutputState }
func (DragonflyOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Dragonfly)(nil)).Elem()
}
func (o DragonflyOutput) ToDragonflyOutput() DragonflyOutput {
return o
}
func (o DragonflyOutput) ToDragonflyOutputWithContext(ctx context.Context) DragonflyOutput {
return o
}
// Additional disk space. Possible values depend on the service type, the cloud provider and the project. Therefore,
// reducing will result in the service rebalancing.
func (o DragonflyOutput) AdditionalDiskSpace() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Dragonfly) pulumi.StringPtrOutput { return v.AdditionalDiskSpace }).(pulumi.StringPtrOutput)
}
// Defines where the cloud provider and region where the service is hosted in. This can be changed freely after service is
// created. Changing the value will trigger a potentially lengthy migration process for the service. Format is cloud
// provider name (`aws`, `azure`, `do` `google`, `upcloud`, etc.), dash, and the cloud provider specific region name. These
// are documented on each Cloud provider's own support articles, like [here for
// Google](https://cloud.google.com/compute/docs/regions-zones/) and [here for
// AWS](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.RegionsAndAvailabilityZones.html).
func (o DragonflyOutput) CloudName() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Dragonfly) pulumi.StringPtrOutput { return v.CloudName }).(pulumi.StringPtrOutput)
}
// Service component information objects
func (o DragonflyOutput) Components() DragonflyComponentArrayOutput {
return o.ApplyT(func(v *Dragonfly) DragonflyComponentArrayOutput { return v.Components }).(DragonflyComponentArrayOutput)
}
// Service disk space. Possible values depend on the service type, the cloud provider and the project. Therefore, reducing
// will result in the service rebalancing.
//
// Deprecated: This will be removed in v5.0.0. Please use `additionalDiskSpace` to specify the space to be added to the default `diskSpace` defined by the plan.
func (o DragonflyOutput) DiskSpace() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Dragonfly) pulumi.StringPtrOutput { return v.DiskSpace }).(pulumi.StringPtrOutput)
}
// The maximum disk space of the service, possible values depend on the service type, the cloud provider and the project.
func (o DragonflyOutput) DiskSpaceCap() pulumi.StringOutput {
return o.ApplyT(func(v *Dragonfly) pulumi.StringOutput { return v.DiskSpaceCap }).(pulumi.StringOutput)
}
// The default disk space of the service, possible values depend on the service type, the cloud provider and the project.
// Its also the minimum value for `disk_space`
func (o DragonflyOutput) DiskSpaceDefault() pulumi.StringOutput {
return o.ApplyT(func(v *Dragonfly) pulumi.StringOutput { return v.DiskSpaceDefault }).(pulumi.StringOutput)
}
// The default disk space step of the service, possible values depend on the service type, the cloud provider and the
// project. `disk_space` needs to increment from `disk_space_default` by increments of this size.
func (o DragonflyOutput) DiskSpaceStep() pulumi.StringOutput {
return o.ApplyT(func(v *Dragonfly) pulumi.StringOutput { return v.DiskSpaceStep }).(pulumi.StringOutput)
}
// Disk space that service is currently using
func (o DragonflyOutput) DiskSpaceUsed() pulumi.StringOutput {
return o.ApplyT(func(v *Dragonfly) pulumi.StringOutput { return v.DiskSpaceUsed }).(pulumi.StringOutput)
}
// Dragonfly server provided values
func (o DragonflyOutput) Dragonflies() DragonflyDragonflyArrayOutput {
return o.ApplyT(func(v *Dragonfly) DragonflyDragonflyArrayOutput { return v.Dragonflies }).(DragonflyDragonflyArrayOutput)
}
// Dragonfly user configurable settings
func (o DragonflyOutput) DragonflyUserConfig() DragonflyDragonflyUserConfigPtrOutput {
return o.ApplyT(func(v *Dragonfly) DragonflyDragonflyUserConfigPtrOutput { return v.DragonflyUserConfig }).(DragonflyDragonflyUserConfigPtrOutput)
}
// Day of week when maintenance operations should be performed. One monday, tuesday, wednesday, etc.
func (o DragonflyOutput) MaintenanceWindowDow() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Dragonfly) pulumi.StringPtrOutput { return v.MaintenanceWindowDow }).(pulumi.StringPtrOutput)
}
// Time of day when maintenance operations should be performed. UTC time in HH:mm:ss format.
func (o DragonflyOutput) MaintenanceWindowTime() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Dragonfly) pulumi.StringPtrOutput { return v.MaintenanceWindowTime }).(pulumi.StringPtrOutput)
}
// Defines what kind of computing resources are allocated for the service. It can be changed after creation, though there
// are some restrictions when going to a smaller plan such as the new plan must have sufficient amount of disk space to
// store all current data and switching to a plan with fewer nodes might not be supported. The basic plan names are
// `hobbyist`, `startup-x`, `business-x` and `premium-x` where `x` is (roughly) the amount of memory on each node (also
// other attributes like number of CPUs and amount of disk space varies but naming is based on memory). The available
// options can be seem from the [Aiven pricing page](https://aiven.io/pricing).
func (o DragonflyOutput) Plan() pulumi.StringOutput {
return o.ApplyT(func(v *Dragonfly) pulumi.StringOutput { return v.Plan }).(pulumi.StringOutput)
}
// Identifies the project this resource belongs to. To set up proper dependencies please refer to this variable as a
// reference. Changing this property forces recreation of the resource.
func (o DragonflyOutput) Project() pulumi.StringOutput {
return o.ApplyT(func(v *Dragonfly) pulumi.StringOutput { return v.Project }).(pulumi.StringOutput)
}
// Specifies the VPC the service should run in. If the value is not set the service is not run inside a VPC. When set, the
// value should be given as a reference to set up dependencies correctly and the VPC must be in the same cloud and region
// as the service itself. Project can be freely moved to and from VPC after creation but doing so triggers migration to new
// servers so the operation can take significant amount of time to complete if the service has a lot of data.
func (o DragonflyOutput) ProjectVpcId() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Dragonfly) pulumi.StringPtrOutput { return v.ProjectVpcId }).(pulumi.StringPtrOutput)
}
// The hostname of the service.
func (o DragonflyOutput) ServiceHost() pulumi.StringOutput {
return o.ApplyT(func(v *Dragonfly) pulumi.StringOutput { return v.ServiceHost }).(pulumi.StringOutput)
}
// Service integrations to specify when creating a service. Not applied after initial service creation
func (o DragonflyOutput) ServiceIntegrations() DragonflyServiceIntegrationArrayOutput {
return o.ApplyT(func(v *Dragonfly) DragonflyServiceIntegrationArrayOutput { return v.ServiceIntegrations }).(DragonflyServiceIntegrationArrayOutput)
}
// Specifies the actual name of the service. The name cannot be changed later without destroying and re-creating the
// service so name should be picked based on intended service usage rather than current attributes.
func (o DragonflyOutput) ServiceName() pulumi.StringOutput {
return o.ApplyT(func(v *Dragonfly) pulumi.StringOutput { return v.ServiceName }).(pulumi.StringOutput)
}
// Password used for connecting to the service, if applicable
func (o DragonflyOutput) ServicePassword() pulumi.StringOutput {
return o.ApplyT(func(v *Dragonfly) pulumi.StringOutput { return v.ServicePassword }).(pulumi.StringOutput)
}
// The port of the service
func (o DragonflyOutput) ServicePort() pulumi.IntOutput {
return o.ApplyT(func(v *Dragonfly) pulumi.IntOutput { return v.ServicePort }).(pulumi.IntOutput)
}
// Aiven internal service type code
func (o DragonflyOutput) ServiceType() pulumi.StringOutput {
return o.ApplyT(func(v *Dragonfly) pulumi.StringOutput { return v.ServiceType }).(pulumi.StringOutput)
}
// URI for connecting to the service. Service specific info is under "kafka", "pg", etc.
func (o DragonflyOutput) ServiceUri() pulumi.StringOutput {
return o.ApplyT(func(v *Dragonfly) pulumi.StringOutput { return v.ServiceUri }).(pulumi.StringOutput)
}
// Username used for connecting to the service, if applicable
func (o DragonflyOutput) ServiceUsername() pulumi.StringOutput {
return o.ApplyT(func(v *Dragonfly) pulumi.StringOutput { return v.ServiceUsername }).(pulumi.StringOutput)
}
// Service state. One of `POWEROFF`, `REBALANCING`, `REBUILDING` or `RUNNING`
func (o DragonflyOutput) State() pulumi.StringOutput {
return o.ApplyT(func(v *Dragonfly) pulumi.StringOutput { return v.State }).(pulumi.StringOutput)
}
// Static IPs that are going to be associated with this service. Please assign a value using the 'toset' function. Once a
// static ip resource is in the 'assigned' state it cannot be unbound from the node again
func (o DragonflyOutput) StaticIps() pulumi.StringArrayOutput {
return o.ApplyT(func(v *Dragonfly) pulumi.StringArrayOutput { return v.StaticIps }).(pulumi.StringArrayOutput)
}
// Tags are key-value pairs that allow you to categorize services.
func (o DragonflyOutput) Tags() DragonflyTagArrayOutput {
return o.ApplyT(func(v *Dragonfly) DragonflyTagArrayOutput { return v.Tags }).(DragonflyTagArrayOutput)
}
// Defines the email addresses that will receive alerts about upcoming maintenance updates or warnings about service
// instability.
func (o DragonflyOutput) TechEmails() DragonflyTechEmailArrayOutput {
return o.ApplyT(func(v *Dragonfly) DragonflyTechEmailArrayOutput { return v.TechEmails }).(DragonflyTechEmailArrayOutput)
}
// Prevents the service from being deleted. It is recommended to set this to `true` for all production services to prevent
// unintentional service deletion. This does not shield against deleting databases or topics but for services with backups
// much of the content can at least be restored from backup in case accidental deletion is done.
func (o DragonflyOutput) TerminationProtection() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *Dragonfly) pulumi.BoolPtrOutput { return v.TerminationProtection }).(pulumi.BoolPtrOutput)
}
type DragonflyArrayOutput struct{ *pulumi.OutputState }
func (DragonflyArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Dragonfly)(nil)).Elem()
}
func (o DragonflyArrayOutput) ToDragonflyArrayOutput() DragonflyArrayOutput {
return o
}
func (o DragonflyArrayOutput) ToDragonflyArrayOutputWithContext(ctx context.Context) DragonflyArrayOutput {
return o
}
func (o DragonflyArrayOutput) Index(i pulumi.IntInput) DragonflyOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Dragonfly {
return vs[0].([]*Dragonfly)[vs[1].(int)]
}).(DragonflyOutput)
}
type DragonflyMapOutput struct{ *pulumi.OutputState }
func (DragonflyMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Dragonfly)(nil)).Elem()
}
func (o DragonflyMapOutput) ToDragonflyMapOutput() DragonflyMapOutput {
return o
}
func (o DragonflyMapOutput) ToDragonflyMapOutputWithContext(ctx context.Context) DragonflyMapOutput {
return o
}
func (o DragonflyMapOutput) MapIndex(k pulumi.StringInput) DragonflyOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Dragonfly {
return vs[0].(map[string]*Dragonfly)[vs[1].(string)]
}).(DragonflyOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*DragonflyInput)(nil)).Elem(), &Dragonfly{})
pulumi.RegisterInputType(reflect.TypeOf((*DragonflyArrayInput)(nil)).Elem(), DragonflyArray{})
pulumi.RegisterInputType(reflect.TypeOf((*DragonflyMapInput)(nil)).Elem(), DragonflyMap{})
pulumi.RegisterOutputType(DragonflyOutput{})
pulumi.RegisterOutputType(DragonflyArrayOutput{})
pulumi.RegisterOutputType(DragonflyMapOutput{})
}