@aws-cdk/aws-redshift-alpha 2.0.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/.jsii +6985 -0
  2. package/LICENSE +201 -0
  3. package/NOTICE +2 -0
  4. package/README.md +247 -0
  5. package/lib/cluster.d.ts +454 -0
  6. package/lib/cluster.js +231 -0
  7. package/lib/database-options.d.ts +30 -0
  8. package/lib/database-options.js +3 -0
  9. package/lib/database-secret.d.ts +35 -0
  10. package/lib/database-secret.js +32 -0
  11. package/lib/endpoint.d.ts +31 -0
  12. package/lib/endpoint.js +28 -0
  13. package/lib/index.d.ts +8 -0
  14. package/lib/index.js +22 -0
  15. package/lib/parameter-group.d.ts +72 -0
  16. package/lib/parameter-group.js +52 -0
  17. package/lib/private/database-query-provider/handler-name.d.ts +5 -0
  18. package/lib/private/database-query-provider/handler-name.js +10 -0
  19. package/lib/private/database-query-provider/index.d.ts +2 -0
  20. package/lib/private/database-query-provider/index.js +21 -0
  21. package/lib/private/database-query-provider/privileges.d.ts +6 -0
  22. package/lib/private/database-query-provider/privileges.js +57 -0
  23. package/lib/private/database-query-provider/table.d.ts +6 -0
  24. package/lib/private/database-query-provider/table.js +56 -0
  25. package/lib/private/database-query-provider/user.d.ts +9 -0
  26. package/lib/private/database-query-provider/user.js +69 -0
  27. package/lib/private/database-query-provider/util.d.ts +4 -0
  28. package/lib/private/database-query-provider/util.js +41 -0
  29. package/lib/private/database-query.d.ts +24 -0
  30. package/lib/private/database-query.js +78 -0
  31. package/lib/private/handler-props.d.ts +26 -0
  32. package/lib/private/handler-props.js +3 -0
  33. package/lib/private/privileges.d.ts +48 -0
  34. package/lib/private/privileges.js +64 -0
  35. package/lib/redshift-canned-metrics.generated.d.ts +192 -0
  36. package/lib/redshift-canned-metrics.generated.js +161 -0
  37. package/lib/subnet-group.d.ts +74 -0
  38. package/lib/subnet-group.js +49 -0
  39. package/lib/table.d.ts +241 -0
  40. package/lib/table.js +104 -0
  41. package/lib/user.d.ts +174 -0
  42. package/lib/user.js +102 -0
  43. package/package.json +124 -0
  44. package/rosetta/cluster.ts-fixture +21 -0
  45. package/rosetta/default.ts-fixture +12 -0
