/
cluster.go
791 lines (712 loc) · 42.9 KB
/
cluster.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
// 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 docdb
import (
"context"
"reflect"
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages a DocumentDB Cluster.
//
// Changes to a DocumentDB Cluster can occur when you manually change a
// parameter, such as `port`, and are reflected in the next maintenance
// window. Because of this, this provider may report a difference in its planning
// phase because a modification has not yet taken place. You can use the
// `applyImmediately` flag to instruct the service to apply the change immediately
// (see documentation below).
//
// > **Note:** using `applyImmediately` can result in a brief downtime as the server reboots.
//
// ## Example Usage
//
// <!--Start PulumiCodeChooser -->
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/docdb"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := docdb.NewCluster(ctx, "docdb", &docdb.ClusterArgs{
// ClusterIdentifier: pulumi.String("my-docdb-cluster"),
// Engine: pulumi.String("docdb"),
// MasterUsername: pulumi.String("foo"),
// MasterPassword: pulumi.String("mustbeeightchars"),
// BackupRetentionPeriod: pulumi.Int(5),
// PreferredBackupWindow: pulumi.String("07:00-09:00"),
// SkipFinalSnapshot: pulumi.Bool(true),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
// <!--End PulumiCodeChooser -->
//
// ## Import
//
// Using `pulumi import`, import DocumentDB Clusters using the `cluster_identifier`. For example:
//
// ```sh
// $ pulumi import aws:docdb/cluster:Cluster docdb_cluster docdb-prod-cluster
// ```
type Cluster struct {
pulumi.CustomResourceState
// A value that indicates whether major version upgrades are allowed. Constraints: You must allow major version upgrades when specifying a value for the EngineVersion parameter that is a different major version than the DB cluster's current version.
AllowMajorVersionUpgrade pulumi.BoolPtrOutput `pulumi:"allowMajorVersionUpgrade"`
// Specifies whether any cluster modifications
// are applied immediately, or during the next maintenance window. Default is
// `false`.
ApplyImmediately pulumi.BoolPtrOutput `pulumi:"applyImmediately"`
// Amazon Resource Name (ARN) of cluster
Arn pulumi.StringOutput `pulumi:"arn"`
// A list of EC2 Availability Zones that
// instances in the DB cluster can be created in.
AvailabilityZones pulumi.StringArrayOutput `pulumi:"availabilityZones"`
// The days to retain backups for. Default `1`
BackupRetentionPeriod pulumi.IntPtrOutput `pulumi:"backupRetentionPeriod"`
// The cluster identifier. If omitted, the provider will assign a random, unique identifier.
ClusterIdentifier pulumi.StringOutput `pulumi:"clusterIdentifier"`
// Creates a unique cluster identifier beginning with the specified prefix. Conflicts with `clusterIdentifier`.
ClusterIdentifierPrefix pulumi.StringOutput `pulumi:"clusterIdentifierPrefix"`
// List of DocumentDB Instances that are a part of this cluster
ClusterMembers pulumi.StringArrayOutput `pulumi:"clusterMembers"`
// The DocumentDB Cluster Resource ID
ClusterResourceId pulumi.StringOutput `pulumi:"clusterResourceId"`
// A cluster parameter group to associate with the cluster.
DbClusterParameterGroupName pulumi.StringOutput `pulumi:"dbClusterParameterGroupName"`
// A DB subnet group to associate with this DB instance.
DbSubnetGroupName pulumi.StringOutput `pulumi:"dbSubnetGroupName"`
// A value that indicates whether the DB cluster has deletion protection enabled. The database can't be deleted when deletion protection is enabled. By default, deletion protection is disabled.
DeletionProtection pulumi.BoolPtrOutput `pulumi:"deletionProtection"`
// List of log types to export to cloudwatch. If omitted, no logs will be exported.
// The following log types are supported: `audit`, `profiler`.
EnabledCloudwatchLogsExports pulumi.StringArrayOutput `pulumi:"enabledCloudwatchLogsExports"`
// The DNS address of the DocumentDB instance
Endpoint pulumi.StringOutput `pulumi:"endpoint"`
// The name of the database engine to be used for this DB cluster. Defaults to `docdb`. Valid values: `docdb`.
Engine pulumi.StringPtrOutput `pulumi:"engine"`
// The database engine version. Updating this argument results in an outage.
EngineVersion pulumi.StringOutput `pulumi:"engineVersion"`
// The name of your final DB snapshot
// when this DB cluster is deleted. If omitted, no final snapshot will be
// made.
FinalSnapshotIdentifier pulumi.StringPtrOutput `pulumi:"finalSnapshotIdentifier"`
// The global cluster identifier specified on `docdb.GlobalCluster`.
GlobalClusterIdentifier pulumi.StringPtrOutput `pulumi:"globalClusterIdentifier"`
// The Route53 Hosted Zone ID of the endpoint
HostedZoneId pulumi.StringOutput `pulumi:"hostedZoneId"`
// The ARN for the KMS encryption key. When specifying `kmsKeyId`, `storageEncrypted` needs to be set to true.
KmsKeyId pulumi.StringOutput `pulumi:"kmsKeyId"`
// Password for the master DB user. Note that this may
// show up in logs, and it will be stored in the state file. Please refer to the DocumentDB Naming Constraints.
MasterPassword pulumi.StringPtrOutput `pulumi:"masterPassword"`
// Username for the master DB user.
MasterUsername pulumi.StringOutput `pulumi:"masterUsername"`
// The port on which the DB accepts connections
Port pulumi.IntPtrOutput `pulumi:"port"`
// The daily time range during which automated backups are created if automated backups are enabled using the BackupRetentionPeriod parameter.Time in UTC
// Default: A 30-minute window selected at random from an 8-hour block of time per regionE.g., 04:00-09:00
PreferredBackupWindow pulumi.StringOutput `pulumi:"preferredBackupWindow"`
// The weekly time range during which system maintenance can occur, in (UTC) e.g., wed:04:00-wed:04:30
PreferredMaintenanceWindow pulumi.StringOutput `pulumi:"preferredMaintenanceWindow"`
// A read-only endpoint for the DocumentDB cluster, automatically load-balanced across replicas
ReaderEndpoint pulumi.StringOutput `pulumi:"readerEndpoint"`
// Determines whether a final DB snapshot is created before the DB cluster is deleted. If true is specified, no DB snapshot is created. If false is specified, a DB snapshot is created before the DB cluster is deleted, using the value from `finalSnapshotIdentifier`. Default is `false`.
SkipFinalSnapshot pulumi.BoolPtrOutput `pulumi:"skipFinalSnapshot"`
// Specifies whether or not to create this cluster from a snapshot. You can use either the name or ARN when specifying a DB cluster snapshot, or the ARN when specifying a DB snapshot. Automated snapshots **should not** be used for this attribute, unless from a different cluster. Automated snapshots are deleted as part of cluster destruction when the resource is replaced.
SnapshotIdentifier pulumi.StringPtrOutput `pulumi:"snapshotIdentifier"`
// Specifies whether the DB cluster is encrypted. The default is `false`.
StorageEncrypted pulumi.BoolPtrOutput `pulumi:"storageEncrypted"`
// The storage type to associate with the DB cluster. Valid values: `standard`, `iopt1`.
StorageType pulumi.StringPtrOutput `pulumi:"storageType"`
// A map of tags to assign to the DB cluster. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Tags pulumi.StringMapOutput `pulumi:"tags"`
// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
//
// Deprecated: Please use `tags` instead.
TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
// List of VPC security groups to associate
// with the Cluster
VpcSecurityGroupIds pulumi.StringArrayOutput `pulumi:"vpcSecurityGroupIds"`
}
// NewCluster registers a new resource with the given unique name, arguments, and options.
func NewCluster(ctx *pulumi.Context,
name string, args *ClusterArgs, opts ...pulumi.ResourceOption) (*Cluster, error) {
if args == nil {
args = &ClusterArgs{}
}
if args.MasterPassword != nil {
args.MasterPassword = pulumi.ToSecret(args.MasterPassword).(pulumi.StringPtrInput)
}
secrets := pulumi.AdditionalSecretOutputs([]string{
"masterPassword",
})
opts = append(opts, secrets)
opts = internal.PkgResourceDefaultOpts(opts)
var resource Cluster
err := ctx.RegisterResource("aws:docdb/cluster:Cluster", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetCluster gets an existing Cluster 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 GetCluster(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *ClusterState, opts ...pulumi.ResourceOption) (*Cluster, error) {
var resource Cluster
err := ctx.ReadResource("aws:docdb/cluster:Cluster", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Cluster resources.
type clusterState struct {
// A value that indicates whether major version upgrades are allowed. Constraints: You must allow major version upgrades when specifying a value for the EngineVersion parameter that is a different major version than the DB cluster's current version.
AllowMajorVersionUpgrade *bool `pulumi:"allowMajorVersionUpgrade"`
// Specifies whether any cluster modifications
// are applied immediately, or during the next maintenance window. Default is
// `false`.
ApplyImmediately *bool `pulumi:"applyImmediately"`
// Amazon Resource Name (ARN) of cluster
Arn *string `pulumi:"arn"`
// A list of EC2 Availability Zones that
// instances in the DB cluster can be created in.
AvailabilityZones []string `pulumi:"availabilityZones"`
// The days to retain backups for. Default `1`
BackupRetentionPeriod *int `pulumi:"backupRetentionPeriod"`
// The cluster identifier. If omitted, the provider will assign a random, unique identifier.
ClusterIdentifier *string `pulumi:"clusterIdentifier"`
// Creates a unique cluster identifier beginning with the specified prefix. Conflicts with `clusterIdentifier`.
ClusterIdentifierPrefix *string `pulumi:"clusterIdentifierPrefix"`
// List of DocumentDB Instances that are a part of this cluster
ClusterMembers []string `pulumi:"clusterMembers"`
// The DocumentDB Cluster Resource ID
ClusterResourceId *string `pulumi:"clusterResourceId"`
// A cluster parameter group to associate with the cluster.
DbClusterParameterGroupName *string `pulumi:"dbClusterParameterGroupName"`
// A DB subnet group to associate with this DB instance.
DbSubnetGroupName *string `pulumi:"dbSubnetGroupName"`
// A value that indicates whether the DB cluster has deletion protection enabled. The database can't be deleted when deletion protection is enabled. By default, deletion protection is disabled.
DeletionProtection *bool `pulumi:"deletionProtection"`
// List of log types to export to cloudwatch. If omitted, no logs will be exported.
// The following log types are supported: `audit`, `profiler`.
EnabledCloudwatchLogsExports []string `pulumi:"enabledCloudwatchLogsExports"`
// The DNS address of the DocumentDB instance
Endpoint *string `pulumi:"endpoint"`
// The name of the database engine to be used for this DB cluster. Defaults to `docdb`. Valid values: `docdb`.
Engine *string `pulumi:"engine"`
// The database engine version. Updating this argument results in an outage.
EngineVersion *string `pulumi:"engineVersion"`
// The name of your final DB snapshot
// when this DB cluster is deleted. If omitted, no final snapshot will be
// made.
FinalSnapshotIdentifier *string `pulumi:"finalSnapshotIdentifier"`
// The global cluster identifier specified on `docdb.GlobalCluster`.
GlobalClusterIdentifier *string `pulumi:"globalClusterIdentifier"`
// The Route53 Hosted Zone ID of the endpoint
HostedZoneId *string `pulumi:"hostedZoneId"`
// The ARN for the KMS encryption key. When specifying `kmsKeyId`, `storageEncrypted` needs to be set to true.
KmsKeyId *string `pulumi:"kmsKeyId"`
// Password for the master DB user. Note that this may
// show up in logs, and it will be stored in the state file. Please refer to the DocumentDB Naming Constraints.
MasterPassword *string `pulumi:"masterPassword"`
// Username for the master DB user.
MasterUsername *string `pulumi:"masterUsername"`
// The port on which the DB accepts connections
Port *int `pulumi:"port"`
// The daily time range during which automated backups are created if automated backups are enabled using the BackupRetentionPeriod parameter.Time in UTC
// Default: A 30-minute window selected at random from an 8-hour block of time per regionE.g., 04:00-09:00
PreferredBackupWindow *string `pulumi:"preferredBackupWindow"`
// The weekly time range during which system maintenance can occur, in (UTC) e.g., wed:04:00-wed:04:30
PreferredMaintenanceWindow *string `pulumi:"preferredMaintenanceWindow"`
// A read-only endpoint for the DocumentDB cluster, automatically load-balanced across replicas
ReaderEndpoint *string `pulumi:"readerEndpoint"`
// Determines whether a final DB snapshot is created before the DB cluster is deleted. If true is specified, no DB snapshot is created. If false is specified, a DB snapshot is created before the DB cluster is deleted, using the value from `finalSnapshotIdentifier`. Default is `false`.
SkipFinalSnapshot *bool `pulumi:"skipFinalSnapshot"`
// Specifies whether or not to create this cluster from a snapshot. You can use either the name or ARN when specifying a DB cluster snapshot, or the ARN when specifying a DB snapshot. Automated snapshots **should not** be used for this attribute, unless from a different cluster. Automated snapshots are deleted as part of cluster destruction when the resource is replaced.
SnapshotIdentifier *string `pulumi:"snapshotIdentifier"`
// Specifies whether the DB cluster is encrypted. The default is `false`.
StorageEncrypted *bool `pulumi:"storageEncrypted"`
// The storage type to associate with the DB cluster. Valid values: `standard`, `iopt1`.
StorageType *string `pulumi:"storageType"`
// A map of tags to assign to the DB cluster. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Tags map[string]string `pulumi:"tags"`
// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
//
// Deprecated: Please use `tags` instead.
TagsAll map[string]string `pulumi:"tagsAll"`
// List of VPC security groups to associate
// with the Cluster
VpcSecurityGroupIds []string `pulumi:"vpcSecurityGroupIds"`
}
type ClusterState struct {
// A value that indicates whether major version upgrades are allowed. Constraints: You must allow major version upgrades when specifying a value for the EngineVersion parameter that is a different major version than the DB cluster's current version.
AllowMajorVersionUpgrade pulumi.BoolPtrInput
// Specifies whether any cluster modifications
// are applied immediately, or during the next maintenance window. Default is
// `false`.
ApplyImmediately pulumi.BoolPtrInput
// Amazon Resource Name (ARN) of cluster
Arn pulumi.StringPtrInput
// A list of EC2 Availability Zones that
// instances in the DB cluster can be created in.
AvailabilityZones pulumi.StringArrayInput
// The days to retain backups for. Default `1`
BackupRetentionPeriod pulumi.IntPtrInput
// The cluster identifier. If omitted, the provider will assign a random, unique identifier.
ClusterIdentifier pulumi.StringPtrInput
// Creates a unique cluster identifier beginning with the specified prefix. Conflicts with `clusterIdentifier`.
ClusterIdentifierPrefix pulumi.StringPtrInput
// List of DocumentDB Instances that are a part of this cluster
ClusterMembers pulumi.StringArrayInput
// The DocumentDB Cluster Resource ID
ClusterResourceId pulumi.StringPtrInput
// A cluster parameter group to associate with the cluster.
DbClusterParameterGroupName pulumi.StringPtrInput
// A DB subnet group to associate with this DB instance.
DbSubnetGroupName pulumi.StringPtrInput
// A value that indicates whether the DB cluster has deletion protection enabled. The database can't be deleted when deletion protection is enabled. By default, deletion protection is disabled.
DeletionProtection pulumi.BoolPtrInput
// List of log types to export to cloudwatch. If omitted, no logs will be exported.
// The following log types are supported: `audit`, `profiler`.
EnabledCloudwatchLogsExports pulumi.StringArrayInput
// The DNS address of the DocumentDB instance
Endpoint pulumi.StringPtrInput
// The name of the database engine to be used for this DB cluster. Defaults to `docdb`. Valid values: `docdb`.
Engine pulumi.StringPtrInput
// The database engine version. Updating this argument results in an outage.
EngineVersion pulumi.StringPtrInput
// The name of your final DB snapshot
// when this DB cluster is deleted. If omitted, no final snapshot will be
// made.
FinalSnapshotIdentifier pulumi.StringPtrInput
// The global cluster identifier specified on `docdb.GlobalCluster`.
GlobalClusterIdentifier pulumi.StringPtrInput
// The Route53 Hosted Zone ID of the endpoint
HostedZoneId pulumi.StringPtrInput
// The ARN for the KMS encryption key. When specifying `kmsKeyId`, `storageEncrypted` needs to be set to true.
KmsKeyId pulumi.StringPtrInput
// Password for the master DB user. Note that this may
// show up in logs, and it will be stored in the state file. Please refer to the DocumentDB Naming Constraints.
MasterPassword pulumi.StringPtrInput
// Username for the master DB user.
MasterUsername pulumi.StringPtrInput
// The port on which the DB accepts connections
Port pulumi.IntPtrInput
// The daily time range during which automated backups are created if automated backups are enabled using the BackupRetentionPeriod parameter.Time in UTC
// Default: A 30-minute window selected at random from an 8-hour block of time per regionE.g., 04:00-09:00
PreferredBackupWindow pulumi.StringPtrInput
// The weekly time range during which system maintenance can occur, in (UTC) e.g., wed:04:00-wed:04:30
PreferredMaintenanceWindow pulumi.StringPtrInput
// A read-only endpoint for the DocumentDB cluster, automatically load-balanced across replicas
ReaderEndpoint pulumi.StringPtrInput
// Determines whether a final DB snapshot is created before the DB cluster is deleted. If true is specified, no DB snapshot is created. If false is specified, a DB snapshot is created before the DB cluster is deleted, using the value from `finalSnapshotIdentifier`. Default is `false`.
SkipFinalSnapshot pulumi.BoolPtrInput
// Specifies whether or not to create this cluster from a snapshot. You can use either the name or ARN when specifying a DB cluster snapshot, or the ARN when specifying a DB snapshot. Automated snapshots **should not** be used for this attribute, unless from a different cluster. Automated snapshots are deleted as part of cluster destruction when the resource is replaced.
SnapshotIdentifier pulumi.StringPtrInput
// Specifies whether the DB cluster is encrypted. The default is `false`.
StorageEncrypted pulumi.BoolPtrInput
// The storage type to associate with the DB cluster. Valid values: `standard`, `iopt1`.
StorageType pulumi.StringPtrInput
// A map of tags to assign to the DB cluster. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Tags pulumi.StringMapInput
// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
//
// Deprecated: Please use `tags` instead.
TagsAll pulumi.StringMapInput
// List of VPC security groups to associate
// with the Cluster
VpcSecurityGroupIds pulumi.StringArrayInput
}
func (ClusterState) ElementType() reflect.Type {
return reflect.TypeOf((*clusterState)(nil)).Elem()
}
type clusterArgs struct {
// A value that indicates whether major version upgrades are allowed. Constraints: You must allow major version upgrades when specifying a value for the EngineVersion parameter that is a different major version than the DB cluster's current version.
AllowMajorVersionUpgrade *bool `pulumi:"allowMajorVersionUpgrade"`
// Specifies whether any cluster modifications
// are applied immediately, or during the next maintenance window. Default is
// `false`.
ApplyImmediately *bool `pulumi:"applyImmediately"`
// A list of EC2 Availability Zones that
// instances in the DB cluster can be created in.
AvailabilityZones []string `pulumi:"availabilityZones"`
// The days to retain backups for. Default `1`
BackupRetentionPeriod *int `pulumi:"backupRetentionPeriod"`
// The cluster identifier. If omitted, the provider will assign a random, unique identifier.
ClusterIdentifier *string `pulumi:"clusterIdentifier"`
// Creates a unique cluster identifier beginning with the specified prefix. Conflicts with `clusterIdentifier`.
ClusterIdentifierPrefix *string `pulumi:"clusterIdentifierPrefix"`
// List of DocumentDB Instances that are a part of this cluster
ClusterMembers []string `pulumi:"clusterMembers"`
// A cluster parameter group to associate with the cluster.
DbClusterParameterGroupName *string `pulumi:"dbClusterParameterGroupName"`
// A DB subnet group to associate with this DB instance.
DbSubnetGroupName *string `pulumi:"dbSubnetGroupName"`
// A value that indicates whether the DB cluster has deletion protection enabled. The database can't be deleted when deletion protection is enabled. By default, deletion protection is disabled.
DeletionProtection *bool `pulumi:"deletionProtection"`
// List of log types to export to cloudwatch. If omitted, no logs will be exported.
// The following log types are supported: `audit`, `profiler`.
EnabledCloudwatchLogsExports []string `pulumi:"enabledCloudwatchLogsExports"`
// The name of the database engine to be used for this DB cluster. Defaults to `docdb`. Valid values: `docdb`.
Engine *string `pulumi:"engine"`
// The database engine version. Updating this argument results in an outage.
EngineVersion *string `pulumi:"engineVersion"`
// The name of your final DB snapshot
// when this DB cluster is deleted. If omitted, no final snapshot will be
// made.
FinalSnapshotIdentifier *string `pulumi:"finalSnapshotIdentifier"`
// The global cluster identifier specified on `docdb.GlobalCluster`.
GlobalClusterIdentifier *string `pulumi:"globalClusterIdentifier"`
// The ARN for the KMS encryption key. When specifying `kmsKeyId`, `storageEncrypted` needs to be set to true.
KmsKeyId *string `pulumi:"kmsKeyId"`
// Password for the master DB user. Note that this may
// show up in logs, and it will be stored in the state file. Please refer to the DocumentDB Naming Constraints.
MasterPassword *string `pulumi:"masterPassword"`
// Username for the master DB user.
MasterUsername *string `pulumi:"masterUsername"`
// The port on which the DB accepts connections
Port *int `pulumi:"port"`
// The daily time range during which automated backups are created if automated backups are enabled using the BackupRetentionPeriod parameter.Time in UTC
// Default: A 30-minute window selected at random from an 8-hour block of time per regionE.g., 04:00-09:00
PreferredBackupWindow *string `pulumi:"preferredBackupWindow"`
// The weekly time range during which system maintenance can occur, in (UTC) e.g., wed:04:00-wed:04:30
PreferredMaintenanceWindow *string `pulumi:"preferredMaintenanceWindow"`
// Determines whether a final DB snapshot is created before the DB cluster is deleted. If true is specified, no DB snapshot is created. If false is specified, a DB snapshot is created before the DB cluster is deleted, using the value from `finalSnapshotIdentifier`. Default is `false`.
SkipFinalSnapshot *bool `pulumi:"skipFinalSnapshot"`
// Specifies whether or not to create this cluster from a snapshot. You can use either the name or ARN when specifying a DB cluster snapshot, or the ARN when specifying a DB snapshot. Automated snapshots **should not** be used for this attribute, unless from a different cluster. Automated snapshots are deleted as part of cluster destruction when the resource is replaced.
SnapshotIdentifier *string `pulumi:"snapshotIdentifier"`
// Specifies whether the DB cluster is encrypted. The default is `false`.
StorageEncrypted *bool `pulumi:"storageEncrypted"`
// The storage type to associate with the DB cluster. Valid values: `standard`, `iopt1`.
StorageType *string `pulumi:"storageType"`
// A map of tags to assign to the DB cluster. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Tags map[string]string `pulumi:"tags"`
// List of VPC security groups to associate
// with the Cluster
VpcSecurityGroupIds []string `pulumi:"vpcSecurityGroupIds"`
}
// The set of arguments for constructing a Cluster resource.
type ClusterArgs struct {
// A value that indicates whether major version upgrades are allowed. Constraints: You must allow major version upgrades when specifying a value for the EngineVersion parameter that is a different major version than the DB cluster's current version.
AllowMajorVersionUpgrade pulumi.BoolPtrInput
// Specifies whether any cluster modifications
// are applied immediately, or during the next maintenance window. Default is
// `false`.
ApplyImmediately pulumi.BoolPtrInput
// A list of EC2 Availability Zones that
// instances in the DB cluster can be created in.
AvailabilityZones pulumi.StringArrayInput
// The days to retain backups for. Default `1`
BackupRetentionPeriod pulumi.IntPtrInput
// The cluster identifier. If omitted, the provider will assign a random, unique identifier.
ClusterIdentifier pulumi.StringPtrInput
// Creates a unique cluster identifier beginning with the specified prefix. Conflicts with `clusterIdentifier`.
ClusterIdentifierPrefix pulumi.StringPtrInput
// List of DocumentDB Instances that are a part of this cluster
ClusterMembers pulumi.StringArrayInput
// A cluster parameter group to associate with the cluster.
DbClusterParameterGroupName pulumi.StringPtrInput
// A DB subnet group to associate with this DB instance.
DbSubnetGroupName pulumi.StringPtrInput
// A value that indicates whether the DB cluster has deletion protection enabled. The database can't be deleted when deletion protection is enabled. By default, deletion protection is disabled.
DeletionProtection pulumi.BoolPtrInput
// List of log types to export to cloudwatch. If omitted, no logs will be exported.
// The following log types are supported: `audit`, `profiler`.
EnabledCloudwatchLogsExports pulumi.StringArrayInput
// The name of the database engine to be used for this DB cluster. Defaults to `docdb`. Valid values: `docdb`.
Engine pulumi.StringPtrInput
// The database engine version. Updating this argument results in an outage.
EngineVersion pulumi.StringPtrInput
// The name of your final DB snapshot
// when this DB cluster is deleted. If omitted, no final snapshot will be
// made.
FinalSnapshotIdentifier pulumi.StringPtrInput
// The global cluster identifier specified on `docdb.GlobalCluster`.
GlobalClusterIdentifier pulumi.StringPtrInput
// The ARN for the KMS encryption key. When specifying `kmsKeyId`, `storageEncrypted` needs to be set to true.
KmsKeyId pulumi.StringPtrInput
// Password for the master DB user. Note that this may
// show up in logs, and it will be stored in the state file. Please refer to the DocumentDB Naming Constraints.
MasterPassword pulumi.StringPtrInput
// Username for the master DB user.
MasterUsername pulumi.StringPtrInput
// The port on which the DB accepts connections
Port pulumi.IntPtrInput
// The daily time range during which automated backups are created if automated backups are enabled using the BackupRetentionPeriod parameter.Time in UTC
// Default: A 30-minute window selected at random from an 8-hour block of time per regionE.g., 04:00-09:00
PreferredBackupWindow pulumi.StringPtrInput
// The weekly time range during which system maintenance can occur, in (UTC) e.g., wed:04:00-wed:04:30
PreferredMaintenanceWindow pulumi.StringPtrInput
// Determines whether a final DB snapshot is created before the DB cluster is deleted. If true is specified, no DB snapshot is created. If false is specified, a DB snapshot is created before the DB cluster is deleted, using the value from `finalSnapshotIdentifier`. Default is `false`.
SkipFinalSnapshot pulumi.BoolPtrInput
// Specifies whether or not to create this cluster from a snapshot. You can use either the name or ARN when specifying a DB cluster snapshot, or the ARN when specifying a DB snapshot. Automated snapshots **should not** be used for this attribute, unless from a different cluster. Automated snapshots are deleted as part of cluster destruction when the resource is replaced.
SnapshotIdentifier pulumi.StringPtrInput
// Specifies whether the DB cluster is encrypted. The default is `false`.
StorageEncrypted pulumi.BoolPtrInput
// The storage type to associate with the DB cluster. Valid values: `standard`, `iopt1`.
StorageType pulumi.StringPtrInput
// A map of tags to assign to the DB cluster. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Tags pulumi.StringMapInput
// List of VPC security groups to associate
// with the Cluster
VpcSecurityGroupIds pulumi.StringArrayInput
}
func (ClusterArgs) ElementType() reflect.Type {
return reflect.TypeOf((*clusterArgs)(nil)).Elem()
}
type ClusterInput interface {
pulumi.Input
ToClusterOutput() ClusterOutput
ToClusterOutputWithContext(ctx context.Context) ClusterOutput
}
func (*Cluster) ElementType() reflect.Type {
return reflect.TypeOf((**Cluster)(nil)).Elem()
}
func (i *Cluster) ToClusterOutput() ClusterOutput {
return i.ToClusterOutputWithContext(context.Background())
}
func (i *Cluster) ToClusterOutputWithContext(ctx context.Context) ClusterOutput {
return pulumi.ToOutputWithContext(ctx, i).(ClusterOutput)
}
// ClusterArrayInput is an input type that accepts ClusterArray and ClusterArrayOutput values.
// You can construct a concrete instance of `ClusterArrayInput` via:
//
// ClusterArray{ ClusterArgs{...} }
type ClusterArrayInput interface {
pulumi.Input
ToClusterArrayOutput() ClusterArrayOutput
ToClusterArrayOutputWithContext(context.Context) ClusterArrayOutput
}
type ClusterArray []ClusterInput
func (ClusterArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Cluster)(nil)).Elem()
}
func (i ClusterArray) ToClusterArrayOutput() ClusterArrayOutput {
return i.ToClusterArrayOutputWithContext(context.Background())
}
func (i ClusterArray) ToClusterArrayOutputWithContext(ctx context.Context) ClusterArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(ClusterArrayOutput)
}
// ClusterMapInput is an input type that accepts ClusterMap and ClusterMapOutput values.
// You can construct a concrete instance of `ClusterMapInput` via:
//
// ClusterMap{ "key": ClusterArgs{...} }
type ClusterMapInput interface {
pulumi.Input
ToClusterMapOutput() ClusterMapOutput
ToClusterMapOutputWithContext(context.Context) ClusterMapOutput
}
type ClusterMap map[string]ClusterInput
func (ClusterMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Cluster)(nil)).Elem()
}
func (i ClusterMap) ToClusterMapOutput() ClusterMapOutput {
return i.ToClusterMapOutputWithContext(context.Background())
}
func (i ClusterMap) ToClusterMapOutputWithContext(ctx context.Context) ClusterMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(ClusterMapOutput)
}
type ClusterOutput struct{ *pulumi.OutputState }
func (ClusterOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Cluster)(nil)).Elem()
}
func (o ClusterOutput) ToClusterOutput() ClusterOutput {
return o
}
func (o ClusterOutput) ToClusterOutputWithContext(ctx context.Context) ClusterOutput {
return o
}
// A value that indicates whether major version upgrades are allowed. Constraints: You must allow major version upgrades when specifying a value for the EngineVersion parameter that is a different major version than the DB cluster's current version.
func (o ClusterOutput) AllowMajorVersionUpgrade() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *Cluster) pulumi.BoolPtrOutput { return v.AllowMajorVersionUpgrade }).(pulumi.BoolPtrOutput)
}
// Specifies whether any cluster modifications
// are applied immediately, or during the next maintenance window. Default is
// `false`.
func (o ClusterOutput) ApplyImmediately() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *Cluster) pulumi.BoolPtrOutput { return v.ApplyImmediately }).(pulumi.BoolPtrOutput)
}
// Amazon Resource Name (ARN) of cluster
func (o ClusterOutput) Arn() pulumi.StringOutput {
return o.ApplyT(func(v *Cluster) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
}
// A list of EC2 Availability Zones that
// instances in the DB cluster can be created in.
func (o ClusterOutput) AvailabilityZones() pulumi.StringArrayOutput {
return o.ApplyT(func(v *Cluster) pulumi.StringArrayOutput { return v.AvailabilityZones }).(pulumi.StringArrayOutput)
}
// The days to retain backups for. Default `1`
func (o ClusterOutput) BackupRetentionPeriod() pulumi.IntPtrOutput {
return o.ApplyT(func(v *Cluster) pulumi.IntPtrOutput { return v.BackupRetentionPeriod }).(pulumi.IntPtrOutput)
}
// The cluster identifier. If omitted, the provider will assign a random, unique identifier.
func (o ClusterOutput) ClusterIdentifier() pulumi.StringOutput {
return o.ApplyT(func(v *Cluster) pulumi.StringOutput { return v.ClusterIdentifier }).(pulumi.StringOutput)
}
// Creates a unique cluster identifier beginning with the specified prefix. Conflicts with `clusterIdentifier`.
func (o ClusterOutput) ClusterIdentifierPrefix() pulumi.StringOutput {
return o.ApplyT(func(v *Cluster) pulumi.StringOutput { return v.ClusterIdentifierPrefix }).(pulumi.StringOutput)
}
// List of DocumentDB Instances that are a part of this cluster
func (o ClusterOutput) ClusterMembers() pulumi.StringArrayOutput {
return o.ApplyT(func(v *Cluster) pulumi.StringArrayOutput { return v.ClusterMembers }).(pulumi.StringArrayOutput)
}
// The DocumentDB Cluster Resource ID
func (o ClusterOutput) ClusterResourceId() pulumi.StringOutput {
return o.ApplyT(func(v *Cluster) pulumi.StringOutput { return v.ClusterResourceId }).(pulumi.StringOutput)
}
// A cluster parameter group to associate with the cluster.
func (o ClusterOutput) DbClusterParameterGroupName() pulumi.StringOutput {
return o.ApplyT(func(v *Cluster) pulumi.StringOutput { return v.DbClusterParameterGroupName }).(pulumi.StringOutput)
}
// A DB subnet group to associate with this DB instance.
func (o ClusterOutput) DbSubnetGroupName() pulumi.StringOutput {
return o.ApplyT(func(v *Cluster) pulumi.StringOutput { return v.DbSubnetGroupName }).(pulumi.StringOutput)
}
// A value that indicates whether the DB cluster has deletion protection enabled. The database can't be deleted when deletion protection is enabled. By default, deletion protection is disabled.
func (o ClusterOutput) DeletionProtection() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *Cluster) pulumi.BoolPtrOutput { return v.DeletionProtection }).(pulumi.BoolPtrOutput)
}
// List of log types to export to cloudwatch. If omitted, no logs will be exported.
// The following log types are supported: `audit`, `profiler`.
func (o ClusterOutput) EnabledCloudwatchLogsExports() pulumi.StringArrayOutput {
return o.ApplyT(func(v *Cluster) pulumi.StringArrayOutput { return v.EnabledCloudwatchLogsExports }).(pulumi.StringArrayOutput)
}
// The DNS address of the DocumentDB instance
func (o ClusterOutput) Endpoint() pulumi.StringOutput {
return o.ApplyT(func(v *Cluster) pulumi.StringOutput { return v.Endpoint }).(pulumi.StringOutput)
}
// The name of the database engine to be used for this DB cluster. Defaults to `docdb`. Valid values: `docdb`.
func (o ClusterOutput) Engine() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Cluster) pulumi.StringPtrOutput { return v.Engine }).(pulumi.StringPtrOutput)
}
// The database engine version. Updating this argument results in an outage.
func (o ClusterOutput) EngineVersion() pulumi.StringOutput {
return o.ApplyT(func(v *Cluster) pulumi.StringOutput { return v.EngineVersion }).(pulumi.StringOutput)
}
// The name of your final DB snapshot
// when this DB cluster is deleted. If omitted, no final snapshot will be
// made.
func (o ClusterOutput) FinalSnapshotIdentifier() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Cluster) pulumi.StringPtrOutput { return v.FinalSnapshotIdentifier }).(pulumi.StringPtrOutput)
}
// The global cluster identifier specified on `docdb.GlobalCluster`.
func (o ClusterOutput) GlobalClusterIdentifier() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Cluster) pulumi.StringPtrOutput { return v.GlobalClusterIdentifier }).(pulumi.StringPtrOutput)
}
// The Route53 Hosted Zone ID of the endpoint
func (o ClusterOutput) HostedZoneId() pulumi.StringOutput {
return o.ApplyT(func(v *Cluster) pulumi.StringOutput { return v.HostedZoneId }).(pulumi.StringOutput)
}
// The ARN for the KMS encryption key. When specifying `kmsKeyId`, `storageEncrypted` needs to be set to true.
func (o ClusterOutput) KmsKeyId() pulumi.StringOutput {
return o.ApplyT(func(v *Cluster) pulumi.StringOutput { return v.KmsKeyId }).(pulumi.StringOutput)
}
// Password for the master DB user. Note that this may
// show up in logs, and it will be stored in the state file. Please refer to the DocumentDB Naming Constraints.
func (o ClusterOutput) MasterPassword() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Cluster) pulumi.StringPtrOutput { return v.MasterPassword }).(pulumi.StringPtrOutput)
}
// Username for the master DB user.
func (o ClusterOutput) MasterUsername() pulumi.StringOutput {
return o.ApplyT(func(v *Cluster) pulumi.StringOutput { return v.MasterUsername }).(pulumi.StringOutput)
}
// The port on which the DB accepts connections
func (o ClusterOutput) Port() pulumi.IntPtrOutput {
return o.ApplyT(func(v *Cluster) pulumi.IntPtrOutput { return v.Port }).(pulumi.IntPtrOutput)
}
// The daily time range during which automated backups are created if automated backups are enabled using the BackupRetentionPeriod parameter.Time in UTC
// Default: A 30-minute window selected at random from an 8-hour block of time per regionE.g., 04:00-09:00
func (o ClusterOutput) PreferredBackupWindow() pulumi.StringOutput {
return o.ApplyT(func(v *Cluster) pulumi.StringOutput { return v.PreferredBackupWindow }).(pulumi.StringOutput)
}
// The weekly time range during which system maintenance can occur, in (UTC) e.g., wed:04:00-wed:04:30
func (o ClusterOutput) PreferredMaintenanceWindow() pulumi.StringOutput {
return o.ApplyT(func(v *Cluster) pulumi.StringOutput { return v.PreferredMaintenanceWindow }).(pulumi.StringOutput)
}
// A read-only endpoint for the DocumentDB cluster, automatically load-balanced across replicas
func (o ClusterOutput) ReaderEndpoint() pulumi.StringOutput {
return o.ApplyT(func(v *Cluster) pulumi.StringOutput { return v.ReaderEndpoint }).(pulumi.StringOutput)
}
// Determines whether a final DB snapshot is created before the DB cluster is deleted. If true is specified, no DB snapshot is created. If false is specified, a DB snapshot is created before the DB cluster is deleted, using the value from `finalSnapshotIdentifier`. Default is `false`.
func (o ClusterOutput) SkipFinalSnapshot() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *Cluster) pulumi.BoolPtrOutput { return v.SkipFinalSnapshot }).(pulumi.BoolPtrOutput)
}
// Specifies whether or not to create this cluster from a snapshot. You can use either the name or ARN when specifying a DB cluster snapshot, or the ARN when specifying a DB snapshot. Automated snapshots **should not** be used for this attribute, unless from a different cluster. Automated snapshots are deleted as part of cluster destruction when the resource is replaced.
func (o ClusterOutput) SnapshotIdentifier() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Cluster) pulumi.StringPtrOutput { return v.SnapshotIdentifier }).(pulumi.StringPtrOutput)
}
// Specifies whether the DB cluster is encrypted. The default is `false`.
func (o ClusterOutput) StorageEncrypted() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *Cluster) pulumi.BoolPtrOutput { return v.StorageEncrypted }).(pulumi.BoolPtrOutput)
}
// The storage type to associate with the DB cluster. Valid values: `standard`, `iopt1`.
func (o ClusterOutput) StorageType() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Cluster) pulumi.StringPtrOutput { return v.StorageType }).(pulumi.StringPtrOutput)
}
// A map of tags to assign to the DB cluster. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
func (o ClusterOutput) Tags() pulumi.StringMapOutput {
return o.ApplyT(func(v *Cluster) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
}
// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
//
// Deprecated: Please use `tags` instead.
func (o ClusterOutput) TagsAll() pulumi.StringMapOutput {
return o.ApplyT(func(v *Cluster) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
}
// List of VPC security groups to associate
// with the Cluster
func (o ClusterOutput) VpcSecurityGroupIds() pulumi.StringArrayOutput {
return o.ApplyT(func(v *Cluster) pulumi.StringArrayOutput { return v.VpcSecurityGroupIds }).(pulumi.StringArrayOutput)
}
type ClusterArrayOutput struct{ *pulumi.OutputState }
func (ClusterArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Cluster)(nil)).Elem()
}
func (o ClusterArrayOutput) ToClusterArrayOutput() ClusterArrayOutput {
return o
}
func (o ClusterArrayOutput) ToClusterArrayOutputWithContext(ctx context.Context) ClusterArrayOutput {
return o
}
func (o ClusterArrayOutput) Index(i pulumi.IntInput) ClusterOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Cluster {
return vs[0].([]*Cluster)[vs[1].(int)]
}).(ClusterOutput)
}
type ClusterMapOutput struct{ *pulumi.OutputState }
func (ClusterMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Cluster)(nil)).Elem()
}
func (o ClusterMapOutput) ToClusterMapOutput() ClusterMapOutput {
return o
}
func (o ClusterMapOutput) ToClusterMapOutputWithContext(ctx context.Context) ClusterMapOutput {
return o
}
func (o ClusterMapOutput) MapIndex(k pulumi.StringInput) ClusterOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Cluster {
return vs[0].(map[string]*Cluster)[vs[1].(string)]
}).(ClusterOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*ClusterInput)(nil)).Elem(), &Cluster{})
pulumi.RegisterInputType(reflect.TypeOf((*ClusterArrayInput)(nil)).Elem(), ClusterArray{})
pulumi.RegisterInputType(reflect.TypeOf((*ClusterMapInput)(nil)).Elem(), ClusterMap{})
pulumi.RegisterOutputType(ClusterOutput{})
pulumi.RegisterOutputType(ClusterArrayOutput{})
pulumi.RegisterOutputType(ClusterMapOutput{})
}