/
cluster.ts
742 lines (732 loc) · 38.7 KB
/
cluster.ts
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
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "../types/input";
import * as outputs from "../types/output";
import * as utilities from "../utilities";
import {EngineMode} from "./engineMode";
import {EngineType} from "./engineType";
/**
* Manages a [RDS Aurora Cluster][2]. To manage cluster instances that inherit configuration from the cluster (when not running the cluster in `serverless` engine mode), see the [`aws.rds.ClusterInstance` resource](https://www.terraform.io/docs/providers/aws/r/rds_cluster_instance.html). To manage non-Aurora databases (e.g. MySQL, PostgreSQL, SQL Server, etc.), see the [`aws.rds.Instance` resource](https://www.terraform.io/docs/providers/aws/r/db_instance.html).
*
* For information on the difference between the available Aurora MySQL engines
* see [Comparison between Aurora MySQL 1 and Aurora MySQL 2](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/AuroraMySQL.Updates.20180206.html)
* in the Amazon RDS User Guide.
*
* Changes to a RDS 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. See the AWS Docs on [RDS Maintenance][4]
* for more information.
*
* > **Note:** All arguments including the username and password will be stored in the raw state as plain-text.
* [Read more about sensitive data in state](https://www.terraform.io/docs/state/sensitive-data.html).
*
* ## Example Usage
*
* ### Aurora MySQL 2.x (MySQL 5.7)
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const defaultCluster = new aws.rds.Cluster("default", {
* availabilityZones: [
* "us-west-2a",
* "us-west-2b",
* "us-west-2c",
* ],
* backupRetentionPeriod: 5,
* clusterIdentifier: "aurora-cluster-demo",
* databaseName: "mydb",
* engine: "aurora-mysql",
* engineVersion: "5.7.mysql_aurora.2.03.2",
* masterPassword: "bar",
* masterUsername: "foo",
* preferredBackupWindow: "07:00-09:00",
* });
* ```
*
* ### Aurora MySQL 1.x (MySQL 5.6)
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const defaultCluster = new aws.rds.Cluster("default", {
* availabilityZones: [
* "us-west-2a",
* "us-west-2b",
* "us-west-2c",
* ],
* backupRetentionPeriod: 5,
* clusterIdentifier: "aurora-cluster-demo",
* databaseName: "mydb",
* masterPassword: "bar",
* masterUsername: "foo",
* preferredBackupWindow: "07:00-09:00",
* });
* ```
*
* ### Aurora with PostgreSQL engine
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const postgresql = new aws.rds.Cluster("postgresql", {
* availabilityZones: [
* "us-west-2a",
* "us-west-2b",
* "us-west-2c",
* ],
* backupRetentionPeriod: 5,
* clusterIdentifier: "aurora-cluster-demo",
* databaseName: "mydb",
* engine: "aurora-postgresql",
* masterPassword: "bar",
* masterUsername: "foo",
* preferredBackupWindow: "07:00-09:00",
* });
* ```
*
* ### Aurora Multi-Master Cluster
*
* > More information about Aurora Multi-Master Clusters can be found in the [RDS User Guide](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-multi-master.html).
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.rds.Cluster("example", {
* clusterIdentifier: "example",
* dbSubnetGroupName: aws_db_subnet_group_example.name,
* engineMode: "multimaster",
* masterPassword: "barbarbarbar",
* masterUsername: "foo",
* skipFinalSnapshot: true,
* });
* ```
*
* > This content is derived from https://github.com/terraform-providers/terraform-provider-aws/blob/master/website/docs/r/rds_cluster.html.markdown.
*/
export class Cluster extends pulumi.CustomResource {
/**
* Get an existing Cluster resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
*/
public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: ClusterState, opts?: pulumi.CustomResourceOptions): Cluster {
return new Cluster(name, <any>state, { ...opts, id: id });
}
/** @internal */
public static readonly __pulumiType = 'aws:rds/cluster:Cluster';
/**
* Returns true if the given object is an instance of Cluster. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
public static isInstance(obj: any): obj is Cluster {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === Cluster.__pulumiType;
}
/**
* Specifies whether any cluster modifications
* are applied immediately, or during the next maintenance window. Default is
* `false`. See [Amazon RDS Documentation for more information.](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Overview.DBInstance.Modifying.html)
*/
public readonly applyImmediately!: pulumi.Output<boolean>;
/**
* Amazon Resource Name (ARN) of cluster
*/
public /*out*/ readonly arn!: pulumi.Output<string>;
/**
* A list of EC2 Availability Zones for the DB cluster storage where DB cluster instances can be created. RDS automatically assigns 3 AZs if less than 3 AZs are configured, which will show as a difference requiring resource recreation next deployment. It is recommended to specify 3 AZs or use `ignoreChanges` if necessary.
*/
public readonly availabilityZones!: pulumi.Output<string[]>;
/**
* The target backtrack window, in seconds. Only available for `aurora` engine currently. To disable backtracking, set this value to `0`. Defaults to `0`. Must be between `0` and `259200` (72 hours)
*/
public readonly backtrackWindow!: pulumi.Output<number | undefined>;
/**
* The days to retain backups for. Default `1`
*/
public readonly backupRetentionPeriod!: pulumi.Output<number | undefined>;
/**
* The cluster identifier. If omitted, this provider will assign a random, unique identifier.
*/
public readonly clusterIdentifier!: pulumi.Output<string>;
/**
* Creates a unique cluster identifier beginning with the specified prefix. Conflicts with `clusterIdentifier`.
*/
public readonly clusterIdentifierPrefix!: pulumi.Output<string>;
/**
* List of RDS Instances that are a part of this cluster
*/
public readonly clusterMembers!: pulumi.Output<string[]>;
/**
* The RDS Cluster Resource ID
*/
public /*out*/ readonly clusterResourceId!: pulumi.Output<string>;
/**
* Copy all Cluster `tags` to snapshots. Default is `false`.
*/
public readonly copyTagsToSnapshot!: pulumi.Output<boolean | undefined>;
/**
* Name for an automatically created database on cluster creation. There are different naming restrictions per database engine: [RDS Naming Constraints][5]
*/
public readonly databaseName!: pulumi.Output<string>;
/**
* A cluster parameter group to associate with the cluster.
*/
public readonly dbClusterParameterGroupName!: pulumi.Output<string>;
/**
* A DB subnet group to associate with this DB instance. **NOTE:** This must match the `dbSubnetGroupName` specified on every [`aws.rds.ClusterInstance`](https://www.terraform.io/docs/providers/aws/r/rds_cluster_instance.html) in the cluster.
*/
public readonly dbSubnetGroupName!: pulumi.Output<string>;
/**
* If the DB instance should have deletion protection enabled. The database can't be deleted when this value is set to `true`. The default is `false`.
*/
public readonly deletionProtection!: pulumi.Output<boolean | undefined>;
/**
* List of log types to export to cloudwatch. If omitted, no logs will be exported.
* The following log types are supported: `audit`, `error`, `general`, `slowquery`, `postgresql` (PostgreSQL).
*/
public readonly enabledCloudwatchLogsExports!: pulumi.Output<string[] | undefined>;
/**
* The DNS address of the RDS instance
*/
public /*out*/ readonly endpoint!: pulumi.Output<string>;
/**
* The name of the database engine to be used for this DB cluster. Defaults to `aurora`. Valid Values: `aurora`, `aurora-mysql`, `aurora-postgresql`
*/
public readonly engine!: pulumi.Output<EngineType | undefined>;
/**
* The database engine mode. Valid values: `global`, `multimaster`, `parallelquery`, `provisioned`, `serverless`. Defaults to: `provisioned`. See the [RDS User Guide](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/aurora-serverless.html) for limitations when using `serverless`.
*/
public readonly engineMode!: pulumi.Output<EngineMode | undefined>;
/**
* The database engine version. Updating this argument results in an outage. See the [Aurora MySQL](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/AuroraMySQL.Updates.html) and [Aurora Postgres](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/AuroraPostgreSQL.Updates.html) documentation for your configured engine to determine this value. For example with Aurora MySQL 2, a potential value for this argument is `5.7.mysql_aurora.2.03.2`.
*/
public readonly engineVersion!: pulumi.Output<string>;
/**
* The name of your final DB snapshot
* when this DB cluster is deleted. If omitted, no final snapshot will be
* made.
*/
public readonly finalSnapshotIdentifier!: pulumi.Output<string | undefined>;
/**
* The global cluster identifier specified on [`aws.rds.GlobalCluster`](https://www.terraform.io/docs/providers/aws/r/rds_global_cluster.html).
*/
public readonly globalClusterIdentifier!: pulumi.Output<string | undefined>;
/**
* The Route53 Hosted Zone ID of the endpoint
*/
public /*out*/ readonly hostedZoneId!: pulumi.Output<string>;
/**
* Specifies whether or mappings of AWS Identity and Access Management (IAM) accounts to database accounts is enabled. Please see [AWS Documentation](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/UsingWithRDS.IAMDBAuth.html) for availability and limitations.
*/
public readonly iamDatabaseAuthenticationEnabled!: pulumi.Output<boolean | undefined>;
/**
* A List of ARNs for the IAM roles to associate to the RDS Cluster.
*/
public readonly iamRoles!: pulumi.Output<string[] | undefined>;
/**
* The ARN for the KMS encryption key. When specifying `kmsKeyId`, `storageEncrypted` needs to be set to true.
*/
public readonly kmsKeyId!: pulumi.Output<string>;
/**
* 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 [RDS Naming Constraints][5]
*/
public readonly masterPassword!: pulumi.Output<string | undefined>;
/**
* Username for the master DB user. Please refer to the [RDS Naming Constraints][5]. This argument does not support in-place updates and cannot be changed during a restore from snapshot.
*/
public readonly masterUsername!: pulumi.Output<string>;
/**
* The port on which the DB accepts connections
*/
public readonly port!: pulumi.Output<number>;
/**
* 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 region. e.g. 04:00-09:00
*/
public readonly preferredBackupWindow!: pulumi.Output<string>;
/**
* The weekly time range during which system maintenance can occur, in (UTC) e.g. wed:04:00-wed:04:30
*/
public readonly preferredMaintenanceWindow!: pulumi.Output<string>;
/**
* A read-only endpoint for the Aurora cluster, automatically
* load-balanced across replicas
*/
public /*out*/ readonly readerEndpoint!: pulumi.Output<string>;
/**
* ARN of a source DB cluster or DB instance if this DB cluster is to be created as a Read Replica.
*/
public readonly replicationSourceIdentifier!: pulumi.Output<string | undefined>;
public readonly s3Import!: pulumi.Output<outputs.rds.ClusterS3Import | undefined>;
/**
* Nested attribute with scaling properties. Only valid when `engineMode` is set to `serverless`. More details below.
*/
public readonly scalingConfiguration!: pulumi.Output<outputs.rds.ClusterScalingConfiguration | undefined>;
/**
* 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`.
*/
public readonly skipFinalSnapshot!: pulumi.Output<boolean | undefined>;
/**
* 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.
*/
public readonly snapshotIdentifier!: pulumi.Output<string | undefined>;
/**
* The source region for an encrypted replica DB cluster.
*/
public readonly sourceRegion!: pulumi.Output<string | undefined>;
/**
* Specifies whether the DB cluster is encrypted. The default is `false` for `provisioned` `engineMode` and `true` for `serverless` `engineMode`.
*/
public readonly storageEncrypted!: pulumi.Output<boolean | undefined>;
/**
* A mapping of tags to assign to the DB cluster.
*/
public readonly tags!: pulumi.Output<{[key: string]: any} | undefined>;
/**
* List of VPC security groups to associate
* with the Cluster
*/
public readonly vpcSecurityGroupIds!: pulumi.Output<string[]>;
/**
* Create a Cluster resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args?: ClusterArgs, opts?: pulumi.CustomResourceOptions)
constructor(name: string, argsOrState?: ClusterArgs | ClusterState, opts?: pulumi.CustomResourceOptions) {
let inputs: pulumi.Inputs = {};
if (opts && opts.id) {
const state = argsOrState as ClusterState | undefined;
inputs["applyImmediately"] = state ? state.applyImmediately : undefined;
inputs["arn"] = state ? state.arn : undefined;
inputs["availabilityZones"] = state ? state.availabilityZones : undefined;
inputs["backtrackWindow"] = state ? state.backtrackWindow : undefined;
inputs["backupRetentionPeriod"] = state ? state.backupRetentionPeriod : undefined;
inputs["clusterIdentifier"] = state ? state.clusterIdentifier : undefined;
inputs["clusterIdentifierPrefix"] = state ? state.clusterIdentifierPrefix : undefined;
inputs["clusterMembers"] = state ? state.clusterMembers : undefined;
inputs["clusterResourceId"] = state ? state.clusterResourceId : undefined;
inputs["copyTagsToSnapshot"] = state ? state.copyTagsToSnapshot : undefined;
inputs["databaseName"] = state ? state.databaseName : undefined;
inputs["dbClusterParameterGroupName"] = state ? state.dbClusterParameterGroupName : undefined;
inputs["dbSubnetGroupName"] = state ? state.dbSubnetGroupName : undefined;
inputs["deletionProtection"] = state ? state.deletionProtection : undefined;
inputs["enabledCloudwatchLogsExports"] = state ? state.enabledCloudwatchLogsExports : undefined;
inputs["endpoint"] = state ? state.endpoint : undefined;
inputs["engine"] = state ? state.engine : undefined;
inputs["engineMode"] = state ? state.engineMode : undefined;
inputs["engineVersion"] = state ? state.engineVersion : undefined;
inputs["finalSnapshotIdentifier"] = state ? state.finalSnapshotIdentifier : undefined;
inputs["globalClusterIdentifier"] = state ? state.globalClusterIdentifier : undefined;
inputs["hostedZoneId"] = state ? state.hostedZoneId : undefined;
inputs["iamDatabaseAuthenticationEnabled"] = state ? state.iamDatabaseAuthenticationEnabled : undefined;
inputs["iamRoles"] = state ? state.iamRoles : undefined;
inputs["kmsKeyId"] = state ? state.kmsKeyId : undefined;
inputs["masterPassword"] = state ? state.masterPassword : undefined;
inputs["masterUsername"] = state ? state.masterUsername : undefined;
inputs["port"] = state ? state.port : undefined;
inputs["preferredBackupWindow"] = state ? state.preferredBackupWindow : undefined;
inputs["preferredMaintenanceWindow"] = state ? state.preferredMaintenanceWindow : undefined;
inputs["readerEndpoint"] = state ? state.readerEndpoint : undefined;
inputs["replicationSourceIdentifier"] = state ? state.replicationSourceIdentifier : undefined;
inputs["s3Import"] = state ? state.s3Import : undefined;
inputs["scalingConfiguration"] = state ? state.scalingConfiguration : undefined;
inputs["skipFinalSnapshot"] = state ? state.skipFinalSnapshot : undefined;
inputs["snapshotIdentifier"] = state ? state.snapshotIdentifier : undefined;
inputs["sourceRegion"] = state ? state.sourceRegion : undefined;
inputs["storageEncrypted"] = state ? state.storageEncrypted : undefined;
inputs["tags"] = state ? state.tags : undefined;
inputs["vpcSecurityGroupIds"] = state ? state.vpcSecurityGroupIds : undefined;
} else {
const args = argsOrState as ClusterArgs | undefined;
inputs["applyImmediately"] = args ? args.applyImmediately : undefined;
inputs["availabilityZones"] = args ? args.availabilityZones : undefined;
inputs["backtrackWindow"] = args ? args.backtrackWindow : undefined;
inputs["backupRetentionPeriod"] = args ? args.backupRetentionPeriod : undefined;
inputs["clusterIdentifier"] = args ? args.clusterIdentifier : undefined;
inputs["clusterIdentifierPrefix"] = args ? args.clusterIdentifierPrefix : undefined;
inputs["clusterMembers"] = args ? args.clusterMembers : undefined;
inputs["copyTagsToSnapshot"] = args ? args.copyTagsToSnapshot : undefined;
inputs["databaseName"] = args ? args.databaseName : undefined;
inputs["dbClusterParameterGroupName"] = args ? args.dbClusterParameterGroupName : undefined;
inputs["dbSubnetGroupName"] = args ? args.dbSubnetGroupName : undefined;
inputs["deletionProtection"] = args ? args.deletionProtection : undefined;
inputs["enabledCloudwatchLogsExports"] = args ? args.enabledCloudwatchLogsExports : undefined;
inputs["engine"] = args ? args.engine : undefined;
inputs["engineMode"] = args ? args.engineMode : undefined;
inputs["engineVersion"] = args ? args.engineVersion : undefined;
inputs["finalSnapshotIdentifier"] = args ? args.finalSnapshotIdentifier : undefined;
inputs["globalClusterIdentifier"] = args ? args.globalClusterIdentifier : undefined;
inputs["iamDatabaseAuthenticationEnabled"] = args ? args.iamDatabaseAuthenticationEnabled : undefined;
inputs["iamRoles"] = args ? args.iamRoles : undefined;
inputs["kmsKeyId"] = args ? args.kmsKeyId : undefined;
inputs["masterPassword"] = args ? args.masterPassword : undefined;
inputs["masterUsername"] = args ? args.masterUsername : undefined;
inputs["port"] = args ? args.port : undefined;
inputs["preferredBackupWindow"] = args ? args.preferredBackupWindow : undefined;
inputs["preferredMaintenanceWindow"] = args ? args.preferredMaintenanceWindow : undefined;
inputs["replicationSourceIdentifier"] = args ? args.replicationSourceIdentifier : undefined;
inputs["s3Import"] = args ? args.s3Import : undefined;
inputs["scalingConfiguration"] = args ? args.scalingConfiguration : undefined;
inputs["skipFinalSnapshot"] = args ? args.skipFinalSnapshot : undefined;
inputs["snapshotIdentifier"] = args ? args.snapshotIdentifier : undefined;
inputs["sourceRegion"] = args ? args.sourceRegion : undefined;
inputs["storageEncrypted"] = args ? args.storageEncrypted : undefined;
inputs["tags"] = args ? args.tags : undefined;
inputs["vpcSecurityGroupIds"] = args ? args.vpcSecurityGroupIds : undefined;
inputs["arn"] = undefined /*out*/;
inputs["clusterResourceId"] = undefined /*out*/;
inputs["endpoint"] = undefined /*out*/;
inputs["hostedZoneId"] = undefined /*out*/;
inputs["readerEndpoint"] = undefined /*out*/;
}
if (!opts) {
opts = {}
}
if (!opts.version) {
opts.version = utilities.getVersion();
}
super(Cluster.__pulumiType, name, inputs, opts);
}
}
/**
* Input properties used for looking up and filtering Cluster resources.
*/
export interface ClusterState {
/**
* Specifies whether any cluster modifications
* are applied immediately, or during the next maintenance window. Default is
* `false`. See [Amazon RDS Documentation for more information.](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Overview.DBInstance.Modifying.html)
*/
readonly applyImmediately?: pulumi.Input<boolean>;
/**
* Amazon Resource Name (ARN) of cluster
*/
readonly arn?: pulumi.Input<string>;
/**
* A list of EC2 Availability Zones for the DB cluster storage where DB cluster instances can be created. RDS automatically assigns 3 AZs if less than 3 AZs are configured, which will show as a difference requiring resource recreation next deployment. It is recommended to specify 3 AZs or use `ignoreChanges` if necessary.
*/
readonly availabilityZones?: pulumi.Input<pulumi.Input<string>[]>;
/**
* The target backtrack window, in seconds. Only available for `aurora` engine currently. To disable backtracking, set this value to `0`. Defaults to `0`. Must be between `0` and `259200` (72 hours)
*/
readonly backtrackWindow?: pulumi.Input<number>;
/**
* The days to retain backups for. Default `1`
*/
readonly backupRetentionPeriod?: pulumi.Input<number>;
/**
* The cluster identifier. If omitted, this provider will assign a random, unique identifier.
*/
readonly clusterIdentifier?: pulumi.Input<string>;
/**
* Creates a unique cluster identifier beginning with the specified prefix. Conflicts with `clusterIdentifier`.
*/
readonly clusterIdentifierPrefix?: pulumi.Input<string>;
/**
* List of RDS Instances that are a part of this cluster
*/
readonly clusterMembers?: pulumi.Input<pulumi.Input<string>[]>;
/**
* The RDS Cluster Resource ID
*/
readonly clusterResourceId?: pulumi.Input<string>;
/**
* Copy all Cluster `tags` to snapshots. Default is `false`.
*/
readonly copyTagsToSnapshot?: pulumi.Input<boolean>;
/**
* Name for an automatically created database on cluster creation. There are different naming restrictions per database engine: [RDS Naming Constraints][5]
*/
readonly databaseName?: pulumi.Input<string>;
/**
* A cluster parameter group to associate with the cluster.
*/
readonly dbClusterParameterGroupName?: pulumi.Input<string>;
/**
* A DB subnet group to associate with this DB instance. **NOTE:** This must match the `dbSubnetGroupName` specified on every [`aws.rds.ClusterInstance`](https://www.terraform.io/docs/providers/aws/r/rds_cluster_instance.html) in the cluster.
*/
readonly dbSubnetGroupName?: pulumi.Input<string>;
/**
* If the DB instance should have deletion protection enabled. The database can't be deleted when this value is set to `true`. The default is `false`.
*/
readonly deletionProtection?: pulumi.Input<boolean>;
/**
* List of log types to export to cloudwatch. If omitted, no logs will be exported.
* The following log types are supported: `audit`, `error`, `general`, `slowquery`, `postgresql` (PostgreSQL).
*/
readonly enabledCloudwatchLogsExports?: pulumi.Input<pulumi.Input<string>[]>;
/**
* The DNS address of the RDS instance
*/
readonly endpoint?: pulumi.Input<string>;
/**
* The name of the database engine to be used for this DB cluster. Defaults to `aurora`. Valid Values: `aurora`, `aurora-mysql`, `aurora-postgresql`
*/
readonly engine?: pulumi.Input<EngineType>;
/**
* The database engine mode. Valid values: `global`, `multimaster`, `parallelquery`, `provisioned`, `serverless`. Defaults to: `provisioned`. See the [RDS User Guide](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/aurora-serverless.html) for limitations when using `serverless`.
*/
readonly engineMode?: pulumi.Input<EngineMode>;
/**
* The database engine version. Updating this argument results in an outage. See the [Aurora MySQL](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/AuroraMySQL.Updates.html) and [Aurora Postgres](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/AuroraPostgreSQL.Updates.html) documentation for your configured engine to determine this value. For example with Aurora MySQL 2, a potential value for this argument is `5.7.mysql_aurora.2.03.2`.
*/
readonly engineVersion?: pulumi.Input<string>;
/**
* The name of your final DB snapshot
* when this DB cluster is deleted. If omitted, no final snapshot will be
* made.
*/
readonly finalSnapshotIdentifier?: pulumi.Input<string>;
/**
* The global cluster identifier specified on [`aws.rds.GlobalCluster`](https://www.terraform.io/docs/providers/aws/r/rds_global_cluster.html).
*/
readonly globalClusterIdentifier?: pulumi.Input<string>;
/**
* The Route53 Hosted Zone ID of the endpoint
*/
readonly hostedZoneId?: pulumi.Input<string>;
/**
* Specifies whether or mappings of AWS Identity and Access Management (IAM) accounts to database accounts is enabled. Please see [AWS Documentation](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/UsingWithRDS.IAMDBAuth.html) for availability and limitations.
*/
readonly iamDatabaseAuthenticationEnabled?: pulumi.Input<boolean>;
/**
* A List of ARNs for the IAM roles to associate to the RDS Cluster.
*/
readonly iamRoles?: pulumi.Input<pulumi.Input<string>[]>;
/**
* The ARN for the KMS encryption key. When specifying `kmsKeyId`, `storageEncrypted` needs to be set to true.
*/
readonly kmsKeyId?: pulumi.Input<string>;
/**
* 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 [RDS Naming Constraints][5]
*/
readonly masterPassword?: pulumi.Input<string>;
/**
* Username for the master DB user. Please refer to the [RDS Naming Constraints][5]. This argument does not support in-place updates and cannot be changed during a restore from snapshot.
*/
readonly masterUsername?: pulumi.Input<string>;
/**
* The port on which the DB accepts connections
*/
readonly port?: pulumi.Input<number>;
/**
* 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 region. e.g. 04:00-09:00
*/
readonly preferredBackupWindow?: pulumi.Input<string>;
/**
* The weekly time range during which system maintenance can occur, in (UTC) e.g. wed:04:00-wed:04:30
*/
readonly preferredMaintenanceWindow?: pulumi.Input<string>;
/**
* A read-only endpoint for the Aurora cluster, automatically
* load-balanced across replicas
*/
readonly readerEndpoint?: pulumi.Input<string>;
/**
* ARN of a source DB cluster or DB instance if this DB cluster is to be created as a Read Replica.
*/
readonly replicationSourceIdentifier?: pulumi.Input<string>;
readonly s3Import?: pulumi.Input<inputs.rds.ClusterS3Import>;
/**
* Nested attribute with scaling properties. Only valid when `engineMode` is set to `serverless`. More details below.
*/
readonly scalingConfiguration?: pulumi.Input<inputs.rds.ClusterScalingConfiguration>;
/**
* 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`.
*/
readonly skipFinalSnapshot?: pulumi.Input<boolean>;
/**
* 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.
*/
readonly snapshotIdentifier?: pulumi.Input<string>;
/**
* The source region for an encrypted replica DB cluster.
*/
readonly sourceRegion?: pulumi.Input<string>;
/**
* Specifies whether the DB cluster is encrypted. The default is `false` for `provisioned` `engineMode` and `true` for `serverless` `engineMode`.
*/
readonly storageEncrypted?: pulumi.Input<boolean>;
/**
* A mapping of tags to assign to the DB cluster.
*/
readonly tags?: pulumi.Input<{[key: string]: any}>;
/**
* List of VPC security groups to associate
* with the Cluster
*/
readonly vpcSecurityGroupIds?: pulumi.Input<pulumi.Input<string>[]>;
}
/**
* The set of arguments for constructing a Cluster resource.
*/
export interface ClusterArgs {
/**
* Specifies whether any cluster modifications
* are applied immediately, or during the next maintenance window. Default is
* `false`. See [Amazon RDS Documentation for more information.](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Overview.DBInstance.Modifying.html)
*/
readonly applyImmediately?: pulumi.Input<boolean>;
/**
* A list of EC2 Availability Zones for the DB cluster storage where DB cluster instances can be created. RDS automatically assigns 3 AZs if less than 3 AZs are configured, which will show as a difference requiring resource recreation next deployment. It is recommended to specify 3 AZs or use `ignoreChanges` if necessary.
*/
readonly availabilityZones?: pulumi.Input<pulumi.Input<string>[]>;
/**
* The target backtrack window, in seconds. Only available for `aurora` engine currently. To disable backtracking, set this value to `0`. Defaults to `0`. Must be between `0` and `259200` (72 hours)
*/
readonly backtrackWindow?: pulumi.Input<number>;
/**
* The days to retain backups for. Default `1`
*/
readonly backupRetentionPeriod?: pulumi.Input<number>;
/**
* The cluster identifier. If omitted, this provider will assign a random, unique identifier.
*/
readonly clusterIdentifier?: pulumi.Input<string>;
/**
* Creates a unique cluster identifier beginning with the specified prefix. Conflicts with `clusterIdentifier`.
*/
readonly clusterIdentifierPrefix?: pulumi.Input<string>;
/**
* List of RDS Instances that are a part of this cluster
*/
readonly clusterMembers?: pulumi.Input<pulumi.Input<string>[]>;
/**
* Copy all Cluster `tags` to snapshots. Default is `false`.
*/
readonly copyTagsToSnapshot?: pulumi.Input<boolean>;
/**
* Name for an automatically created database on cluster creation. There are different naming restrictions per database engine: [RDS Naming Constraints][5]
*/
readonly databaseName?: pulumi.Input<string>;
/**
* A cluster parameter group to associate with the cluster.
*/
readonly dbClusterParameterGroupName?: pulumi.Input<string>;
/**
* A DB subnet group to associate with this DB instance. **NOTE:** This must match the `dbSubnetGroupName` specified on every [`aws.rds.ClusterInstance`](https://www.terraform.io/docs/providers/aws/r/rds_cluster_instance.html) in the cluster.
*/
readonly dbSubnetGroupName?: pulumi.Input<string>;
/**
* If the DB instance should have deletion protection enabled. The database can't be deleted when this value is set to `true`. The default is `false`.
*/
readonly deletionProtection?: pulumi.Input<boolean>;
/**
* List of log types to export to cloudwatch. If omitted, no logs will be exported.
* The following log types are supported: `audit`, `error`, `general`, `slowquery`, `postgresql` (PostgreSQL).
*/
readonly enabledCloudwatchLogsExports?: pulumi.Input<pulumi.Input<string>[]>;
/**
* The name of the database engine to be used for this DB cluster. Defaults to `aurora`. Valid Values: `aurora`, `aurora-mysql`, `aurora-postgresql`
*/
readonly engine?: pulumi.Input<EngineType>;
/**
* The database engine mode. Valid values: `global`, `multimaster`, `parallelquery`, `provisioned`, `serverless`. Defaults to: `provisioned`. See the [RDS User Guide](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/aurora-serverless.html) for limitations when using `serverless`.
*/
readonly engineMode?: pulumi.Input<EngineMode>;
/**
* The database engine version. Updating this argument results in an outage. See the [Aurora MySQL](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/AuroraMySQL.Updates.html) and [Aurora Postgres](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/AuroraPostgreSQL.Updates.html) documentation for your configured engine to determine this value. For example with Aurora MySQL 2, a potential value for this argument is `5.7.mysql_aurora.2.03.2`.
*/
readonly engineVersion?: pulumi.Input<string>;
/**
* The name of your final DB snapshot
* when this DB cluster is deleted. If omitted, no final snapshot will be
* made.
*/
readonly finalSnapshotIdentifier?: pulumi.Input<string>;
/**
* The global cluster identifier specified on [`aws.rds.GlobalCluster`](https://www.terraform.io/docs/providers/aws/r/rds_global_cluster.html).
*/
readonly globalClusterIdentifier?: pulumi.Input<string>;
/**
* Specifies whether or mappings of AWS Identity and Access Management (IAM) accounts to database accounts is enabled. Please see [AWS Documentation](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/UsingWithRDS.IAMDBAuth.html) for availability and limitations.
*/
readonly iamDatabaseAuthenticationEnabled?: pulumi.Input<boolean>;
/**
* A List of ARNs for the IAM roles to associate to the RDS Cluster.
*/
readonly iamRoles?: pulumi.Input<pulumi.Input<string>[]>;
/**
* The ARN for the KMS encryption key. When specifying `kmsKeyId`, `storageEncrypted` needs to be set to true.
*/
readonly kmsKeyId?: pulumi.Input<string>;
/**
* 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 [RDS Naming Constraints][5]
*/
readonly masterPassword?: pulumi.Input<string>;
/**
* Username for the master DB user. Please refer to the [RDS Naming Constraints][5]. This argument does not support in-place updates and cannot be changed during a restore from snapshot.
*/
readonly masterUsername?: pulumi.Input<string>;
/**
* The port on which the DB accepts connections
*/
readonly port?: pulumi.Input<number>;
/**
* 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 region. e.g. 04:00-09:00
*/
readonly preferredBackupWindow?: pulumi.Input<string>;
/**
* The weekly time range during which system maintenance can occur, in (UTC) e.g. wed:04:00-wed:04:30
*/
readonly preferredMaintenanceWindow?: pulumi.Input<string>;
/**
* ARN of a source DB cluster or DB instance if this DB cluster is to be created as a Read Replica.
*/
readonly replicationSourceIdentifier?: pulumi.Input<string>;
readonly s3Import?: pulumi.Input<inputs.rds.ClusterS3Import>;
/**
* Nested attribute with scaling properties. Only valid when `engineMode` is set to `serverless`. More details below.
*/
readonly scalingConfiguration?: pulumi.Input<inputs.rds.ClusterScalingConfiguration>;
/**
* 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`.
*/
readonly skipFinalSnapshot?: pulumi.Input<boolean>;
/**
* 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.
*/
readonly snapshotIdentifier?: pulumi.Input<string>;
/**
* The source region for an encrypted replica DB cluster.
*/
readonly sourceRegion?: pulumi.Input<string>;
/**
* Specifies whether the DB cluster is encrypted. The default is `false` for `provisioned` `engineMode` and `true` for `serverless` `engineMode`.
*/
readonly storageEncrypted?: pulumi.Input<boolean>;
/**
* A mapping of tags to assign to the DB cluster.
*/
readonly tags?: pulumi.Input<{[key: string]: any}>;
/**
* List of VPC security groups to associate
* with the Cluster
*/
readonly vpcSecurityGroupIds?: pulumi.Input<pulumi.Input<string>[]>;
}