@@ -0,0 +1,454 @@
1
+ import * as ec2 from 'aws-cdk-lib/aws-ec2';
2
+ import * as iam from 'aws-cdk-lib/aws-iam';
3
+ import * as kms from 'aws-cdk-lib/aws-kms';
4
+ import * as s3 from 'aws-cdk-lib/aws-s3';
5
+ import * as secretsmanager from 'aws-cdk-lib/aws-secretsmanager';
6
+ import { Duration, IResource, RemovalPolicy, Resource, SecretValue } from 'aws-cdk-lib';
7
+ import { Construct } from 'constructs';
8
+ import { Endpoint } from './endpoint';
9
+ import { IClusterParameterGroup } from './parameter-group';
10
+ import { IClusterSubnetGroup } from './subnet-group';
11
+ /**
12
+ * (experimental) Possible Node Types to use in the cluster used for defining {@link ClusterProps.nodeType}.
13
+ *
14
+ * @experimental
15
+ */
16
+ export declare enum NodeType {
17
+ /**
18
+ * (experimental) ds2.xlarge.
19
+ *
20
+ * @experimental
21
+ */
22
+ DS2_XLARGE = "ds2.xlarge",
23
+ /**
24
+ * (experimental) ds2.8xlarge.
25
+ *
26
+ * @experimental
27
+ */
28
+ DS2_8XLARGE = "ds2.8xlarge",
29
+ /**
30
+ * (experimental) dc1.large.
31
+ *
32
+ * @experimental
33
+ */
34
+ DC1_LARGE = "dc1.large",
35
+ /**
36
+ * (experimental) dc1.8xlarge.
37
+ *
38
+ * @experimental
39
+ */
40
+ DC1_8XLARGE = "dc1.8xlarge",
41
+ /**
42
+ * (experimental) dc2.large.
43
+ *
44
+ * @experimental
45
+ */
46
+ DC2_LARGE = "dc2.large",
47
+ /**
48
+ * (experimental) dc2.8xlarge.
49
+ *
50
+ * @experimental
51
+ */
52
+ DC2_8XLARGE = "dc2.8xlarge",
53
+ /**
54
+ * (experimental) ra3.xlplus.
55
+ *
56
+ * @experimental
57
+ */
58
+ RA3_XLPLUS = "ra3.xlplus",
59
+ /**
60
+ * (experimental) ra3.4xlarge.
61
+ *
62
+ * @experimental
63
+ */
64
+ RA3_4XLARGE = "ra3.4xlarge",
65
+ /**
66
+ * (experimental) ra3.16xlarge.
67
+ *
68
+ * @experimental
69
+ */
70
+ RA3_16XLARGE = "ra3.16xlarge"
71
+ }
72
+ /**
73
+ * (experimental) What cluster type to use.
74
+ *
75
+ * Used by {@link ClusterProps.clusterType}
76
+ *
77
+ * @experimental
78
+ */
79
+ export declare enum ClusterType {
80
+ /**
81
+ * (experimental) single-node cluster, the {@link ClusterProps.numberOfNodes} parameter is not required.
82
+ *
83
+ * @experimental
84
+ */
85
+ SINGLE_NODE = "single-node",
86
+ /**
87
+ * (experimental) multi-node cluster, set the amount of nodes using {@link ClusterProps.numberOfNodes} parameter.
88
+ *
89
+ * @experimental
90
+ */
91
+ MULTI_NODE = "multi-node"
92
+ }
93
+ /**
94
+ * (experimental) Username and password combination.
95
+ *
96
+ * @experimental
97
+ */
98
+ export interface Login {
99
+ /**
100
+ * (experimental) Username.
101
+ *
102
+ * @experimental
103
+ */
104
+ readonly masterUsername: string;
105
+ /**
106
+ * (experimental) Password.
107
+ *
108
+ * Do not put passwords in your CDK code directly.
109
+ *
110
+ * @default a Secrets Manager generated password
111
+ * @experimental
112
+ */
113
+ readonly masterPassword?: SecretValue;
114
+ /**
115
+ * (experimental) KMS encryption key to encrypt the generated secret.
116
+ *
117
+ * @default default master key
118
+ * @experimental
119
+ */
120
+ readonly encryptionKey?: kms.IKey;
121
+ }
122
+ /**
123
+ * (experimental) Options to add the multi user rotation.
124
+ *
125
+ * @experimental
126
+ */
127
+ export interface RotationMultiUserOptions {
128
+ /**
129
+ * (experimental) The secret to rotate.
130
+ *
131
+ * It must be a JSON string with the following format:
132
+ * ```
133
+ * {
134
+ * "engine": <required: database engine>,
135
+ * "host": <required: instance host name>,
136
+ * "username": <required: username>,
137
+ * "password": <required: password>,
138
+ * "dbname": <optional: database name>,
139
+ * "port": <optional: if not specified, default port will be used>,
140
+ * "masterarn": <required: the arn of the master secret which will be used to create users/change passwords>
141
+ * }
142
+ * ```
143
+ *
144
+ * @experimental
145
+ */
146
+ readonly secret: secretsmanager.ISecret;
147
+ /**
148
+ * (experimental) Specifies the number of days after the previous rotation before Secrets Manager triggers the next automatic rotation.
149
+ *
150
+ * @default Duration.days(30)
151
+ * @experimental
152
+ */
153
+ readonly automaticallyAfter?: Duration;
154
+ }
155
+ /**
156
+ * (experimental) Create a Redshift Cluster with a given number of nodes.
157
+ *
158
+ * Implemented by {@link Cluster} via {@link ClusterBase}.
159
+ *
160
+ * @experimental
161
+ */
162
+ export interface ICluster extends IResource, ec2.IConnectable, secretsmanager.ISecretAttachmentTarget {
163
+ /**
164
+ * (experimental) Name of the cluster.
165
+ *
166
+ * @experimental
167
+ * @attribute ClusterName
168
+ */
169
+ readonly clusterName: string;
170
+ /**
171
+ * (experimental) The endpoint to use for read/write operations.
172
+ *
173
+ * @experimental
174
+ * @attribute EndpointAddress,EndpointPort
175
+ */
176
+ readonly clusterEndpoint: Endpoint;
177
+ }
178
+ /**
179
+ * (experimental) Properties that describe an existing cluster instance.
180
+ *
181
+ * @experimental
182
+ */
183
+ export interface ClusterAttributes {
184
+ /**
185
+ * (experimental) The security groups of the redshift cluster.
186
+ *
187
+ * @default no security groups will be attached to the import
188
+ * @experimental
189
+ */
190
+ readonly securityGroups?: ec2.ISecurityGroup[];
191
+ /**
192
+ * (experimental) Identifier for the cluster.
193
+ *
194
+ * @experimental
195
+ */
196
+ readonly clusterName: string;
197
+ /**
198
+ * (experimental) Cluster endpoint address.
199
+ *
200
+ * @experimental
201
+ */
202
+ readonly clusterEndpointAddress: string;
203
+ /**
204
+ * (experimental) Cluster endpoint port.
205
+ *
206
+ * @experimental
207
+ */
208
+ readonly clusterEndpointPort: number;
209
+ }
210
+ /**
211
+ * (experimental) Properties for a new database cluster.
212
+ *
213
+ * @experimental
214
+ */
215
+ export interface ClusterProps {
216
+ /**
217
+ * (experimental) An optional identifier for the cluster.
218
+ *
219
+ * @default - A name is automatically generated.
220
+ * @experimental
221
+ */
222
+ readonly clusterName?: string;
223
+ /**
224
+ * (experimental) Additional parameters to pass to the database engine https://docs.aws.amazon.com/redshift/latest/mgmt/working-with-parameter-groups.html.
225
+ *
226
+ * @default - No parameter group.
227
+ * @experimental
228
+ */
229
+ readonly parameterGroup?: IClusterParameterGroup;
230
+ /**
231
+ * (experimental) Number of compute nodes in the cluster. Only specify this property for multi-node clusters.
232
+ *
233
+ * Value must be at least 2 and no more than 100.
234
+ *
235
+ * @default - 2 if `clusterType` is ClusterType.MULTI_NODE, undefined otherwise
236
+ * @experimental
237
+ */
238
+ readonly numberOfNodes?: number;
239
+ /**
240
+ * (experimental) The node type to be provisioned for the cluster.
241
+ *
242
+ * @default {@link NodeType.DC2_LARGE}
243
+ * @experimental
244
+ */
245
+ readonly nodeType?: NodeType;
246
+ /**
247
+ * (experimental) Settings for the individual instances that are launched.
248
+ *
249
+ * @default {@link ClusterType.MULTI_NODE}
250
+ * @experimental
251
+ */
252
+ readonly clusterType?: ClusterType;
253
+ /**
254
+ * (experimental) What port to listen on.
255
+ *
256
+ * @default - The default for the engine is used.
257
+ * @experimental
258
+ */
259
+ readonly port?: number;
260
+ /**
261
+ * (experimental) Whether to enable encryption of data at rest in the cluster.
262
+ *
263
+ * @default true
264
+ * @experimental
265
+ */
266
+ readonly encrypted?: boolean;
267
+ /**
268
+ * (experimental) The KMS key to use for encryption of data at rest.
269
+ *
270
+ * @default - AWS-managed key, if encryption at rest is enabled
271
+ * @experimental
272
+ */
273
+ readonly encryptionKey?: kms.IKey;
274
+ /**
275
+ * (experimental) A preferred maintenance window day/time range. Should be specified as a range ddd:hh24:mi-ddd:hh24:mi (24H Clock UTC).
276
+ *
277
+ * Example: 'Sun:23:45-Mon:00:15'
278
+ *
279
+ * @default - 30-minute window selected at random from an 8-hour block of time for
280
+ * each AWS Region, occurring on a random day of the week.
281
+ * @see https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_UpgradeDBInstance.Maintenance.html#Concepts.DBMaintenance
282
+ * @experimental
283
+ */
284
+ readonly preferredMaintenanceWindow?: string;
285
+ /**
286
+ * (experimental) The VPC to place the cluster in.
287
+ *
288
+ * @experimental
289
+ */
290
+ readonly vpc: ec2.IVpc;
291
+ /**
292
+ * (experimental) Where to place the instances within the VPC.
293
+ *
294
+ * @default - private subnets
295
+ * @experimental
296
+ */
297
+ readonly vpcSubnets?: ec2.SubnetSelection;
298
+ /**
299
+ * (experimental) Security group.
300
+ *
301
+ * @default - a new security group is created.
302
+ * @experimental
303
+ */
304
+ readonly securityGroups?: ec2.ISecurityGroup[];
305
+ /**
306
+ * (experimental) A cluster subnet group to use with this cluster.
307
+ *
308
+ * @default - a new subnet group will be created.
309
+ * @experimental
310
+ */
311
+ readonly subnetGroup?: IClusterSubnetGroup;
312
+ /**
313
+ * (experimental) Username and password for the administrative user.
314
+ *
315
+ * @experimental
316
+ */
317
+ readonly masterUser: Login;
318
+ /**
319
+ * (experimental) A list of AWS Identity and Access Management (IAM) role that can be used by the cluster to access other AWS services.
320
+ *
321
+ * Specify a maximum of 10 roles.
322
+ *
323
+ * @default - No role is attached to the cluster.
324
+ * @experimental
325
+ */
326
+ readonly roles?: iam.IRole[];
327
+ /**
328
+ * (experimental) Name of a database which is automatically created inside the cluster.
329
+ *
330
+ * @default - default_db
331
+ * @experimental
332
+ */
333
+ readonly defaultDatabaseName?: string;
334
+ /**
335
+ * (experimental) Bucket to send logs to.
336
+ *
337
+ * Logging information includes queries and connection attempts, for the specified Amazon Redshift cluster.
338
+ *
339
+ * @default - No Logs
340
+ * @experimental
341
+ */
342
+ readonly loggingBucket?: s3.IBucket;
343
+ /**
344
+ * (experimental) Prefix used for logging.
345
+ *
346
+ * @default - no prefix
347
+ * @experimental
348
+ */
349
+ readonly loggingKeyPrefix?: string;
350
+ /**
351
+ * (experimental) The removal policy to apply when the cluster and its instances are removed from the stack or replaced during an update.
352
+ *
353
+ * @default RemovalPolicy.RETAIN
354
+ * @experimental
355
+ */
356
+ readonly removalPolicy?: RemovalPolicy;
357
+ /**
358
+ * (experimental) Whether to make cluster publicly accessible.
359
+ *
360
+ * @default false
361
+ * @experimental
362
+ */
363
+ readonly publiclyAccessible?: boolean;
364
+ }
365
+ /**
366
+ * A new or imported clustered database.
367
+ */
368
+ declare abstract class ClusterBase extends Resource implements ICluster {
369
+ /**
370
+ * Name of the cluster
371
+ */
372
+ abstract readonly clusterName: string;
373
+ /**
374
+ * The endpoint to use for read/write operations
375
+ */
376
+ abstract readonly clusterEndpoint: Endpoint;
377
+ /**
378
+ * Access to the network connections
379
+ */
380
+ abstract readonly connections: ec2.Connections;
381
+ /**
382
+ * (experimental) Renders the secret attachment target specifications.
383
+ *
384
+ * @experimental
385
+ */
386
+ asSecretAttachmentTarget(): secretsmanager.SecretAttachmentTargetProps;
387
+ }
388
+ /**
389
+ * (experimental) Create a Redshift cluster a given number of nodes.
390
+ *
391
+ * @experimental
392
+ * @resource AWS::Redshift::Cluster
393
+ */
394
+ export declare class Cluster extends ClusterBase {
395
+ /**
396
+ * (experimental) Import an existing DatabaseCluster from properties.
397
+ *
398
+ * @experimental
399
+ */
400
+ static fromClusterAttributes(scope: Construct, id: string, attrs: ClusterAttributes): ICluster;
401
+ /**
402
+ * (experimental) Identifier of the cluster.
403
+ *
404
+ * @experimental
405
+ */
406
+ readonly clusterName: string;
407
+ /**
408
+ * (experimental) The endpoint to use for read/write operations.
409
+ *
410
+ * @experimental
411
+ */
412
+ readonly clusterEndpoint: Endpoint;
413
+ /**
414
+ * (experimental) Access to the network connections.
415
+ *
416
+ * @experimental
417
+ */
418
+ readonly connections: ec2.Connections;
419
+ /**
420
+ * (experimental) The secret attached to this cluster.
421
+ *
422
+ * @experimental
423
+ */
424
+ readonly secret?: secretsmanager.ISecret;
425
+ private readonly singleUserRotationApplication;
426
+ private readonly multiUserRotationApplication;
427
+ /**
428
+ * The VPC where the DB subnet group is created.
429
+ */
430
+ private readonly vpc;
431
+ /**
432
+ * The subnets used by the DB subnet group.
433
+ */
434
+ private readonly vpcSubnets?;
435
+ /**
436
+ * @experimental
437
+ */
438
+ constructor(scope: Construct, id: string, props: ClusterProps);
439
+ /**
440
+ * (experimental) Adds the single user rotation of the master password to this cluster.
441
+ *
442
+ * @param automaticallyAfter Specifies the number of days after the previous rotation before Secrets Manager triggers the next automatic rotation.
443
+ * @experimental
444
+ */
445
+ addRotationSingleUser(automaticallyAfter?: Duration): secretsmanager.SecretRotation;
446
+ /**
447
+ * (experimental) Adds the multi user rotation to this cluster.
448
+ *
449
+ * @experimental
450
+ */
451
+ addRotationMultiUser(id: string, options: RotationMultiUserOptions): secretsmanager.SecretRotation;
452
+ private validateNodeCount;
453
+ }
454
+ export {};