@aws-cdk/aws-redshift-alpha 2.171.1-alpha.0 → 2.173.0-alpha.0
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.
- package/.jsii +148 -67
- package/.jsii.tabl.json.gz +0 -0
- package/.warnings.jsii.js +5 -1
- package/README.md +43 -0
- package/lib/cluster.d.ts +29 -0
- package/lib/cluster.js +32 -3
- package/lib/database-secret.js +2 -2
- package/lib/endpoint.js +2 -2
- package/lib/parameter-group.js +1 -1
- package/lib/subnet-group.js +1 -1
- package/lib/table.js +1 -1
- package/lib/user.js +1 -1
- package/package.json +8 -8
package/.jsii
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"url": "https://aws.amazon.com"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"aws-cdk-lib": "^2.
|
|
11
|
+
"aws-cdk-lib": "^2.173.0",
|
|
12
12
|
"constructs": "^10.0.0"
|
|
13
13
|
},
|
|
14
14
|
"dependencyClosure": {
|
|
@@ -1852,6 +1852,19 @@
|
|
|
1852
1852
|
}
|
|
1853
1853
|
}
|
|
1854
1854
|
},
|
|
1855
|
+
"aws-cdk-lib.aws_invoicing": {
|
|
1856
|
+
"targets": {
|
|
1857
|
+
"dotnet": {
|
|
1858
|
+
"package": "Amazon.CDK.AWS.Invoicing"
|
|
1859
|
+
},
|
|
1860
|
+
"java": {
|
|
1861
|
+
"package": "software.amazon.awscdk.services.invoicing"
|
|
1862
|
+
},
|
|
1863
|
+
"python": {
|
|
1864
|
+
"module": "aws_cdk.aws_invoicing"
|
|
1865
|
+
}
|
|
1866
|
+
}
|
|
1867
|
+
},
|
|
1855
1868
|
"aws-cdk-lib.aws_iot": {
|
|
1856
1869
|
"targets": {
|
|
1857
1870
|
"dotnet": {
|
|
@@ -3908,7 +3921,7 @@
|
|
|
3908
3921
|
},
|
|
3909
3922
|
"name": "@aws-cdk/aws-redshift-alpha",
|
|
3910
3923
|
"readme": {
|
|
3911
|
-
"markdown": "# Amazon Redshift Construct Library\n<!--BEGIN STABILITY BANNER-->\n\n---\n\n\n\n> The APIs of higher level constructs in this module are experimental and under active development.\n> They are subject to non-backward compatible changes or removal in any future version. These are\n> not subject to the [Semantic Versioning](https://semver.org/) model and breaking changes will be\n> announced in the release notes. This means that while you may use them, you may need to update\n> your source code when upgrading to a newer version of this package.\n\n---\n\n<!--END STABILITY BANNER-->\n\n## Starting a Redshift Cluster Database\n\nTo set up a Redshift cluster, define a `Cluster`. It will be launched in a VPC.\nYou can specify a VPC, otherwise one will be created. The nodes are always launched in private subnets and are encrypted by default.\n\n```ts\nimport * as ec2 from 'aws-cdk-lib/aws-ec2';\n\nconst vpc = new ec2.Vpc(this, 'Vpc');\nconst cluster = new Cluster(this, 'Redshift', {\n masterUser: {\n masterUsername: 'admin',\n },\n vpc\n});\n```\n\nBy default, the master password will be generated and stored in AWS Secrets Manager.\nYou can specify characters to not include in generated passwords by setting `excludeCharacters` property.\n\n```ts\nimport * as ec2 from 'aws-cdk-lib/aws-ec2';\n\nconst vpc = new ec2.Vpc(this, 'Vpc');\nconst cluster = new Cluster(this, 'Redshift', {\n masterUser: {\n masterUsername: 'admin',\n excludeCharacters: '\"@/\\\\\\ \\'`',\n },\n vpc\n});\n```\n\nA default database named `default_db` will be created in the cluster. To change the name of this database set the `defaultDatabaseName` attribute in the constructor properties.\n\nBy default, the cluster will not be publicly accessible.\nDepending on your use case, you can make the cluster publicly accessible with the `publiclyAccessible` property.\n\n## Adding a logging bucket for database audit logging to S3\n\nAmazon Redshift logs information about connections and user activities in your database. These logs help you to monitor the database for security and troubleshooting purposes, a process called database auditing. To send these logs to an S3 bucket, specify the `loggingProperties` when creating a new cluster.\n\n```ts\nimport * as ec2 from 'aws-cdk-lib/aws-ec2';\nimport * as s3 from 'aws-cdk-lib/aws-s3';\n\nconst vpc = new ec2.Vpc(this, 'Vpc');\nconst bucket = s3.Bucket.fromBucketName(this, 'bucket', 'amzn-s3-demo-bucket');\n\nconst cluster = new Cluster(this, 'Redshift', {\n masterUser: {\n masterUsername: 'admin',\n },\n vpc,\n loggingProperties: {\n loggingBucket: bucket,\n loggingKeyPrefix: 'prefix',\n }\n});\n```\n\n## Availability Zone Relocation\n\nBy using [relocation in Amazon Redshift](https://docs.aws.amazon.com/redshift/latest/mgmt/managing-cluster-recovery.html), you allow Amazon Redshift to move a cluster to another Availability Zone (AZ) without any loss of data or changes to your applications.\nThis feature can be applied to both new and existing clusters.\n\nTo enable this feature, set the `availabilityZoneRelocation` property to `true`.\n\n```ts\nimport * as ec2 from 'aws-cdk-lib/aws-ec2';\n\ndeclare const vpc: ec2.IVpc;\n\nconst cluster = new Cluster(this, 'Redshift', {\n masterUser: {\n masterUsername: 'admin',\n },\n vpc,\n nodeType: NodeType.RA3_XLPLUS,\n availabilityZoneRelocation: true,\n});\n```\n\n**Note**: The `availabilityZoneRelocation` property is only available for RA3 node types.\n\n## Connecting\n\nTo control who can access the cluster, use the `.connections` attribute. Redshift Clusters have\na default port, so you don't need to specify the port:\n\n```ts fixture=cluster\ncluster.connections.allowDefaultPortFromAnyIpv4('Open to the world');\n```\n\nThe endpoint to access your database cluster will be available as the `.clusterEndpoint` attribute:\n\n```ts fixture=cluster\ncluster.clusterEndpoint.socketAddress; // \"HOSTNAME:PORT\"\n```\n\n## Database Resources\n\nThis module allows for the creation of non-CloudFormation database resources such as users\nand tables. This allows you to manage identities, permissions, and stateful resources\nwithin your Redshift cluster from your CDK application.\n\nBecause these resources are not available in CloudFormation, this library leverages\n[custom\nresources](https://docs.aws.amazon.com/cdk/api/latest/docs/custom-resources-readme.html)\nto manage them. In addition to the IAM permissions required to make Redshift service\ncalls, the execution role for the custom resource handler requires database credentials to\ncreate resources within the cluster.\n\nThese database credentials can be supplied explicitly through the `adminUser` properties\nof the various database resource constructs. Alternatively, the credentials can be\nautomatically pulled from the Redshift cluster's default administrator\ncredentials. However, this option is only available if the password for the credentials\nwas generated by the CDK application (ie., no value vas provided for [the `masterPassword`\nproperty](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-redshift.Login.html#masterpasswordspan-classapi-icon-api-icon-experimental-titlethis-api-element-is-experimental-it-may-change-without-noticespan)\nof\n[`Cluster.masterUser`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-redshift.Cluster.html#masteruserspan-classapi-icon-api-icon-experimental-titlethis-api-element-is-experimental-it-may-change-without-noticespan)).\n\n### Creating Users\n\nCreate a user within a Redshift cluster database by instantiating a `User` construct. This\nwill generate a username and password, store the credentials in a [AWS Secrets Manager\n`Secret`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-secretsmanager.Secret.html),\nand make a query to the Redshift cluster to create a new database user with the\ncredentials.\n\n```ts fixture=cluster\nnew User(this, 'User', {\n cluster: cluster,\n databaseName: 'databaseName',\n});\n```\n\nBy default, the user credentials are encrypted with your AWS account's default Secrets\nManager encryption key. You can specify the encryption key used for this purpose by\nsupplying a key in the `encryptionKey` property.\n\n```ts fixture=cluster\nimport * as kms from 'aws-cdk-lib/aws-kms';\n\nconst encryptionKey = new kms.Key(this, 'Key');\nnew User(this, 'User', {\n encryptionKey: encryptionKey,\n cluster: cluster,\n databaseName: 'databaseName',\n});\n```\n\nBy default, a username is automatically generated from the user construct ID and its path\nin the construct tree. You can specify a particular username by providing a value for the\n`username` property. Usernames must be valid identifiers; see: [Names and\nidentifiers](https://docs.aws.amazon.com/redshift/latest/dg/r_names.html) in the *Amazon\nRedshift Database Developer Guide*.\n\n```ts fixture=cluster\nnew User(this, 'User', {\n username: 'myuser',\n cluster: cluster,\n databaseName: 'databaseName',\n});\n```\n\nThe user password is generated by AWS Secrets Manager using the default configuration\nfound in\n[`secretsmanager.SecretStringGenerator`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-secretsmanager.SecretStringGenerator.html),\nexcept with password length `30` and some SQL-incompliant characters excluded. The\nplaintext for the password will never be present in the CDK application; instead, a\n[CloudFormation Dynamic\nReference](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/dynamic-references.html)\nwill be used wherever the password value is required.\n\nYou can specify characters to not include in generated passwords by setting `excludeCharacters` property.\n\n```ts fixture=cluster\nnew User(this, 'User', {\n cluster: cluster,\n databaseName: 'databaseName',\n excludeCharacters: '\"@/\\\\\\ \\'`',\n});\n```\n\n### Creating Tables\n\nCreate a table within a Redshift cluster database by instantiating a `Table`\nconstruct. This will make a query to the Redshift cluster to create a new database table\nwith the supplied schema.\n\n```ts fixture=cluster\nnew Table(this, 'Table', {\n tableColumns: [{ name: 'col1', dataType: 'varchar(4)' }, { name: 'col2', dataType: 'float' }],\n cluster: cluster,\n databaseName: 'databaseName',\n});\n```\n\nTables greater than v2.114.1 can have their table name changed, for versions <= v2.114.1, this would not be possible.\nTherefore, changing of table names for <= v2.114.1 have been disabled.\n\n```ts fixture=cluster\nnew Table(this, 'Table', {\n tableName: 'oldTableName' // This value can be change for versions greater than v2.114.1\n tableColumns: [{ name: 'col1', dataType: 'varchar(4)' }, { name: 'col2', dataType: 'float' }],\n cluster: cluster,\n databaseName: 'databaseName',\n});\n```\n\nThe table can be configured to have distStyle attribute and a distKey column:\n\n```ts fixture=cluster\nnew Table(this, 'Table', {\n tableColumns: [\n { name: 'col1', dataType: 'varchar(4)', distKey: true },\n { name: 'col2', dataType: 'float' },\n ],\n cluster: cluster,\n databaseName: 'databaseName',\n distStyle: TableDistStyle.KEY,\n});\n```\n\nThe table can also be configured to have sortStyle attribute and sortKey columns:\n\n```ts fixture=cluster\nnew Table(this, 'Table', {\n tableColumns: [\n { name: 'col1', dataType: 'varchar(4)', sortKey: true },\n { name: 'col2', dataType: 'float', sortKey: true },\n ],\n cluster: cluster,\n databaseName: 'databaseName',\n sortStyle: TableSortStyle.COMPOUND,\n});\n```\n\nTables and their respective columns can be configured to contain comments:\n\n```ts fixture=cluster\nnew Table(this, 'Table', {\n tableColumns: [\n { name: 'col1', dataType: 'varchar(4)', comment: 'This is a column comment' },\n { name: 'col2', dataType: 'float', comment: 'This is a another column comment' }\n ],\n cluster: cluster,\n databaseName: 'databaseName',\n tableComment: 'This is a table comment',\n});\n```\n\nTable columns can be configured to use a specific compression encoding:\n\n```ts fixture=cluster\nimport { ColumnEncoding } from '@aws-cdk/aws-redshift-alpha';\n\nnew Table(this, 'Table', {\n tableColumns: [\n { name: 'col1', dataType: 'varchar(4)', encoding: ColumnEncoding.TEXT32K },\n { name: 'col2', dataType: 'float', encoding: ColumnEncoding.DELTA32K },\n ],\n cluster: cluster,\n databaseName: 'databaseName',\n});\n```\n\nTable columns can also contain an `id` attribute, which can allow table columns to be renamed.\n\n**NOTE** To use the `id` attribute, you must also enable the `@aws-cdk/aws-redshift:columnId` feature flag.\n\n```ts fixture=cluster\nnew Table(this, 'Table', {\n tableColumns: [\n { id: 'col1', name: 'col1', dataType: 'varchar(4)' },\n { id: 'col2', name: 'col2', dataType: 'float' }\n ],\n cluster: cluster,\n databaseName: 'databaseName',\n});\n```\n\nQuery execution duration is limited to 1 minute by default. You can change this by setting the `timeout` property.\n\nValid timeout values are between 1 seconds and 15 minutes.\n\n```ts fixture=cluster\nimport { Duration } from 'aws-cdk-lib';\n\nnew Table(this, 'Table', {\n tableColumns: [\n { id: 'col1', name: 'col1', dataType: 'varchar(4)' },\n { id: 'col2', name: 'col2', dataType: 'float' }\n ],\n cluster: cluster,\n databaseName: 'databaseName',\n timeout: Duration.minutes(15),\n});\n```\n\n### Granting Privileges\n\nYou can give a user privileges to perform certain actions on a table by using the\n`Table.grant()` method.\n\n```ts fixture=cluster\nconst user = new User(this, 'User', {\n cluster: cluster,\n databaseName: 'databaseName',\n});\nconst table = new Table(this, 'Table', {\n tableColumns: [{ name: 'col1', dataType: 'varchar(4)' }, { name: 'col2', dataType: 'float' }],\n cluster: cluster,\n databaseName: 'databaseName',\n});\n\ntable.grant(user, TableAction.DROP, TableAction.SELECT);\n```\n\nTake care when managing privileges via the CDK, as attempting to manage a user's\nprivileges on the same table in multiple CDK applications could lead to accidentally\noverriding these permissions. Consider the following two CDK applications which both refer\nto the same user and table. In application 1, the resources are created and the user is\ngiven `INSERT` permissions on the table:\n\n```ts fixture=cluster\nconst databaseName = 'databaseName';\nconst username = 'myuser'\nconst tableName = 'mytable'\n\nconst user = new User(this, 'User', {\n username: username,\n cluster: cluster,\n databaseName: databaseName,\n});\nconst table = new Table(this, 'Table', {\n tableColumns: [{ name: 'col1', dataType: 'varchar(4)' }, { name: 'col2', dataType: 'float' }],\n cluster: cluster,\n databaseName: databaseName,\n});\ntable.grant(user, TableAction.INSERT);\n```\n\nIn application 2, the resources are imported and the user is given `INSERT` permissions on\nthe table:\n\n```ts fixture=cluster\nconst databaseName = 'databaseName';\nconst username = 'myuser'\nconst tableName = 'mytable'\n\nconst user = User.fromUserAttributes(this, 'User', {\n username: username,\n password: SecretValue.unsafePlainText('NOT_FOR_PRODUCTION'),\n cluster: cluster,\n databaseName: databaseName,\n});\nconst table = Table.fromTableAttributes(this, 'Table', {\n tableName: tableName,\n tableColumns: [{ name: 'col1', dataType: 'varchar(4)' }, { name: 'col2', dataType: 'float' }],\n cluster: cluster,\n databaseName: 'databaseName',\n});\ntable.grant(user, TableAction.INSERT);\n```\n\nBoth applications attempt to grant the user the appropriate privilege on the table by\nsubmitting a `GRANT USER` SQL query to the Redshift cluster. Note that the latter of these\ntwo calls will have no effect since the user has already been granted the privilege.\n\nNow, if application 1 were to remove the call to `grant`, a `REVOKE USER` SQL query is\nsubmitted to the Redshift cluster. In general, application 1 does not know that\napplication 2 has also granted this permission and thus cannot decide not to issue the\nrevocation. This leads to the undesirable state where application 2 still contains the\ncall to `grant` but the user does not have the specified permission.\n\nNote that this does not occur when duplicate privileges are granted within the same\napplication, as such privileges are de-duplicated before any SQL query is submitted.\n\n## Rotating credentials\n\nWhen the master password is generated and stored in AWS Secrets Manager, it can be rotated automatically:\n\n```ts fixture=cluster\ncluster.addRotationSingleUser(); // Will rotate automatically after 30 days\n```\n\nThe multi user rotation scheme is also available:\n\n```ts fixture=cluster\n\nconst user = new User(this, 'User', {\n cluster: cluster,\n databaseName: 'databaseName',\n});\ncluster.addRotationMultiUser('MultiUserRotation', {\n secret: user.secret,\n});\n```\n\n## Adding Parameters\n\nYou can add a parameter to a parameter group with`ClusterParameterGroup.addParameter()`.\n\n```ts\nimport { ClusterParameterGroup } from '@aws-cdk/aws-redshift-alpha';\n\nconst params = new ClusterParameterGroup(this, 'Params', {\n description: 'desc',\n parameters: {\n require_ssl: 'true',\n },\n});\n\nparams.addParameter('enable_user_activity_logging', 'true');\n```\n\nAdditionally, you can add a parameter to the cluster's associated parameter group with `Cluster.addToParameterGroup()`. If the cluster does not have an associated parameter group, a new parameter group is created.\n\n```ts\nimport * as ec2 from 'aws-cdk-lib/aws-ec2';\nimport * as cdk from 'aws-cdk-lib';\ndeclare const vpc: ec2.Vpc;\n\nconst cluster = new Cluster(this, 'Cluster', {\n masterUser: {\n masterUsername: 'admin',\n masterPassword: cdk.SecretValue.unsafePlainText('tooshort'),\n },\n vpc,\n});\n\ncluster.addToParameterGroup('enable_user_activity_logging', 'true');\n```\n\n## Rebooting for Parameter Updates\n\nIn most cases, existing clusters [must be manually rebooted](https://docs.aws.amazon.com/redshift/latest/mgmt/working-with-parameter-groups.html) to apply parameter changes. You can automate parameter related reboots by setting the cluster's `rebootForParameterChanges` property to `true` , or by using `Cluster.enableRebootForParameterChanges()`.\n\n```ts\nimport * as ec2 from 'aws-cdk-lib/aws-ec2';\nimport * as cdk from 'aws-cdk-lib';\ndeclare const vpc: ec2.Vpc;\n\nconst cluster = new Cluster(this, 'Cluster', {\n masterUser: {\n masterUsername: 'admin',\n masterPassword: cdk.SecretValue.unsafePlainText('tooshort'),\n },\n vpc,\n});\n\ncluster.addToParameterGroup('enable_user_activity_logging', 'true');\ncluster.enableRebootForParameterChanges()\n```\n\n## Elastic IP\n\nIf you configure your cluster to be publicly accessible, you can optionally select an *elastic IP address* to use for the external IP address. An elastic IP address is a static IP address that is associated with your AWS account. You can use an elastic IP address to connect to your cluster from outside the VPC. An elastic IP address gives you the ability to change your underlying configuration without affecting the IP address that clients use to connect to your cluster. This approach can be helpful for situations such as recovery after a failure.\n\n```ts\nimport * as ec2 from 'aws-cdk-lib/aws-ec2';\nimport * as cdk from 'aws-cdk-lib';\ndeclare const vpc: ec2.Vpc;\n\nnew Cluster(this, 'Redshift', {\n masterUser: {\n masterUsername: 'admin',\n masterPassword: cdk.SecretValue.unsafePlainText('tooshort'),\n },\n vpc,\n publiclyAccessible: true,\n elasticIp: '10.123.123.255', // A elastic ip you own\n})\n```\n\nIf the Cluster is in a VPC and you want to connect to it using the private IP address from within the cluster, it is important to enable *DNS resolution* and *DNS hostnames* in the VPC config. If these parameters would not be set, connections from within the VPC would connect to the elastic IP address and not the private IP address.\n\n```ts\nimport * as ec2 from 'aws-cdk-lib/aws-ec2';\nconst vpc = new ec2.Vpc(this, 'VPC', {\n enableDnsSupport: true,\n enableDnsHostnames: true,\n});\n```\n\nNote that if there is already an existing, public accessible Cluster, which VPC configuration is changed to use *DNS hostnames* and *DNS resolution*, connections still use the elastic IP address until the cluster is resized.\n\n### Elastic IP vs. Cluster node public IP\n\nThe elastic IP address is an external IP address for accessing the cluster outside of a VPC. It's not related to the cluster node public IP addresses and private IP addresses that are accessible via the `clusterEndpoint` property. The public and private cluster node IP addresses appear regardless of whether the cluster is publicly accessible or not. They are used only in certain circumstances to configure ingress rules on the remote host. These circumstances occur when you load data from an Amazon EC2 instance or other remote host using a Secure Shell (SSH) connection.\n\n### Attach Elastic IP after Cluster creation\n\nIn some cases, you might want to associate the cluster with an elastic IP address or change an elastic IP address that is associated with the cluster. To attach an elastic IP address after the cluster is created, first update the cluster so that it is not publicly accessible, then make it both publicly accessible and add an Elastic IP address in the same operation.\n\n## Enhanced VPC Routing\n\nWhen you use Amazon Redshift enhanced VPC routing, Amazon Redshift forces all COPY and UNLOAD traffic between your cluster and your data repositories through your virtual private cloud (VPC) based on the Amazon VPC service. By using enhanced VPC routing, you can use standard VPC features, such as VPC security groups, network access control lists (ACLs), VPC endpoints, VPC endpoint policies, internet gateways, and Domain Name System (DNS) servers, as described in the Amazon VPC User Guide. You use these features to tightly manage the flow of data between your Amazon Redshift cluster and other resources. When you use enhanced VPC routing to route traffic through your VPC, you can also use VPC flow logs to monitor COPY and UNLOAD traffic.\n\n```ts\nimport * as ec2 from 'aws-cdk-lib/aws-ec2';\nimport * as cdk from 'aws-cdk-lib';\ndeclare const vpc: ec2.Vpc;\n\nnew Cluster(this, 'Redshift', {\n masterUser: {\n masterUsername: 'admin',\n masterPassword: cdk.SecretValue.unsafePlainText('tooshort'),\n },\n vpc,\n enhancedVpcRouting: true,\n})\n```\n\nIf enhanced VPC routing is not enabled, Amazon Redshift routes traffic through the internet, including traffic to other services within the AWS network.\n\n## Default IAM role\n\nSome Amazon Redshift features require Amazon Redshift to access other AWS services on your behalf. For your Amazon Redshift clusters to act on your behalf, you supply security credentials to your clusters. The preferred method to supply security credentials is to specify an AWS Identity and Access Management (IAM) role.\n\nWhen you create an IAM role and set it as the default for the cluster using console, you don't have to provide the IAM role's Amazon Resource Name (ARN) to perform authentication and authorization.\n\n```ts\nimport * as ec2 from 'aws-cdk-lib/aws-ec2';\nimport * as iam from 'aws-cdk-lib/aws-iam';\ndeclare const vpc: ec2.Vpc;\n\nconst defaultRole = new iam.Role(this, 'DefaultRole', {\n assumedBy: new iam.ServicePrincipal('redshift.amazonaws.com'),\n},\n);\n\nnew Cluster(this, 'Redshift', {\n masterUser: {\n masterUsername: 'admin',\n },\n vpc,\n roles: [defaultRole],\n defaultRole: defaultRole,\n});\n```\n\nA default role can also be added to a cluster using the `addDefaultIamRole` method.\n\n```ts\nimport * as ec2 from 'aws-cdk-lib/aws-ec2';\nimport * as iam from 'aws-cdk-lib/aws-iam';\ndeclare const vpc: ec2.Vpc;\n\nconst defaultRole = new iam.Role(this, 'DefaultRole', {\n assumedBy: new iam.ServicePrincipal('redshift.amazonaws.com'),\n},\n);\n\nconst redshiftCluster = new Cluster(this, 'Redshift', {\n masterUser: {\n masterUsername: 'admin',\n },\n vpc,\n roles: [defaultRole],\n});\n\nredshiftCluster.addDefaultIamRole(defaultRole);\n```\n\n## IAM roles\n\nAttaching IAM roles to a Redshift Cluster grants permissions to the Redshift service to perform actions on your behalf.\n\n```ts\nimport * as ec2 from 'aws-cdk-lib/aws-ec2';\nimport * as iam from 'aws-cdk-lib/aws-iam';\ndeclare const vpc: ec2.Vpc\n\nconst role = new iam.Role(this, 'Role', {\n assumedBy: new iam.ServicePrincipal('redshift.amazonaws.com'),\n});\nconst cluster = new Cluster(this, 'Redshift', {\n masterUser: {\n masterUsername: 'admin',\n },\n vpc,\n roles: [role],\n});\n```\n\nAdditional IAM roles can be attached to a cluster using the `addIamRole` method.\n\n```ts\nimport * as ec2 from 'aws-cdk-lib/aws-ec2';\nimport * as iam from 'aws-cdk-lib/aws-iam';\ndeclare const vpc: ec2.Vpc\n\nconst role = new iam.Role(this, 'Role', {\n assumedBy: new iam.ServicePrincipal('redshift.amazonaws.com'),\n});\nconst cluster = new Cluster(this, 'Redshift', {\n masterUser: {\n masterUsername: 'admin',\n },\n vpc,\n});\ncluster.addIamRole(role);\n```\n\n## Multi-AZ\n\nAmazon Redshift supports [multiple Availability Zones (Multi-AZ) deployments]((https://docs.aws.amazon.com/redshift/latest/mgmt/managing-cluster-multi-az.html)) for provisioned RA3 clusters.\nBy using Multi-AZ deployments, your Amazon Redshift data warehouse can continue operating in failure scenarios when an unexpected event happens in an Availability Zone.\n\nTo create a Multi-AZ cluster, set the `multiAz` property to `true` when creating the cluster.\n\n```ts\ndeclare const vpc: ec2.IVpc;\n\nnew redshift.Cluster(stack, 'Cluster', {\n masterUser: {\n masterUsername: 'admin',\n },\n vpc, // 3 AZs are required for Multi-AZ\n nodeType: redshift.NodeType.RA3_XLPLUS, // must be RA3 node type\n clusterType: redshift.ClusterType.MULTI_NODE, // must be MULTI_NODE\n numberOfNodes: 2, // must be 2 or more\n multiAz: true,\n});\n```\n\n## Resizing\n\nAs your data warehousing needs change, it's possible to resize your Redshift cluster. If the cluster was deployed via CDK,\nit's important to resize it via CDK so the change is registered in the AWS CloudFormation template.\nThere are two types of resize operations:\n\n* Elastic resize - Number of nodes and node type can be changed, but not at the same time. Elastic resize is the default behavior,\nas it's a fast operation and typically completes in minutes. Elastic resize is only supported on clusters of the following types:\n * dc1.large (if your cluster is in a VPC)\n * dc1.8xlarge (if your cluster is in a VPC)\n * dc2.large\n * dc2.8xlarge\n * ds2.xlarge\n * ds2.8xlarge\n * ra3.xlplus\n * ra3.4xlarge\n * ra3.16xlarge\n\n* Classic resize - Number of nodes, node type, or both, can be changed. This operation takes longer to complete,\nbut is useful when the resize operation doesn't meet the criteria of an elastic resize. If you prefer classic resizing,\nyou can set the `classicResizing` flag when creating the cluster.\n\nThere are other constraints to be aware of, for example, elastic resizing does not support single-node clusters and there are\nlimits on the number of nodes you can add to a cluster. See the [AWS Redshift Documentation](https://docs.aws.amazon.com/redshift/latest/mgmt/managing-cluster-operations.html#rs-resize-tutorial) and [AWS API Documentation](https://docs.aws.amazon.com/redshift/latest/APIReference/API_ResizeCluster.html) for more details.\n"
|
|
3924
|
+
"markdown": "# Amazon Redshift Construct Library\n<!--BEGIN STABILITY BANNER-->\n\n---\n\n\n\n> The APIs of higher level constructs in this module are experimental and under active development.\n> They are subject to non-backward compatible changes or removal in any future version. These are\n> not subject to the [Semantic Versioning](https://semver.org/) model and breaking changes will be\n> announced in the release notes. This means that while you may use them, you may need to update\n> your source code when upgrading to a newer version of this package.\n\n---\n\n<!--END STABILITY BANNER-->\n\n## Starting a Redshift Cluster Database\n\nTo set up a Redshift cluster, define a `Cluster`. It will be launched in a VPC.\nYou can specify a VPC, otherwise one will be created. The nodes are always launched in private subnets and are encrypted by default.\n\n```ts\nimport * as ec2 from 'aws-cdk-lib/aws-ec2';\n\nconst vpc = new ec2.Vpc(this, 'Vpc');\nconst cluster = new Cluster(this, 'Redshift', {\n masterUser: {\n masterUsername: 'admin',\n },\n vpc\n});\n```\n\nBy default, the master password will be generated and stored in AWS Secrets Manager.\nYou can specify characters to not include in generated passwords by setting `excludeCharacters` property.\n\n```ts\nimport * as ec2 from 'aws-cdk-lib/aws-ec2';\n\nconst vpc = new ec2.Vpc(this, 'Vpc');\nconst cluster = new Cluster(this, 'Redshift', {\n masterUser: {\n masterUsername: 'admin',\n excludeCharacters: '\"@/\\\\\\ \\'`',\n },\n vpc\n});\n```\n\nA default database named `default_db` will be created in the cluster. To change the name of this database set the `defaultDatabaseName` attribute in the constructor properties.\n\nBy default, the cluster will not be publicly accessible.\nDepending on your use case, you can make the cluster publicly accessible with the `publiclyAccessible` property.\n\n## Adding a logging bucket for database audit logging to S3\n\nAmazon Redshift logs information about connections and user activities in your database. These logs help you to monitor the database for security and troubleshooting purposes, a process called database auditing. To send these logs to an S3 bucket, specify the `loggingProperties` when creating a new cluster.\n\n```ts\nimport * as ec2 from 'aws-cdk-lib/aws-ec2';\nimport * as s3 from 'aws-cdk-lib/aws-s3';\n\nconst vpc = new ec2.Vpc(this, 'Vpc');\nconst bucket = s3.Bucket.fromBucketName(this, 'bucket', 'amzn-s3-demo-bucket');\n\nconst cluster = new Cluster(this, 'Redshift', {\n masterUser: {\n masterUsername: 'admin',\n },\n vpc,\n loggingProperties: {\n loggingBucket: bucket,\n loggingKeyPrefix: 'prefix',\n }\n});\n```\n\n## Availability Zone Relocation\n\nBy using [relocation in Amazon Redshift](https://docs.aws.amazon.com/redshift/latest/mgmt/managing-cluster-recovery.html), you allow Amazon Redshift to move a cluster to another Availability Zone (AZ) without any loss of data or changes to your applications.\nThis feature can be applied to both new and existing clusters.\n\nTo enable this feature, set the `availabilityZoneRelocation` property to `true`.\n\n```ts\nimport * as ec2 from 'aws-cdk-lib/aws-ec2';\n\ndeclare const vpc: ec2.IVpc;\n\nconst cluster = new Cluster(this, 'Redshift', {\n masterUser: {\n masterUsername: 'admin',\n },\n vpc,\n nodeType: NodeType.RA3_XLPLUS,\n availabilityZoneRelocation: true,\n});\n```\n\n**Note**: The `availabilityZoneRelocation` property is only available for RA3 node types.\n\n## Connecting\n\nTo control who can access the cluster, use the `.connections` attribute. Redshift Clusters have\na default port, so you don't need to specify the port:\n\n```ts fixture=cluster\ncluster.connections.allowDefaultPortFromAnyIpv4('Open to the world');\n```\n\nThe endpoint to access your database cluster will be available as the `.clusterEndpoint` attribute:\n\n```ts fixture=cluster\ncluster.clusterEndpoint.socketAddress; // \"HOSTNAME:PORT\"\n```\n\n## Database Resources\n\nThis module allows for the creation of non-CloudFormation database resources such as users\nand tables. This allows you to manage identities, permissions, and stateful resources\nwithin your Redshift cluster from your CDK application.\n\nBecause these resources are not available in CloudFormation, this library leverages\n[custom\nresources](https://docs.aws.amazon.com/cdk/api/latest/docs/custom-resources-readme.html)\nto manage them. In addition to the IAM permissions required to make Redshift service\ncalls, the execution role for the custom resource handler requires database credentials to\ncreate resources within the cluster.\n\nThese database credentials can be supplied explicitly through the `adminUser` properties\nof the various database resource constructs. Alternatively, the credentials can be\nautomatically pulled from the Redshift cluster's default administrator\ncredentials. However, this option is only available if the password for the credentials\nwas generated by the CDK application (ie., no value vas provided for [the `masterPassword`\nproperty](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-redshift.Login.html#masterpasswordspan-classapi-icon-api-icon-experimental-titlethis-api-element-is-experimental-it-may-change-without-noticespan)\nof\n[`Cluster.masterUser`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-redshift.Cluster.html#masteruserspan-classapi-icon-api-icon-experimental-titlethis-api-element-is-experimental-it-may-change-without-noticespan)).\n\n### Creating Users\n\nCreate a user within a Redshift cluster database by instantiating a `User` construct. This\nwill generate a username and password, store the credentials in a [AWS Secrets Manager\n`Secret`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-secretsmanager.Secret.html),\nand make a query to the Redshift cluster to create a new database user with the\ncredentials.\n\n```ts fixture=cluster\nnew User(this, 'User', {\n cluster: cluster,\n databaseName: 'databaseName',\n});\n```\n\nBy default, the user credentials are encrypted with your AWS account's default Secrets\nManager encryption key. You can specify the encryption key used for this purpose by\nsupplying a key in the `encryptionKey` property.\n\n```ts fixture=cluster\nimport * as kms from 'aws-cdk-lib/aws-kms';\n\nconst encryptionKey = new kms.Key(this, 'Key');\nnew User(this, 'User', {\n encryptionKey: encryptionKey,\n cluster: cluster,\n databaseName: 'databaseName',\n});\n```\n\nBy default, a username is automatically generated from the user construct ID and its path\nin the construct tree. You can specify a particular username by providing a value for the\n`username` property. Usernames must be valid identifiers; see: [Names and\nidentifiers](https://docs.aws.amazon.com/redshift/latest/dg/r_names.html) in the *Amazon\nRedshift Database Developer Guide*.\n\n```ts fixture=cluster\nnew User(this, 'User', {\n username: 'myuser',\n cluster: cluster,\n databaseName: 'databaseName',\n});\n```\n\nThe user password is generated by AWS Secrets Manager using the default configuration\nfound in\n[`secretsmanager.SecretStringGenerator`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-secretsmanager.SecretStringGenerator.html),\nexcept with password length `30` and some SQL-incompliant characters excluded. The\nplaintext for the password will never be present in the CDK application; instead, a\n[CloudFormation Dynamic\nReference](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/dynamic-references.html)\nwill be used wherever the password value is required.\n\nYou can specify characters to not include in generated passwords by setting `excludeCharacters` property.\n\n```ts fixture=cluster\nnew User(this, 'User', {\n cluster: cluster,\n databaseName: 'databaseName',\n excludeCharacters: '\"@/\\\\\\ \\'`',\n});\n```\n\n### Creating Tables\n\nCreate a table within a Redshift cluster database by instantiating a `Table`\nconstruct. This will make a query to the Redshift cluster to create a new database table\nwith the supplied schema.\n\n```ts fixture=cluster\nnew Table(this, 'Table', {\n tableColumns: [{ name: 'col1', dataType: 'varchar(4)' }, { name: 'col2', dataType: 'float' }],\n cluster: cluster,\n databaseName: 'databaseName',\n});\n```\n\nTables greater than v2.114.1 can have their table name changed, for versions <= v2.114.1, this would not be possible.\nTherefore, changing of table names for <= v2.114.1 have been disabled.\n\n```ts fixture=cluster\nnew Table(this, 'Table', {\n tableName: 'oldTableName' // This value can be change for versions greater than v2.114.1\n tableColumns: [{ name: 'col1', dataType: 'varchar(4)' }, { name: 'col2', dataType: 'float' }],\n cluster: cluster,\n databaseName: 'databaseName',\n});\n```\n\nThe table can be configured to have distStyle attribute and a distKey column:\n\n```ts fixture=cluster\nnew Table(this, 'Table', {\n tableColumns: [\n { name: 'col1', dataType: 'varchar(4)', distKey: true },\n { name: 'col2', dataType: 'float' },\n ],\n cluster: cluster,\n databaseName: 'databaseName',\n distStyle: TableDistStyle.KEY,\n});\n```\n\nThe table can also be configured to have sortStyle attribute and sortKey columns:\n\n```ts fixture=cluster\nnew Table(this, 'Table', {\n tableColumns: [\n { name: 'col1', dataType: 'varchar(4)', sortKey: true },\n { name: 'col2', dataType: 'float', sortKey: true },\n ],\n cluster: cluster,\n databaseName: 'databaseName',\n sortStyle: TableSortStyle.COMPOUND,\n});\n```\n\nTables and their respective columns can be configured to contain comments:\n\n```ts fixture=cluster\nnew Table(this, 'Table', {\n tableColumns: [\n { name: 'col1', dataType: 'varchar(4)', comment: 'This is a column comment' },\n { name: 'col2', dataType: 'float', comment: 'This is a another column comment' }\n ],\n cluster: cluster,\n databaseName: 'databaseName',\n tableComment: 'This is a table comment',\n});\n```\n\nTable columns can be configured to use a specific compression encoding:\n\n```ts fixture=cluster\nimport { ColumnEncoding } from '@aws-cdk/aws-redshift-alpha';\n\nnew Table(this, 'Table', {\n tableColumns: [\n { name: 'col1', dataType: 'varchar(4)', encoding: ColumnEncoding.TEXT32K },\n { name: 'col2', dataType: 'float', encoding: ColumnEncoding.DELTA32K },\n ],\n cluster: cluster,\n databaseName: 'databaseName',\n});\n```\n\nTable columns can also contain an `id` attribute, which can allow table columns to be renamed.\n\n**NOTE** To use the `id` attribute, you must also enable the `@aws-cdk/aws-redshift:columnId` feature flag.\n\n```ts fixture=cluster\nnew Table(this, 'Table', {\n tableColumns: [\n { id: 'col1', name: 'col1', dataType: 'varchar(4)' },\n { id: 'col2', name: 'col2', dataType: 'float' }\n ],\n cluster: cluster,\n databaseName: 'databaseName',\n});\n```\n\nQuery execution duration is limited to 1 minute by default. You can change this by setting the `timeout` property.\n\nValid timeout values are between 1 seconds and 15 minutes.\n\n```ts fixture=cluster\nimport { Duration } from 'aws-cdk-lib';\n\nnew Table(this, 'Table', {\n tableColumns: [\n { id: 'col1', name: 'col1', dataType: 'varchar(4)' },\n { id: 'col2', name: 'col2', dataType: 'float' }\n ],\n cluster: cluster,\n databaseName: 'databaseName',\n timeout: Duration.minutes(15),\n});\n```\n\n### Granting Privileges\n\nYou can give a user privileges to perform certain actions on a table by using the\n`Table.grant()` method.\n\n```ts fixture=cluster\nconst user = new User(this, 'User', {\n cluster: cluster,\n databaseName: 'databaseName',\n});\nconst table = new Table(this, 'Table', {\n tableColumns: [{ name: 'col1', dataType: 'varchar(4)' }, { name: 'col2', dataType: 'float' }],\n cluster: cluster,\n databaseName: 'databaseName',\n});\n\ntable.grant(user, TableAction.DROP, TableAction.SELECT);\n```\n\nTake care when managing privileges via the CDK, as attempting to manage a user's\nprivileges on the same table in multiple CDK applications could lead to accidentally\noverriding these permissions. Consider the following two CDK applications which both refer\nto the same user and table. In application 1, the resources are created and the user is\ngiven `INSERT` permissions on the table:\n\n```ts fixture=cluster\nconst databaseName = 'databaseName';\nconst username = 'myuser'\nconst tableName = 'mytable'\n\nconst user = new User(this, 'User', {\n username: username,\n cluster: cluster,\n databaseName: databaseName,\n});\nconst table = new Table(this, 'Table', {\n tableColumns: [{ name: 'col1', dataType: 'varchar(4)' }, { name: 'col2', dataType: 'float' }],\n cluster: cluster,\n databaseName: databaseName,\n});\ntable.grant(user, TableAction.INSERT);\n```\n\nIn application 2, the resources are imported and the user is given `INSERT` permissions on\nthe table:\n\n```ts fixture=cluster\nconst databaseName = 'databaseName';\nconst username = 'myuser'\nconst tableName = 'mytable'\n\nconst user = User.fromUserAttributes(this, 'User', {\n username: username,\n password: SecretValue.unsafePlainText('NOT_FOR_PRODUCTION'),\n cluster: cluster,\n databaseName: databaseName,\n});\nconst table = Table.fromTableAttributes(this, 'Table', {\n tableName: tableName,\n tableColumns: [{ name: 'col1', dataType: 'varchar(4)' }, { name: 'col2', dataType: 'float' }],\n cluster: cluster,\n databaseName: 'databaseName',\n});\ntable.grant(user, TableAction.INSERT);\n```\n\nBoth applications attempt to grant the user the appropriate privilege on the table by\nsubmitting a `GRANT USER` SQL query to the Redshift cluster. Note that the latter of these\ntwo calls will have no effect since the user has already been granted the privilege.\n\nNow, if application 1 were to remove the call to `grant`, a `REVOKE USER` SQL query is\nsubmitted to the Redshift cluster. In general, application 1 does not know that\napplication 2 has also granted this permission and thus cannot decide not to issue the\nrevocation. This leads to the undesirable state where application 2 still contains the\ncall to `grant` but the user does not have the specified permission.\n\nNote that this does not occur when duplicate privileges are granted within the same\napplication, as such privileges are de-duplicated before any SQL query is submitted.\n\n## Rotating credentials\n\nWhen the master password is generated and stored in AWS Secrets Manager, it can be rotated automatically:\n\n```ts fixture=cluster\ncluster.addRotationSingleUser(); // Will rotate automatically after 30 days\n```\n\nThe multi user rotation scheme is also available:\n\n```ts fixture=cluster\n\nconst user = new User(this, 'User', {\n cluster: cluster,\n databaseName: 'databaseName',\n});\ncluster.addRotationMultiUser('MultiUserRotation', {\n secret: user.secret,\n});\n```\n\n## Adding Parameters\n\nYou can add a parameter to a parameter group with`ClusterParameterGroup.addParameter()`.\n\n```ts\nimport { ClusterParameterGroup } from '@aws-cdk/aws-redshift-alpha';\n\nconst params = new ClusterParameterGroup(this, 'Params', {\n description: 'desc',\n parameters: {\n require_ssl: 'true',\n },\n});\n\nparams.addParameter('enable_user_activity_logging', 'true');\n```\n\nAdditionally, you can add a parameter to the cluster's associated parameter group with `Cluster.addToParameterGroup()`. If the cluster does not have an associated parameter group, a new parameter group is created.\n\n```ts\nimport * as ec2 from 'aws-cdk-lib/aws-ec2';\nimport * as cdk from 'aws-cdk-lib';\ndeclare const vpc: ec2.Vpc;\n\nconst cluster = new Cluster(this, 'Cluster', {\n masterUser: {\n masterUsername: 'admin',\n masterPassword: cdk.SecretValue.unsafePlainText('tooshort'),\n },\n vpc,\n});\n\ncluster.addToParameterGroup('enable_user_activity_logging', 'true');\n```\n\n## Rebooting for Parameter Updates\n\nIn most cases, existing clusters [must be manually rebooted](https://docs.aws.amazon.com/redshift/latest/mgmt/working-with-parameter-groups.html) to apply parameter changes. You can automate parameter related reboots by setting the cluster's `rebootForParameterChanges` property to `true` , or by using `Cluster.enableRebootForParameterChanges()`.\n\n```ts\nimport * as ec2 from 'aws-cdk-lib/aws-ec2';\nimport * as cdk from 'aws-cdk-lib';\ndeclare const vpc: ec2.Vpc;\n\nconst cluster = new Cluster(this, 'Cluster', {\n masterUser: {\n masterUsername: 'admin',\n masterPassword: cdk.SecretValue.unsafePlainText('tooshort'),\n },\n vpc,\n});\n\ncluster.addToParameterGroup('enable_user_activity_logging', 'true');\ncluster.enableRebootForParameterChanges()\n```\n\n## Resource Action\n\nYou can perform various actions on the Redshift resource by specifying the `resourceAction` property,\nincluding [pausing and resuming the cluster](https://docs.aws.amazon.com/redshift/latest/mgmt/rs-mgmt-pause-resume-cluster.html), as well as initiating [failover for Multi-AZ clusters](https://docs.aws.amazon.com/redshift/latest/mgmt/test-cluster-multi-az.html).\n\n```ts\nimport * as ec2 from 'aws-cdk-lib/aws-ec2';\nimport { ResourceAction } from '@aws-cdk/aws-redshift-alpha';\n\ndeclare const vpc: ec2.IVpc;\n\n// Pause the cluster\nnew Cluster(this, 'PausedCluster', {\n masterUser: {\n masterUsername: 'admin',\n },\n vpc,\n resourceAction: ResourceAction.PAUSE,\n});\n\n// Resume the cluster\nnew Cluster(this, 'ResumedCluster', {\n masterUser: {\n masterUsername: 'admin',\n },\n vpc,\n resourceAction: ResourceAction.RESUME,\n});\n\n// Failover the cluster\nnew Cluster(this, 'FailOverCluster', {\n masterUser: {\n masterUsername: 'admin',\n },\n // VPC must have 3 AZs for the cluster which executes failover action\n vpc,\n // Must be a multi-AZ cluster to failover\n multiAz: true,\n resourceAction: ResourceAction.FAILOVER_PRIMARY_COMPUTE,\n});\n```\n\n## Elastic IP\n\nIf you configure your cluster to be publicly accessible, you can optionally select an *elastic IP address* to use for the external IP address. An elastic IP address is a static IP address that is associated with your AWS account. You can use an elastic IP address to connect to your cluster from outside the VPC. An elastic IP address gives you the ability to change your underlying configuration without affecting the IP address that clients use to connect to your cluster. This approach can be helpful for situations such as recovery after a failure.\n\n```ts\nimport * as ec2 from 'aws-cdk-lib/aws-ec2';\nimport * as cdk from 'aws-cdk-lib';\ndeclare const vpc: ec2.Vpc;\n\nnew Cluster(this, 'Redshift', {\n masterUser: {\n masterUsername: 'admin',\n masterPassword: cdk.SecretValue.unsafePlainText('tooshort'),\n },\n vpc,\n publiclyAccessible: true,\n elasticIp: '10.123.123.255', // A elastic ip you own\n})\n```\n\nIf the Cluster is in a VPC and you want to connect to it using the private IP address from within the cluster, it is important to enable *DNS resolution* and *DNS hostnames* in the VPC config. If these parameters would not be set, connections from within the VPC would connect to the elastic IP address and not the private IP address.\n\n```ts\nimport * as ec2 from 'aws-cdk-lib/aws-ec2';\nconst vpc = new ec2.Vpc(this, 'VPC', {\n enableDnsSupport: true,\n enableDnsHostnames: true,\n});\n```\n\nNote that if there is already an existing, public accessible Cluster, which VPC configuration is changed to use *DNS hostnames* and *DNS resolution*, connections still use the elastic IP address until the cluster is resized.\n\n### Elastic IP vs. Cluster node public IP\n\nThe elastic IP address is an external IP address for accessing the cluster outside of a VPC. It's not related to the cluster node public IP addresses and private IP addresses that are accessible via the `clusterEndpoint` property. The public and private cluster node IP addresses appear regardless of whether the cluster is publicly accessible or not. They are used only in certain circumstances to configure ingress rules on the remote host. These circumstances occur when you load data from an Amazon EC2 instance or other remote host using a Secure Shell (SSH) connection.\n\n### Attach Elastic IP after Cluster creation\n\nIn some cases, you might want to associate the cluster with an elastic IP address or change an elastic IP address that is associated with the cluster. To attach an elastic IP address after the cluster is created, first update the cluster so that it is not publicly accessible, then make it both publicly accessible and add an Elastic IP address in the same operation.\n\n## Enhanced VPC Routing\n\nWhen you use Amazon Redshift enhanced VPC routing, Amazon Redshift forces all COPY and UNLOAD traffic between your cluster and your data repositories through your virtual private cloud (VPC) based on the Amazon VPC service. By using enhanced VPC routing, you can use standard VPC features, such as VPC security groups, network access control lists (ACLs), VPC endpoints, VPC endpoint policies, internet gateways, and Domain Name System (DNS) servers, as described in the Amazon VPC User Guide. You use these features to tightly manage the flow of data between your Amazon Redshift cluster and other resources. When you use enhanced VPC routing to route traffic through your VPC, you can also use VPC flow logs to monitor COPY and UNLOAD traffic.\n\n```ts\nimport * as ec2 from 'aws-cdk-lib/aws-ec2';\nimport * as cdk from 'aws-cdk-lib';\ndeclare const vpc: ec2.Vpc;\n\nnew Cluster(this, 'Redshift', {\n masterUser: {\n masterUsername: 'admin',\n masterPassword: cdk.SecretValue.unsafePlainText('tooshort'),\n },\n vpc,\n enhancedVpcRouting: true,\n})\n```\n\nIf enhanced VPC routing is not enabled, Amazon Redshift routes traffic through the internet, including traffic to other services within the AWS network.\n\n## Default IAM role\n\nSome Amazon Redshift features require Amazon Redshift to access other AWS services on your behalf. For your Amazon Redshift clusters to act on your behalf, you supply security credentials to your clusters. The preferred method to supply security credentials is to specify an AWS Identity and Access Management (IAM) role.\n\nWhen you create an IAM role and set it as the default for the cluster using console, you don't have to provide the IAM role's Amazon Resource Name (ARN) to perform authentication and authorization.\n\n```ts\nimport * as ec2 from 'aws-cdk-lib/aws-ec2';\nimport * as iam from 'aws-cdk-lib/aws-iam';\ndeclare const vpc: ec2.Vpc;\n\nconst defaultRole = new iam.Role(this, 'DefaultRole', {\n assumedBy: new iam.ServicePrincipal('redshift.amazonaws.com'),\n},\n);\n\nnew Cluster(this, 'Redshift', {\n masterUser: {\n masterUsername: 'admin',\n },\n vpc,\n roles: [defaultRole],\n defaultRole: defaultRole,\n});\n```\n\nA default role can also be added to a cluster using the `addDefaultIamRole` method.\n\n```ts\nimport * as ec2 from 'aws-cdk-lib/aws-ec2';\nimport * as iam from 'aws-cdk-lib/aws-iam';\ndeclare const vpc: ec2.Vpc;\n\nconst defaultRole = new iam.Role(this, 'DefaultRole', {\n assumedBy: new iam.ServicePrincipal('redshift.amazonaws.com'),\n},\n);\n\nconst redshiftCluster = new Cluster(this, 'Redshift', {\n masterUser: {\n masterUsername: 'admin',\n },\n vpc,\n roles: [defaultRole],\n});\n\nredshiftCluster.addDefaultIamRole(defaultRole);\n```\n\n## IAM roles\n\nAttaching IAM roles to a Redshift Cluster grants permissions to the Redshift service to perform actions on your behalf.\n\n```ts\nimport * as ec2 from 'aws-cdk-lib/aws-ec2';\nimport * as iam from 'aws-cdk-lib/aws-iam';\ndeclare const vpc: ec2.Vpc\n\nconst role = new iam.Role(this, 'Role', {\n assumedBy: new iam.ServicePrincipal('redshift.amazonaws.com'),\n});\nconst cluster = new Cluster(this, 'Redshift', {\n masterUser: {\n masterUsername: 'admin',\n },\n vpc,\n roles: [role],\n});\n```\n\nAdditional IAM roles can be attached to a cluster using the `addIamRole` method.\n\n```ts\nimport * as ec2 from 'aws-cdk-lib/aws-ec2';\nimport * as iam from 'aws-cdk-lib/aws-iam';\ndeclare const vpc: ec2.Vpc\n\nconst role = new iam.Role(this, 'Role', {\n assumedBy: new iam.ServicePrincipal('redshift.amazonaws.com'),\n});\nconst cluster = new Cluster(this, 'Redshift', {\n masterUser: {\n masterUsername: 'admin',\n },\n vpc,\n});\ncluster.addIamRole(role);\n```\n\n## Multi-AZ\n\nAmazon Redshift supports [multiple Availability Zones (Multi-AZ) deployments]((https://docs.aws.amazon.com/redshift/latest/mgmt/managing-cluster-multi-az.html)) for provisioned RA3 clusters.\nBy using Multi-AZ deployments, your Amazon Redshift data warehouse can continue operating in failure scenarios when an unexpected event happens in an Availability Zone.\n\nTo create a Multi-AZ cluster, set the `multiAz` property to `true` when creating the cluster.\n\n```ts\ndeclare const vpc: ec2.IVpc;\n\nnew redshift.Cluster(stack, 'Cluster', {\n masterUser: {\n masterUsername: 'admin',\n },\n vpc, // 3 AZs are required for Multi-AZ\n nodeType: redshift.NodeType.RA3_XLPLUS, // must be RA3 node type\n clusterType: redshift.ClusterType.MULTI_NODE, // must be MULTI_NODE\n numberOfNodes: 2, // must be 2 or more\n multiAz: true,\n});\n```\n\n## Resizing\n\nAs your data warehousing needs change, it's possible to resize your Redshift cluster. If the cluster was deployed via CDK,\nit's important to resize it via CDK so the change is registered in the AWS CloudFormation template.\nThere are two types of resize operations:\n\n* Elastic resize - Number of nodes and node type can be changed, but not at the same time. Elastic resize is the default behavior,\nas it's a fast operation and typically completes in minutes. Elastic resize is only supported on clusters of the following types:\n * dc1.large (if your cluster is in a VPC)\n * dc1.8xlarge (if your cluster is in a VPC)\n * dc2.large\n * dc2.8xlarge\n * ds2.xlarge\n * ds2.8xlarge\n * ra3.large\n * ra3.xlplus\n * ra3.4xlarge\n * ra3.16xlarge\n\n* Classic resize - Number of nodes, node type, or both, can be changed. This operation takes longer to complete,\nbut is useful when the resize operation doesn't meet the criteria of an elastic resize. If you prefer classic resizing,\nyou can set the `classicResizing` flag when creating the cluster.\n\nThere are other constraints to be aware of, for example, elastic resizing does not support single-node clusters and there are\nlimits on the number of nodes you can add to a cluster. See the [AWS Redshift Documentation](https://docs.aws.amazon.com/redshift/latest/mgmt/managing-cluster-operations.html#rs-resize-tutorial) and [AWS API Documentation](https://docs.aws.amazon.com/redshift/latest/APIReference/API_ResizeCluster.html) for more details.\n"
|
|
3912
3925
|
},
|
|
3913
3926
|
"repository": {
|
|
3914
3927
|
"directory": "packages/@aws-cdk/aws-redshift-alpha",
|
|
@@ -3956,7 +3969,7 @@
|
|
|
3956
3969
|
},
|
|
3957
3970
|
"stability": "experimental",
|
|
3958
3971
|
"summary": "Create a Redshift cluster a given number of nodes.",
|
|
3959
|
-
"example": "import * as ec2 from 'aws-cdk-lib/aws-ec2';\nimport * as
|
|
3972
|
+
"example": "import * as ec2 from 'aws-cdk-lib/aws-ec2';\nimport * as iam from 'aws-cdk-lib/aws-iam';\ndeclare const vpc: ec2.Vpc;\n\nconst defaultRole = new iam.Role(this, 'DefaultRole', {\n assumedBy: new iam.ServicePrincipal('redshift.amazonaws.com'),\n},\n);\n\nnew Cluster(this, 'Redshift', {\n masterUser: {\n masterUsername: 'admin',\n },\n vpc,\n roles: [defaultRole],\n defaultRole: defaultRole,\n});"
|
|
3960
3973
|
},
|
|
3961
3974
|
"fqn": "@aws-cdk/aws-redshift-alpha.Cluster",
|
|
3962
3975
|
"initializer": {
|
|
@@ -3965,7 +3978,7 @@
|
|
|
3965
3978
|
},
|
|
3966
3979
|
"locationInModule": {
|
|
3967
3980
|
"filename": "lib/cluster.ts",
|
|
3968
|
-
"line":
|
|
3981
|
+
"line": 549
|
|
3969
3982
|
},
|
|
3970
3983
|
"parameters": [
|
|
3971
3984
|
{
|
|
@@ -3994,7 +4007,7 @@
|
|
|
3994
4007
|
"kind": "class",
|
|
3995
4008
|
"locationInModule": {
|
|
3996
4009
|
"filename": "lib/cluster.ts",
|
|
3997
|
-
"line":
|
|
4010
|
+
"line": 482
|
|
3998
4011
|
},
|
|
3999
4012
|
"methods": [
|
|
4000
4013
|
{
|
|
@@ -4004,7 +4017,7 @@
|
|
|
4004
4017
|
},
|
|
4005
4018
|
"locationInModule": {
|
|
4006
4019
|
"filename": "lib/cluster.ts",
|
|
4007
|
-
"line":
|
|
4020
|
+
"line": 486
|
|
4008
4021
|
},
|
|
4009
4022
|
"name": "fromClusterAttributes",
|
|
4010
4023
|
"parameters": [
|
|
@@ -4042,7 +4055,7 @@
|
|
|
4042
4055
|
},
|
|
4043
4056
|
"locationInModule": {
|
|
4044
4057
|
"filename": "lib/cluster.ts",
|
|
4045
|
-
"line":
|
|
4058
|
+
"line": 855
|
|
4046
4059
|
},
|
|
4047
4060
|
"name": "addDefaultIamRole",
|
|
4048
4061
|
"parameters": [
|
|
@@ -4064,7 +4077,7 @@
|
|
|
4064
4077
|
},
|
|
4065
4078
|
"locationInModule": {
|
|
4066
4079
|
"filename": "lib/cluster.ts",
|
|
4067
|
-
"line":
|
|
4080
|
+
"line": 909
|
|
4068
4081
|
},
|
|
4069
4082
|
"name": "addIamRole",
|
|
4070
4083
|
"parameters": [
|
|
@@ -4086,7 +4099,7 @@
|
|
|
4086
4099
|
},
|
|
4087
4100
|
"locationInModule": {
|
|
4088
4101
|
"filename": "lib/cluster.ts",
|
|
4089
|
-
"line":
|
|
4102
|
+
"line": 729
|
|
4090
4103
|
},
|
|
4091
4104
|
"name": "addRotationMultiUser",
|
|
4092
4105
|
"parameters": [
|
|
@@ -4116,7 +4129,7 @@
|
|
|
4116
4129
|
},
|
|
4117
4130
|
"locationInModule": {
|
|
4118
4131
|
"filename": "lib/cluster.ts",
|
|
4119
|
-
"line":
|
|
4132
|
+
"line": 705
|
|
4120
4133
|
},
|
|
4121
4134
|
"name": "addRotationSingleUser",
|
|
4122
4135
|
"parameters": [
|
|
@@ -4144,7 +4157,7 @@
|
|
|
4144
4157
|
},
|
|
4145
4158
|
"locationInModule": {
|
|
4146
4159
|
"filename": "lib/cluster.ts",
|
|
4147
|
-
"line":
|
|
4160
|
+
"line": 769
|
|
4148
4161
|
},
|
|
4149
4162
|
"name": "addToParameterGroup",
|
|
4150
4163
|
"parameters": [
|
|
@@ -4175,7 +4188,7 @@
|
|
|
4175
4188
|
},
|
|
4176
4189
|
"locationInModule": {
|
|
4177
4190
|
"filename": "lib/cluster.ts",
|
|
4178
|
-
"line":
|
|
4191
|
+
"line": 469
|
|
4179
4192
|
},
|
|
4180
4193
|
"name": "asSecretAttachmentTarget",
|
|
4181
4194
|
"overrides": "aws-cdk-lib.aws_secretsmanager.ISecretAttachmentTarget",
|
|
@@ -4192,7 +4205,7 @@
|
|
|
4192
4205
|
},
|
|
4193
4206
|
"locationInModule": {
|
|
4194
4207
|
"filename": "lib/cluster.ts",
|
|
4195
|
-
"line":
|
|
4208
|
+
"line": 788
|
|
4196
4209
|
},
|
|
4197
4210
|
"name": "enableRebootForParameterChanges"
|
|
4198
4211
|
}
|
|
@@ -4207,7 +4220,7 @@
|
|
|
4207
4220
|
"immutable": true,
|
|
4208
4221
|
"locationInModule": {
|
|
4209
4222
|
"filename": "lib/cluster.ts",
|
|
4210
|
-
"line":
|
|
4223
|
+
"line": 507
|
|
4211
4224
|
},
|
|
4212
4225
|
"name": "clusterEndpoint",
|
|
4213
4226
|
"overrides": "@aws-cdk/aws-redshift-alpha.ICluster",
|
|
@@ -4223,7 +4236,7 @@
|
|
|
4223
4236
|
"immutable": true,
|
|
4224
4237
|
"locationInModule": {
|
|
4225
4238
|
"filename": "lib/cluster.ts",
|
|
4226
|
-
"line":
|
|
4239
|
+
"line": 502
|
|
4227
4240
|
},
|
|
4228
4241
|
"name": "clusterName",
|
|
4229
4242
|
"overrides": "@aws-cdk/aws-redshift-alpha.ICluster",
|
|
@@ -4239,7 +4252,7 @@
|
|
|
4239
4252
|
"immutable": true,
|
|
4240
4253
|
"locationInModule": {
|
|
4241
4254
|
"filename": "lib/cluster.ts",
|
|
4242
|
-
"line":
|
|
4255
|
+
"line": 512
|
|
4243
4256
|
},
|
|
4244
4257
|
"name": "connections",
|
|
4245
4258
|
"overrides": "aws-cdk-lib.aws_ec2.IConnectable",
|
|
@@ -4255,7 +4268,7 @@
|
|
|
4255
4268
|
"immutable": true,
|
|
4256
4269
|
"locationInModule": {
|
|
4257
4270
|
"filename": "lib/cluster.ts",
|
|
4258
|
-
"line":
|
|
4271
|
+
"line": 517
|
|
4259
4272
|
},
|
|
4260
4273
|
"name": "secret",
|
|
4261
4274
|
"optional": true,
|
|
@@ -4270,7 +4283,7 @@
|
|
|
4270
4283
|
},
|
|
4271
4284
|
"locationInModule": {
|
|
4272
4285
|
"filename": "lib/cluster.ts",
|
|
4273
|
-
"line":
|
|
4286
|
+
"line": 540
|
|
4274
4287
|
},
|
|
4275
4288
|
"name": "parameterGroup",
|
|
4276
4289
|
"optional": true,
|
|
@@ -4297,7 +4310,7 @@
|
|
|
4297
4310
|
"kind": "interface",
|
|
4298
4311
|
"locationInModule": {
|
|
4299
4312
|
"filename": "lib/cluster.ts",
|
|
4300
|
-
"line":
|
|
4313
|
+
"line": 211
|
|
4301
4314
|
},
|
|
4302
4315
|
"name": "ClusterAttributes",
|
|
4303
4316
|
"properties": [
|
|
@@ -4310,7 +4323,7 @@
|
|
|
4310
4323
|
"immutable": true,
|
|
4311
4324
|
"locationInModule": {
|
|
4312
4325
|
"filename": "lib/cluster.ts",
|
|
4313
|
-
"line":
|
|
4326
|
+
"line": 227
|
|
4314
4327
|
},
|
|
4315
4328
|
"name": "clusterEndpointAddress",
|
|
4316
4329
|
"type": {
|
|
@@ -4326,7 +4339,7 @@
|
|
|
4326
4339
|
"immutable": true,
|
|
4327
4340
|
"locationInModule": {
|
|
4328
4341
|
"filename": "lib/cluster.ts",
|
|
4329
|
-
"line":
|
|
4342
|
+
"line": 232
|
|
4330
4343
|
},
|
|
4331
4344
|
"name": "clusterEndpointPort",
|
|
4332
4345
|
"type": {
|
|
@@ -4342,7 +4355,7 @@
|
|
|
4342
4355
|
"immutable": true,
|
|
4343
4356
|
"locationInModule": {
|
|
4344
4357
|
"filename": "lib/cluster.ts",
|
|
4345
|
-
"line":
|
|
4358
|
+
"line": 222
|
|
4346
4359
|
},
|
|
4347
4360
|
"name": "clusterName",
|
|
4348
4361
|
"type": {
|
|
@@ -4359,7 +4372,7 @@
|
|
|
4359
4372
|
"immutable": true,
|
|
4360
4373
|
"locationInModule": {
|
|
4361
4374
|
"filename": "lib/cluster.ts",
|
|
4362
|
-
"line":
|
|
4375
|
+
"line": 217
|
|
4363
4376
|
},
|
|
4364
4377
|
"name": "securityGroups",
|
|
4365
4378
|
"optional": true,
|
|
@@ -4603,7 +4616,7 @@
|
|
|
4603
4616
|
"docs": {
|
|
4604
4617
|
"stability": "experimental",
|
|
4605
4618
|
"summary": "Properties for a new database cluster.",
|
|
4606
|
-
"example": "import * as ec2 from 'aws-cdk-lib/aws-ec2';\nimport * as
|
|
4619
|
+
"example": "import * as ec2 from 'aws-cdk-lib/aws-ec2';\nimport * as iam from 'aws-cdk-lib/aws-iam';\ndeclare const vpc: ec2.Vpc;\n\nconst defaultRole = new iam.Role(this, 'DefaultRole', {\n assumedBy: new iam.ServicePrincipal('redshift.amazonaws.com'),\n},\n);\n\nnew Cluster(this, 'Redshift', {\n masterUser: {\n masterUsername: 'admin',\n },\n vpc,\n roles: [defaultRole],\n defaultRole: defaultRole,\n});",
|
|
4607
4620
|
"custom": {
|
|
4608
4621
|
"exampleMetadata": "infused"
|
|
4609
4622
|
}
|
|
@@ -4612,7 +4625,7 @@
|
|
|
4612
4625
|
"kind": "interface",
|
|
4613
4626
|
"locationInModule": {
|
|
4614
4627
|
"filename": "lib/cluster.ts",
|
|
4615
|
-
"line":
|
|
4628
|
+
"line": 239
|
|
4616
4629
|
},
|
|
4617
4630
|
"name": "ClusterProps",
|
|
4618
4631
|
"properties": [
|
|
@@ -4625,7 +4638,7 @@
|
|
|
4625
4638
|
"immutable": true,
|
|
4626
4639
|
"locationInModule": {
|
|
4627
4640
|
"filename": "lib/cluster.ts",
|
|
4628
|
-
"line":
|
|
4641
|
+
"line": 339
|
|
4629
4642
|
},
|
|
4630
4643
|
"name": "masterUser",
|
|
4631
4644
|
"type": {
|
|
@@ -4641,7 +4654,7 @@
|
|
|
4641
4654
|
"immutable": true,
|
|
4642
4655
|
"locationInModule": {
|
|
4643
4656
|
"filename": "lib/cluster.ts",
|
|
4644
|
-
"line":
|
|
4657
|
+
"line": 313
|
|
4645
4658
|
},
|
|
4646
4659
|
"name": "vpc",
|
|
4647
4660
|
"type": {
|
|
@@ -4659,7 +4672,7 @@
|
|
|
4659
4672
|
"immutable": true,
|
|
4660
4673
|
"locationInModule": {
|
|
4661
4674
|
"filename": "lib/cluster.ts",
|
|
4662
|
-
"line":
|
|
4675
|
+
"line": 444
|
|
4663
4676
|
},
|
|
4664
4677
|
"name": "availabilityZoneRelocation",
|
|
4665
4678
|
"optional": true,
|
|
@@ -4679,7 +4692,7 @@
|
|
|
4679
4692
|
"immutable": true,
|
|
4680
4693
|
"locationInModule": {
|
|
4681
4694
|
"filename": "lib/cluster.ts",
|
|
4682
|
-
"line":
|
|
4695
|
+
"line": 397
|
|
4683
4696
|
},
|
|
4684
4697
|
"name": "classicResizing",
|
|
4685
4698
|
"optional": true,
|
|
@@ -4697,7 +4710,7 @@
|
|
|
4697
4710
|
"immutable": true,
|
|
4698
4711
|
"locationInModule": {
|
|
4699
4712
|
"filename": "lib/cluster.ts",
|
|
4700
|
-
"line":
|
|
4713
|
+
"line": 245
|
|
4701
4714
|
},
|
|
4702
4715
|
"name": "clusterName",
|
|
4703
4716
|
"optional": true,
|
|
@@ -4715,7 +4728,7 @@
|
|
|
4715
4728
|
"immutable": true,
|
|
4716
4729
|
"locationInModule": {
|
|
4717
4730
|
"filename": "lib/cluster.ts",
|
|
4718
|
-
"line":
|
|
4731
|
+
"line": 276
|
|
4719
4732
|
},
|
|
4720
4733
|
"name": "clusterType",
|
|
4721
4734
|
"optional": true,
|
|
@@ -4733,7 +4746,7 @@
|
|
|
4733
4746
|
"immutable": true,
|
|
4734
4747
|
"locationInModule": {
|
|
4735
4748
|
"filename": "lib/cluster.ts",
|
|
4736
|
-
"line":
|
|
4749
|
+
"line": 362
|
|
4737
4750
|
},
|
|
4738
4751
|
"name": "defaultDatabaseName",
|
|
4739
4752
|
"optional": true,
|
|
@@ -4752,7 +4765,7 @@
|
|
|
4752
4765
|
"immutable": true,
|
|
4753
4766
|
"locationInModule": {
|
|
4754
4767
|
"filename": "lib/cluster.ts",
|
|
4755
|
-
"line":
|
|
4768
|
+
"line": 355
|
|
4756
4769
|
},
|
|
4757
4770
|
"name": "defaultRole",
|
|
4758
4771
|
"optional": true,
|
|
@@ -4771,7 +4784,7 @@
|
|
|
4771
4784
|
"immutable": true,
|
|
4772
4785
|
"locationInModule": {
|
|
4773
4786
|
"filename": "lib/cluster.ts",
|
|
4774
|
-
"line":
|
|
4787
|
+
"line": 406
|
|
4775
4788
|
},
|
|
4776
4789
|
"name": "elasticIp",
|
|
4777
4790
|
"optional": true,
|
|
@@ -4789,7 +4802,7 @@
|
|
|
4789
4802
|
"immutable": true,
|
|
4790
4803
|
"locationInModule": {
|
|
4791
4804
|
"filename": "lib/cluster.ts",
|
|
4792
|
-
"line":
|
|
4805
|
+
"line": 290
|
|
4793
4806
|
},
|
|
4794
4807
|
"name": "encrypted",
|
|
4795
4808
|
"optional": true,
|
|
@@ -4807,7 +4820,7 @@
|
|
|
4807
4820
|
"immutable": true,
|
|
4808
4821
|
"locationInModule": {
|
|
4809
4822
|
"filename": "lib/cluster.ts",
|
|
4810
|
-
"line":
|
|
4823
|
+
"line": 297
|
|
4811
4824
|
},
|
|
4812
4825
|
"name": "encryptionKey",
|
|
4813
4826
|
"optional": true,
|
|
@@ -4826,7 +4839,7 @@
|
|
|
4826
4839
|
"immutable": true,
|
|
4827
4840
|
"locationInModule": {
|
|
4828
4841
|
"filename": "lib/cluster.ts",
|
|
4829
|
-
"line":
|
|
4842
|
+
"line": 421
|
|
4830
4843
|
},
|
|
4831
4844
|
"name": "enhancedVpcRouting",
|
|
4832
4845
|
"optional": true,
|
|
@@ -4844,7 +4857,7 @@
|
|
|
4844
4857
|
"immutable": true,
|
|
4845
4858
|
"locationInModule": {
|
|
4846
4859
|
"filename": "lib/cluster.ts",
|
|
4847
|
-
"line":
|
|
4860
|
+
"line": 369
|
|
4848
4861
|
},
|
|
4849
4862
|
"name": "loggingProperties",
|
|
4850
4863
|
"optional": true,
|
|
@@ -4862,7 +4875,7 @@
|
|
|
4862
4875
|
"immutable": true,
|
|
4863
4876
|
"locationInModule": {
|
|
4864
4877
|
"filename": "lib/cluster.ts",
|
|
4865
|
-
"line":
|
|
4878
|
+
"line": 428
|
|
4866
4879
|
},
|
|
4867
4880
|
"name": "multiAz",
|
|
4868
4881
|
"optional": true,
|
|
@@ -4880,7 +4893,7 @@
|
|
|
4880
4893
|
"immutable": true,
|
|
4881
4894
|
"locationInModule": {
|
|
4882
4895
|
"filename": "lib/cluster.ts",
|
|
4883
|
-
"line":
|
|
4896
|
+
"line": 269
|
|
4884
4897
|
},
|
|
4885
4898
|
"name": "nodeType",
|
|
4886
4899
|
"optional": true,
|
|
@@ -4899,7 +4912,7 @@
|
|
|
4899
4912
|
"immutable": true,
|
|
4900
4913
|
"locationInModule": {
|
|
4901
4914
|
"filename": "lib/cluster.ts",
|
|
4902
|
-
"line":
|
|
4915
|
+
"line": 262
|
|
4903
4916
|
},
|
|
4904
4917
|
"name": "numberOfNodes",
|
|
4905
4918
|
"optional": true,
|
|
@@ -4917,7 +4930,7 @@
|
|
|
4917
4930
|
"immutable": true,
|
|
4918
4931
|
"locationInModule": {
|
|
4919
4932
|
"filename": "lib/cluster.ts",
|
|
4920
|
-
"line":
|
|
4933
|
+
"line": 253
|
|
4921
4934
|
},
|
|
4922
4935
|
"name": "parameterGroup",
|
|
4923
4936
|
"optional": true,
|
|
@@ -4935,7 +4948,7 @@
|
|
|
4935
4948
|
"immutable": true,
|
|
4936
4949
|
"locationInModule": {
|
|
4937
4950
|
"filename": "lib/cluster.ts",
|
|
4938
|
-
"line":
|
|
4951
|
+
"line": 283
|
|
4939
4952
|
},
|
|
4940
4953
|
"name": "port",
|
|
4941
4954
|
"optional": true,
|
|
@@ -4955,7 +4968,7 @@
|
|
|
4955
4968
|
"immutable": true,
|
|
4956
4969
|
"locationInModule": {
|
|
4957
4970
|
"filename": "lib/cluster.ts",
|
|
4958
|
-
"line":
|
|
4971
|
+
"line": 308
|
|
4959
4972
|
},
|
|
4960
4973
|
"name": "preferredMaintenanceWindow",
|
|
4961
4974
|
"optional": true,
|
|
@@ -4973,7 +4986,7 @@
|
|
|
4973
4986
|
"immutable": true,
|
|
4974
4987
|
"locationInModule": {
|
|
4975
4988
|
"filename": "lib/cluster.ts",
|
|
4976
|
-
"line":
|
|
4989
|
+
"line": 384
|
|
4977
4990
|
},
|
|
4978
4991
|
"name": "publiclyAccessible",
|
|
4979
4992
|
"optional": true,
|
|
@@ -4991,7 +5004,7 @@
|
|
|
4991
5004
|
"immutable": true,
|
|
4992
5005
|
"locationInModule": {
|
|
4993
5006
|
"filename": "lib/cluster.ts",
|
|
4994
|
-
"line":
|
|
5007
|
+
"line": 412
|
|
4995
5008
|
},
|
|
4996
5009
|
"name": "rebootForParameterChanges",
|
|
4997
5010
|
"optional": true,
|
|
@@ -5009,7 +5022,7 @@
|
|
|
5009
5022
|
"immutable": true,
|
|
5010
5023
|
"locationInModule": {
|
|
5011
5024
|
"filename": "lib/cluster.ts",
|
|
5012
|
-
"line":
|
|
5025
|
+
"line": 377
|
|
5013
5026
|
},
|
|
5014
5027
|
"name": "removalPolicy",
|
|
5015
5028
|
"optional": true,
|
|
@@ -5017,6 +5030,24 @@
|
|
|
5017
5030
|
"fqn": "aws-cdk-lib.RemovalPolicy"
|
|
5018
5031
|
}
|
|
5019
5032
|
},
|
|
5033
|
+
{
|
|
5034
|
+
"abstract": true,
|
|
5035
|
+
"docs": {
|
|
5036
|
+
"default": "- no operation",
|
|
5037
|
+
"stability": "experimental",
|
|
5038
|
+
"summary": "The Amazon Redshift operation to be performed."
|
|
5039
|
+
},
|
|
5040
|
+
"immutable": true,
|
|
5041
|
+
"locationInModule": {
|
|
5042
|
+
"filename": "lib/cluster.ts",
|
|
5043
|
+
"line": 435
|
|
5044
|
+
},
|
|
5045
|
+
"name": "resourceAction",
|
|
5046
|
+
"optional": true,
|
|
5047
|
+
"type": {
|
|
5048
|
+
"fqn": "@aws-cdk/aws-redshift-alpha.ResourceAction"
|
|
5049
|
+
}
|
|
5050
|
+
},
|
|
5020
5051
|
{
|
|
5021
5052
|
"abstract": true,
|
|
5022
5053
|
"docs": {
|
|
@@ -5028,7 +5059,7 @@
|
|
|
5028
5059
|
"immutable": true,
|
|
5029
5060
|
"locationInModule": {
|
|
5030
5061
|
"filename": "lib/cluster.ts",
|
|
5031
|
-
"line":
|
|
5062
|
+
"line": 347
|
|
5032
5063
|
},
|
|
5033
5064
|
"name": "roles",
|
|
5034
5065
|
"optional": true,
|
|
@@ -5051,7 +5082,7 @@
|
|
|
5051
5082
|
"immutable": true,
|
|
5052
5083
|
"locationInModule": {
|
|
5053
5084
|
"filename": "lib/cluster.ts",
|
|
5054
|
-
"line":
|
|
5085
|
+
"line": 327
|
|
5055
5086
|
},
|
|
5056
5087
|
"name": "securityGroups",
|
|
5057
5088
|
"optional": true,
|
|
@@ -5074,7 +5105,7 @@
|
|
|
5074
5105
|
"immutable": true,
|
|
5075
5106
|
"locationInModule": {
|
|
5076
5107
|
"filename": "lib/cluster.ts",
|
|
5077
|
-
"line":
|
|
5108
|
+
"line": 334
|
|
5078
5109
|
},
|
|
5079
5110
|
"name": "subnetGroup",
|
|
5080
5111
|
"optional": true,
|
|
@@ -5092,7 +5123,7 @@
|
|
|
5092
5123
|
"immutable": true,
|
|
5093
5124
|
"locationInModule": {
|
|
5094
5125
|
"filename": "lib/cluster.ts",
|
|
5095
|
-
"line":
|
|
5126
|
+
"line": 320
|
|
5096
5127
|
},
|
|
5097
5128
|
"name": "vpcSubnets",
|
|
5098
5129
|
"optional": true,
|
|
@@ -5314,7 +5345,7 @@
|
|
|
5314
5345
|
"kind": "enum",
|
|
5315
5346
|
"locationInModule": {
|
|
5316
5347
|
"filename": "lib/cluster.ts",
|
|
5317
|
-
"line":
|
|
5348
|
+
"line": 77
|
|
5318
5349
|
},
|
|
5319
5350
|
"members": [
|
|
5320
5351
|
{
|
|
@@ -5923,7 +5954,7 @@
|
|
|
5923
5954
|
"kind": "interface",
|
|
5924
5955
|
"locationInModule": {
|
|
5925
5956
|
"filename": "lib/cluster.ts",
|
|
5926
|
-
"line":
|
|
5957
|
+
"line": 192
|
|
5927
5958
|
},
|
|
5928
5959
|
"name": "ICluster",
|
|
5929
5960
|
"properties": [
|
|
@@ -5939,7 +5970,7 @@
|
|
|
5939
5970
|
"immutable": true,
|
|
5940
5971
|
"locationInModule": {
|
|
5941
5972
|
"filename": "lib/cluster.ts",
|
|
5942
|
-
"line":
|
|
5973
|
+
"line": 205
|
|
5943
5974
|
},
|
|
5944
5975
|
"name": "clusterEndpoint",
|
|
5945
5976
|
"type": {
|
|
@@ -5958,7 +5989,7 @@
|
|
|
5958
5989
|
"immutable": true,
|
|
5959
5990
|
"locationInModule": {
|
|
5960
5991
|
"filename": "lib/cluster.ts",
|
|
5961
|
-
"line":
|
|
5992
|
+
"line": 198
|
|
5962
5993
|
},
|
|
5963
5994
|
"name": "clusterName",
|
|
5964
5995
|
"type": {
|
|
@@ -6294,7 +6325,7 @@
|
|
|
6294
6325
|
"kind": "interface",
|
|
6295
6326
|
"locationInModule": {
|
|
6296
6327
|
"filename": "lib/cluster.ts",
|
|
6297
|
-
"line":
|
|
6328
|
+
"line": 146
|
|
6298
6329
|
},
|
|
6299
6330
|
"name": "LoggingProperties",
|
|
6300
6331
|
"properties": [
|
|
@@ -6308,7 +6339,7 @@
|
|
|
6308
6339
|
"immutable": true,
|
|
6309
6340
|
"locationInModule": {
|
|
6310
6341
|
"filename": "lib/cluster.ts",
|
|
6311
|
-
"line":
|
|
6342
|
+
"line": 151
|
|
6312
6343
|
},
|
|
6313
6344
|
"name": "loggingBucket",
|
|
6314
6345
|
"type": {
|
|
@@ -6324,7 +6355,7 @@
|
|
|
6324
6355
|
"immutable": true,
|
|
6325
6356
|
"locationInModule": {
|
|
6326
6357
|
"filename": "lib/cluster.ts",
|
|
6327
|
-
"line":
|
|
6358
|
+
"line": 156
|
|
6328
6359
|
},
|
|
6329
6360
|
"name": "loggingKeyPrefix",
|
|
6330
6361
|
"type": {
|
|
@@ -6349,7 +6380,7 @@
|
|
|
6349
6380
|
"kind": "interface",
|
|
6350
6381
|
"locationInModule": {
|
|
6351
6382
|
"filename": "lib/cluster.ts",
|
|
6352
|
-
"line":
|
|
6383
|
+
"line": 113
|
|
6353
6384
|
},
|
|
6354
6385
|
"name": "Login",
|
|
6355
6386
|
"properties": [
|
|
@@ -6362,7 +6393,7 @@
|
|
|
6362
6393
|
"immutable": true,
|
|
6363
6394
|
"locationInModule": {
|
|
6364
6395
|
"filename": "lib/cluster.ts",
|
|
6365
|
-
"line":
|
|
6396
|
+
"line": 117
|
|
6366
6397
|
},
|
|
6367
6398
|
"name": "masterUsername",
|
|
6368
6399
|
"type": {
|
|
@@ -6379,7 +6410,7 @@
|
|
|
6379
6410
|
"immutable": true,
|
|
6380
6411
|
"locationInModule": {
|
|
6381
6412
|
"filename": "lib/cluster.ts",
|
|
6382
|
-
"line":
|
|
6413
|
+
"line": 133
|
|
6383
6414
|
},
|
|
6384
6415
|
"name": "encryptionKey",
|
|
6385
6416
|
"optional": true,
|
|
@@ -6397,7 +6428,7 @@
|
|
|
6397
6428
|
"immutable": true,
|
|
6398
6429
|
"locationInModule": {
|
|
6399
6430
|
"filename": "lib/cluster.ts",
|
|
6400
|
-
"line":
|
|
6431
|
+
"line": 140
|
|
6401
6432
|
},
|
|
6402
6433
|
"name": "excludeCharacters",
|
|
6403
6434
|
"optional": true,
|
|
@@ -6416,7 +6447,7 @@
|
|
|
6416
6447
|
"immutable": true,
|
|
6417
6448
|
"locationInModule": {
|
|
6418
6449
|
"filename": "lib/cluster.ts",
|
|
6419
|
-
"line":
|
|
6450
|
+
"line": 126
|
|
6420
6451
|
},
|
|
6421
6452
|
"name": "masterPassword",
|
|
6422
6453
|
"optional": true,
|
|
@@ -6486,6 +6517,13 @@
|
|
|
6486
6517
|
},
|
|
6487
6518
|
"name": "DC2_8XLARGE"
|
|
6488
6519
|
},
|
|
6520
|
+
{
|
|
6521
|
+
"docs": {
|
|
6522
|
+
"stability": "experimental",
|
|
6523
|
+
"summary": "ra3.large."
|
|
6524
|
+
},
|
|
6525
|
+
"name": "RA3_LARGE"
|
|
6526
|
+
},
|
|
6489
6527
|
{
|
|
6490
6528
|
"docs": {
|
|
6491
6529
|
"stability": "experimental",
|
|
@@ -6511,6 +6549,49 @@
|
|
|
6511
6549
|
"name": "NodeType",
|
|
6512
6550
|
"symbolId": "lib/cluster:NodeType"
|
|
6513
6551
|
},
|
|
6552
|
+
"@aws-cdk/aws-redshift-alpha.ResourceAction": {
|
|
6553
|
+
"assembly": "@aws-cdk/aws-redshift-alpha",
|
|
6554
|
+
"docs": {
|
|
6555
|
+
"stability": "experimental",
|
|
6556
|
+
"summary": "The Amazon Redshift operation.",
|
|
6557
|
+
"example": "import * as ec2 from 'aws-cdk-lib/aws-ec2';\nimport { ResourceAction } from '@aws-cdk/aws-redshift-alpha';\n\ndeclare const vpc: ec2.IVpc;\n\n// Pause the cluster\nnew Cluster(this, 'PausedCluster', {\n masterUser: {\n masterUsername: 'admin',\n },\n vpc,\n resourceAction: ResourceAction.PAUSE,\n});\n\n// Resume the cluster\nnew Cluster(this, 'ResumedCluster', {\n masterUser: {\n masterUsername: 'admin',\n },\n vpc,\n resourceAction: ResourceAction.RESUME,\n});\n\n// Failover the cluster\nnew Cluster(this, 'FailOverCluster', {\n masterUser: {\n masterUsername: 'admin',\n },\n // VPC must have 3 AZs for the cluster which executes failover action\n vpc,\n // Must be a multi-AZ cluster to failover\n multiAz: true,\n resourceAction: ResourceAction.FAILOVER_PRIMARY_COMPUTE,\n});",
|
|
6558
|
+
"custom": {
|
|
6559
|
+
"exampleMetadata": "infused"
|
|
6560
|
+
}
|
|
6561
|
+
},
|
|
6562
|
+
"fqn": "@aws-cdk/aws-redshift-alpha.ResourceAction",
|
|
6563
|
+
"kind": "enum",
|
|
6564
|
+
"locationInModule": {
|
|
6565
|
+
"filename": "lib/cluster.ts",
|
|
6566
|
+
"line": 91
|
|
6567
|
+
},
|
|
6568
|
+
"members": [
|
|
6569
|
+
{
|
|
6570
|
+
"docs": {
|
|
6571
|
+
"stability": "experimental",
|
|
6572
|
+
"summary": "Pause the cluster."
|
|
6573
|
+
},
|
|
6574
|
+
"name": "PAUSE_CLUSTER"
|
|
6575
|
+
},
|
|
6576
|
+
{
|
|
6577
|
+
"docs": {
|
|
6578
|
+
"stability": "experimental",
|
|
6579
|
+
"summary": "Resume the cluster."
|
|
6580
|
+
},
|
|
6581
|
+
"name": "RESUME_CLUSTER"
|
|
6582
|
+
},
|
|
6583
|
+
{
|
|
6584
|
+
"docs": {
|
|
6585
|
+
"see": "https://docs.aws.amazon.com/redshift/latest/mgmt/test-cluster-multi-az.html",
|
|
6586
|
+
"stability": "experimental",
|
|
6587
|
+
"summary": "Failing over to the other availability zone."
|
|
6588
|
+
},
|
|
6589
|
+
"name": "FAILOVER_PRIMARY_COMPUTE"
|
|
6590
|
+
}
|
|
6591
|
+
],
|
|
6592
|
+
"name": "ResourceAction",
|
|
6593
|
+
"symbolId": "lib/cluster:ResourceAction"
|
|
6594
|
+
},
|
|
6514
6595
|
"@aws-cdk/aws-redshift-alpha.RotationMultiUserOptions": {
|
|
6515
6596
|
"assembly": "@aws-cdk/aws-redshift-alpha",
|
|
6516
6597
|
"datatype": true,
|
|
@@ -6526,7 +6607,7 @@
|
|
|
6526
6607
|
"kind": "interface",
|
|
6527
6608
|
"locationInModule": {
|
|
6528
6609
|
"filename": "lib/cluster.ts",
|
|
6529
|
-
"line":
|
|
6610
|
+
"line": 162
|
|
6530
6611
|
},
|
|
6531
6612
|
"name": "RotationMultiUserOptions",
|
|
6532
6613
|
"properties": [
|
|
@@ -6540,7 +6621,7 @@
|
|
|
6540
6621
|
"immutable": true,
|
|
6541
6622
|
"locationInModule": {
|
|
6542
6623
|
"filename": "lib/cluster.ts",
|
|
6543
|
-
"line":
|
|
6624
|
+
"line": 177
|
|
6544
6625
|
},
|
|
6545
6626
|
"name": "secret",
|
|
6546
6627
|
"type": {
|
|
@@ -6557,7 +6638,7 @@
|
|
|
6557
6638
|
"immutable": true,
|
|
6558
6639
|
"locationInModule": {
|
|
6559
6640
|
"filename": "lib/cluster.ts",
|
|
6560
|
-
"line":
|
|
6641
|
+
"line": 185
|
|
6561
6642
|
},
|
|
6562
6643
|
"name": "automaticallyAfter",
|
|
6563
6644
|
"optional": true,
|
|
@@ -7580,6 +7661,6 @@
|
|
|
7580
7661
|
"symbolId": "lib/user:UserProps"
|
|
7581
7662
|
}
|
|
7582
7663
|
},
|
|
7583
|
-
"version": "2.
|
|
7664
|
+
"version": "2.173.0-alpha.0",
|
|
7584
7665
|
"fingerprint": "**********"
|
|
7585
7666
|
}
|