@aws-cdk/aws-redshift-alpha 2.67.0-alpha.0 → 2.68.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 +237 -43
- package/.jsii.tabl.json.gz +0 -0
- package/.warnings.jsii.js +13 -1
- package/README.md +46 -6
- package/lib/cluster.js +1 -1
- package/lib/database-secret.js +1 -1
- package/lib/endpoint.js +1 -1
- package/lib/parameter-group.js +1 -1
- package/lib/private/database-query-provider/table.js +52 -6
- package/lib/private/handler-props.d.ts +1 -0
- package/lib/private/handler-props.js +1 -1
- package/lib/subnet-group.js +1 -1
- package/lib/table.d.ts +118 -2
- package/lib/table.js +115 -3
- package/lib/user.js +1 -1
- package/package.json +9 -9
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.68.0",
|
|
12
12
|
"constructs": "^10.0.0"
|
|
13
13
|
},
|
|
14
14
|
"dependencyClosure": {
|
|
@@ -3349,7 +3349,7 @@
|
|
|
3349
3349
|
"stability": "experimental"
|
|
3350
3350
|
},
|
|
3351
3351
|
"homepage": "https://github.com/aws/aws-cdk",
|
|
3352
|
-
"jsiiVersion": "1.
|
|
3352
|
+
"jsiiVersion": "1.77.0 (build 3e5fa88)",
|
|
3353
3353
|
"keywords": [
|
|
3354
3354
|
"aws",
|
|
3355
3355
|
"cdk",
|
|
@@ -3370,7 +3370,7 @@
|
|
|
3370
3370
|
},
|
|
3371
3371
|
"name": "@aws-cdk/aws-redshift-alpha",
|
|
3372
3372
|
"readme": {
|
|
3373
|
-
"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.\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', 'logging-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## 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\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\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 can also be configured with a comment:\n\n```ts fixture=cluster\nnew Table(this, 'Table', {\n tableColumns: [\n { name: 'col1', dataType: 'varchar(4)' },\n { name: 'col2', dataType: 'float' }\n ],\n cluster: cluster,\n databaseName: 'databaseName',\n comment: 'This is a comment',\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\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\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(stack, '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\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(stack, '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\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\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"
|
|
3373
|
+
"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.\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', 'logging-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## 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\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\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\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"
|
|
3374
3374
|
},
|
|
3375
3375
|
"repository": {
|
|
3376
3376
|
"directory": "packages/individual-packages/aws-redshift",
|
|
@@ -4766,7 +4766,7 @@
|
|
|
4766
4766
|
"docs": {
|
|
4767
4767
|
"stability": "experimental",
|
|
4768
4768
|
"summary": "A column in a Redshift table.",
|
|
4769
|
-
"example": "// The code below shows an example of how to instantiate this type.\n// The values are placeholders you should change.\nimport * as redshift_alpha from '@aws-cdk/aws-redshift-alpha';\nconst column: redshift_alpha.Column = {\n dataType: 'dataType',\n name: 'name',\n\n // the properties below are optional\n distKey: false,\n sortKey: false,\n};",
|
|
4769
|
+
"example": "// The code below shows an example of how to instantiate this type.\n// The values are placeholders you should change.\nimport * as redshift_alpha from '@aws-cdk/aws-redshift-alpha';\nconst column: redshift_alpha.Column = {\n dataType: 'dataType',\n name: 'name',\n\n // the properties below are optional\n comment: 'comment',\n distKey: false,\n encoding: redshift_alpha.ColumnEncoding.AUTO,\n id: 'id',\n sortKey: false,\n};",
|
|
4770
4770
|
"custom": {
|
|
4771
4771
|
"exampleMetadata": "fixture=_generated"
|
|
4772
4772
|
}
|
|
@@ -4775,7 +4775,7 @@
|
|
|
4775
4775
|
"kind": "interface",
|
|
4776
4776
|
"locationInModule": {
|
|
4777
4777
|
"filename": "lib/table.ts",
|
|
4778
|
-
"line":
|
|
4778
|
+
"line": 58
|
|
4779
4779
|
},
|
|
4780
4780
|
"name": "Column",
|
|
4781
4781
|
"properties": [
|
|
@@ -4788,7 +4788,7 @@
|
|
|
4788
4788
|
"immutable": true,
|
|
4789
4789
|
"locationInModule": {
|
|
4790
4790
|
"filename": "lib/table.ts",
|
|
4791
|
-
"line":
|
|
4791
|
+
"line": 78
|
|
4792
4792
|
},
|
|
4793
4793
|
"name": "dataType",
|
|
4794
4794
|
"type": {
|
|
@@ -4798,20 +4798,38 @@
|
|
|
4798
4798
|
{
|
|
4799
4799
|
"abstract": true,
|
|
4800
4800
|
"docs": {
|
|
4801
|
-
"remarks": "
|
|
4801
|
+
"remarks": "This will appear on Amazon Redshift.",
|
|
4802
4802
|
"stability": "experimental",
|
|
4803
|
-
"summary": "The
|
|
4803
|
+
"summary": "The name of the column."
|
|
4804
4804
|
},
|
|
4805
4805
|
"immutable": true,
|
|
4806
4806
|
"locationInModule": {
|
|
4807
4807
|
"filename": "lib/table.ts",
|
|
4808
|
-
"line":
|
|
4808
|
+
"line": 73
|
|
4809
4809
|
},
|
|
4810
4810
|
"name": "name",
|
|
4811
4811
|
"type": {
|
|
4812
4812
|
"primitive": "string"
|
|
4813
4813
|
}
|
|
4814
4814
|
},
|
|
4815
|
+
{
|
|
4816
|
+
"abstract": true,
|
|
4817
|
+
"docs": {
|
|
4818
|
+
"default": "- no comment",
|
|
4819
|
+
"stability": "experimental",
|
|
4820
|
+
"summary": "A comment to attach to the column."
|
|
4821
|
+
},
|
|
4822
|
+
"immutable": true,
|
|
4823
|
+
"locationInModule": {
|
|
4824
|
+
"filename": "lib/table.ts",
|
|
4825
|
+
"line": 106
|
|
4826
|
+
},
|
|
4827
|
+
"name": "comment",
|
|
4828
|
+
"optional": true,
|
|
4829
|
+
"type": {
|
|
4830
|
+
"primitive": "string"
|
|
4831
|
+
}
|
|
4832
|
+
},
|
|
4815
4833
|
{
|
|
4816
4834
|
"abstract": true,
|
|
4817
4835
|
"docs": {
|
|
@@ -4822,7 +4840,7 @@
|
|
|
4822
4840
|
"immutable": true,
|
|
4823
4841
|
"locationInModule": {
|
|
4824
4842
|
"filename": "lib/table.ts",
|
|
4825
|
-
"line":
|
|
4843
|
+
"line": 85
|
|
4826
4844
|
},
|
|
4827
4845
|
"name": "distKey",
|
|
4828
4846
|
"optional": true,
|
|
@@ -4830,6 +4848,43 @@
|
|
|
4830
4848
|
"primitive": "boolean"
|
|
4831
4849
|
}
|
|
4832
4850
|
},
|
|
4851
|
+
{
|
|
4852
|
+
"abstract": true,
|
|
4853
|
+
"docs": {
|
|
4854
|
+
"default": "- Amazon Redshift determines the encoding based on the data type.",
|
|
4855
|
+
"stability": "experimental",
|
|
4856
|
+
"summary": "The encoding to use for the column."
|
|
4857
|
+
},
|
|
4858
|
+
"immutable": true,
|
|
4859
|
+
"locationInModule": {
|
|
4860
|
+
"filename": "lib/table.ts",
|
|
4861
|
+
"line": 99
|
|
4862
|
+
},
|
|
4863
|
+
"name": "encoding",
|
|
4864
|
+
"optional": true,
|
|
4865
|
+
"type": {
|
|
4866
|
+
"fqn": "@aws-cdk/aws-redshift-alpha.ColumnEncoding"
|
|
4867
|
+
}
|
|
4868
|
+
},
|
|
4869
|
+
{
|
|
4870
|
+
"abstract": true,
|
|
4871
|
+
"docs": {
|
|
4872
|
+
"default": "- the column name is used as the identifier",
|
|
4873
|
+
"remarks": "This is not the name of the column, and renaming this identifier will cause a new column to be created and the old column to be dropped.\n\n**NOTE** - This field will be set, however, only by setting the `@aws-cdk/aws-redshift:columnId` feature flag will this field be used.",
|
|
4874
|
+
"stability": "experimental",
|
|
4875
|
+
"summary": "The unique identifier of the column."
|
|
4876
|
+
},
|
|
4877
|
+
"immutable": true,
|
|
4878
|
+
"locationInModule": {
|
|
4879
|
+
"filename": "lib/table.ts",
|
|
4880
|
+
"line": 68
|
|
4881
|
+
},
|
|
4882
|
+
"name": "id",
|
|
4883
|
+
"optional": true,
|
|
4884
|
+
"type": {
|
|
4885
|
+
"primitive": "string"
|
|
4886
|
+
}
|
|
4887
|
+
},
|
|
4833
4888
|
{
|
|
4834
4889
|
"abstract": true,
|
|
4835
4890
|
"docs": {
|
|
@@ -4840,7 +4895,7 @@
|
|
|
4840
4895
|
"immutable": true,
|
|
4841
4896
|
"locationInModule": {
|
|
4842
4897
|
"filename": "lib/table.ts",
|
|
4843
|
-
"line":
|
|
4898
|
+
"line": 92
|
|
4844
4899
|
},
|
|
4845
4900
|
"name": "sortKey",
|
|
4846
4901
|
"optional": true,
|
|
@@ -4851,6 +4906,145 @@
|
|
|
4851
4906
|
],
|
|
4852
4907
|
"symbolId": "lib/table:Column"
|
|
4853
4908
|
},
|
|
4909
|
+
"@aws-cdk/aws-redshift-alpha.ColumnEncoding": {
|
|
4910
|
+
"assembly": "@aws-cdk/aws-redshift-alpha",
|
|
4911
|
+
"docs": {
|
|
4912
|
+
"see": "https://docs.aws.amazon.com/redshift/latest/dg/c_Compression_encodings.html",
|
|
4913
|
+
"stability": "experimental",
|
|
4914
|
+
"summary": "The compression encoding of a column.",
|
|
4915
|
+
"example": "import { 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});",
|
|
4916
|
+
"custom": {
|
|
4917
|
+
"exampleMetadata": "fixture=cluster infused"
|
|
4918
|
+
}
|
|
4919
|
+
},
|
|
4920
|
+
"fqn": "@aws-cdk/aws-redshift-alpha.ColumnEncoding",
|
|
4921
|
+
"kind": "enum",
|
|
4922
|
+
"locationInModule": {
|
|
4923
|
+
"filename": "lib/table.ts",
|
|
4924
|
+
"line": 394
|
|
4925
|
+
},
|
|
4926
|
+
"members": [
|
|
4927
|
+
{
|
|
4928
|
+
"docs": {
|
|
4929
|
+
"remarks": "This is the default.",
|
|
4930
|
+
"stability": "experimental",
|
|
4931
|
+
"summary": "Amazon Redshift assigns an optimal encoding based on the column data."
|
|
4932
|
+
},
|
|
4933
|
+
"name": "AUTO"
|
|
4934
|
+
},
|
|
4935
|
+
{
|
|
4936
|
+
"docs": {
|
|
4937
|
+
"see": "https://docs.aws.amazon.com/redshift/latest/dg/c_Raw_encoding.html",
|
|
4938
|
+
"stability": "experimental",
|
|
4939
|
+
"summary": "The column is not compressed."
|
|
4940
|
+
},
|
|
4941
|
+
"name": "RAW"
|
|
4942
|
+
},
|
|
4943
|
+
{
|
|
4944
|
+
"docs": {
|
|
4945
|
+
"see": "https://docs.aws.amazon.com/redshift/latest/dg/az64-encoding.html",
|
|
4946
|
+
"stability": "experimental",
|
|
4947
|
+
"summary": "The column is compressed using the AZ64 algorithm."
|
|
4948
|
+
},
|
|
4949
|
+
"name": "AZ64"
|
|
4950
|
+
},
|
|
4951
|
+
{
|
|
4952
|
+
"docs": {
|
|
4953
|
+
"see": "https://docs.aws.amazon.com/redshift/latest/dg/c_Byte_dictionary_encoding.html",
|
|
4954
|
+
"stability": "experimental",
|
|
4955
|
+
"summary": "The column is compressed using a separate dictionary for each block column value on disk."
|
|
4956
|
+
},
|
|
4957
|
+
"name": "BYTEDICT"
|
|
4958
|
+
},
|
|
4959
|
+
{
|
|
4960
|
+
"docs": {
|
|
4961
|
+
"remarks": "This records differences as 1-byte values.",
|
|
4962
|
+
"see": "https://docs.aws.amazon.com/redshift/latest/dg/c_Delta_encoding.html",
|
|
4963
|
+
"stability": "experimental",
|
|
4964
|
+
"summary": "The column is compressed based on the difference between values in the column."
|
|
4965
|
+
},
|
|
4966
|
+
"name": "DELTA"
|
|
4967
|
+
},
|
|
4968
|
+
{
|
|
4969
|
+
"docs": {
|
|
4970
|
+
"remarks": "This records differences as 2-byte values.",
|
|
4971
|
+
"see": "https://docs.aws.amazon.com/redshift/latest/dg/c_Delta_encoding.html",
|
|
4972
|
+
"stability": "experimental",
|
|
4973
|
+
"summary": "The column is compressed based on the difference between values in the column."
|
|
4974
|
+
},
|
|
4975
|
+
"name": "DELTA32K"
|
|
4976
|
+
},
|
|
4977
|
+
{
|
|
4978
|
+
"docs": {
|
|
4979
|
+
"see": "https://docs.aws.amazon.com/redshift/latest/dg/lzo-encoding.html",
|
|
4980
|
+
"stability": "experimental",
|
|
4981
|
+
"summary": "The column is compressed using the LZO algorithm."
|
|
4982
|
+
},
|
|
4983
|
+
"name": "LZO"
|
|
4984
|
+
},
|
|
4985
|
+
{
|
|
4986
|
+
"docs": {
|
|
4987
|
+
"remarks": "The compressed storage size is 1 byte.",
|
|
4988
|
+
"see": "https://docs.aws.amazon.com/redshift/latest/dg/c_MostlyN_encoding.html",
|
|
4989
|
+
"stability": "experimental",
|
|
4990
|
+
"summary": "The column is compressed to a smaller storage size than the original data type."
|
|
4991
|
+
},
|
|
4992
|
+
"name": "MOSTLY8"
|
|
4993
|
+
},
|
|
4994
|
+
{
|
|
4995
|
+
"docs": {
|
|
4996
|
+
"remarks": "The compressed storage size is 2 bytes.",
|
|
4997
|
+
"see": "https://docs.aws.amazon.com/redshift/latest/dg/c_MostlyN_encoding.html",
|
|
4998
|
+
"stability": "experimental",
|
|
4999
|
+
"summary": "The column is compressed to a smaller storage size than the original data type."
|
|
5000
|
+
},
|
|
5001
|
+
"name": "MOSTLY16"
|
|
5002
|
+
},
|
|
5003
|
+
{
|
|
5004
|
+
"docs": {
|
|
5005
|
+
"remarks": "The compressed storage size is 4 bytes.",
|
|
5006
|
+
"see": "https://docs.aws.amazon.com/redshift/latest/dg/c_MostlyN_encoding.html",
|
|
5007
|
+
"stability": "experimental",
|
|
5008
|
+
"summary": "The column is compressed to a smaller storage size than the original data type."
|
|
5009
|
+
},
|
|
5010
|
+
"name": "MOSTLY32"
|
|
5011
|
+
},
|
|
5012
|
+
{
|
|
5013
|
+
"docs": {
|
|
5014
|
+
"see": "https://docs.aws.amazon.com/redshift/latest/dg/c_Runlength_encoding.html",
|
|
5015
|
+
"stability": "experimental",
|
|
5016
|
+
"summary": "The column is compressed by recording the number of occurrences of each value in the column."
|
|
5017
|
+
},
|
|
5018
|
+
"name": "RUNLENGTH"
|
|
5019
|
+
},
|
|
5020
|
+
{
|
|
5021
|
+
"docs": {
|
|
5022
|
+
"see": "https://docs.aws.amazon.com/redshift/latest/dg/c_Text255_encoding.html",
|
|
5023
|
+
"stability": "experimental",
|
|
5024
|
+
"summary": "The column is compressed by recording the first 245 unique words and then using a 1-byte index to represent each word."
|
|
5025
|
+
},
|
|
5026
|
+
"name": "TEXT255"
|
|
5027
|
+
},
|
|
5028
|
+
{
|
|
5029
|
+
"docs": {
|
|
5030
|
+
"see": "https://docs.aws.amazon.com/redshift/latest/dg/c_Text255_encoding.html",
|
|
5031
|
+
"stability": "experimental",
|
|
5032
|
+
"summary": "The column is compressed by recording the first 32K unique words and then using a 2-byte index to represent each word."
|
|
5033
|
+
},
|
|
5034
|
+
"name": "TEXT32K"
|
|
5035
|
+
},
|
|
5036
|
+
{
|
|
5037
|
+
"docs": {
|
|
5038
|
+
"see": "https://docs.aws.amazon.com/redshift/latest/dg/zstd-encoding.html",
|
|
5039
|
+
"stability": "experimental",
|
|
5040
|
+
"summary": "The column is compressed using the ZSTD algorithm."
|
|
5041
|
+
},
|
|
5042
|
+
"name": "ZSTD"
|
|
5043
|
+
}
|
|
5044
|
+
],
|
|
5045
|
+
"name": "ColumnEncoding",
|
|
5046
|
+
"symbolId": "lib/table:ColumnEncoding"
|
|
5047
|
+
},
|
|
4854
5048
|
"@aws-cdk/aws-redshift-alpha.DatabaseOptions": {
|
|
4855
5049
|
"assembly": "@aws-cdk/aws-redshift-alpha",
|
|
4856
5050
|
"datatype": true,
|
|
@@ -5272,7 +5466,7 @@
|
|
|
5272
5466
|
"kind": "interface",
|
|
5273
5467
|
"locationInModule": {
|
|
5274
5468
|
"filename": "lib/table.ts",
|
|
5275
|
-
"line":
|
|
5469
|
+
"line": 157
|
|
5276
5470
|
},
|
|
5277
5471
|
"methods": [
|
|
5278
5472
|
{
|
|
@@ -5283,7 +5477,7 @@
|
|
|
5283
5477
|
},
|
|
5284
5478
|
"locationInModule": {
|
|
5285
5479
|
"filename": "lib/table.ts",
|
|
5286
|
-
"line":
|
|
5480
|
+
"line": 181
|
|
5287
5481
|
},
|
|
5288
5482
|
"name": "grant",
|
|
5289
5483
|
"parameters": [
|
|
@@ -5315,7 +5509,7 @@
|
|
|
5315
5509
|
"immutable": true,
|
|
5316
5510
|
"locationInModule": {
|
|
5317
5511
|
"filename": "lib/table.ts",
|
|
5318
|
-
"line":
|
|
5512
|
+
"line": 171
|
|
5319
5513
|
},
|
|
5320
5514
|
"name": "cluster",
|
|
5321
5515
|
"type": {
|
|
@@ -5331,7 +5525,7 @@
|
|
|
5331
5525
|
"immutable": true,
|
|
5332
5526
|
"locationInModule": {
|
|
5333
5527
|
"filename": "lib/table.ts",
|
|
5334
|
-
"line":
|
|
5528
|
+
"line": 176
|
|
5335
5529
|
},
|
|
5336
5530
|
"name": "databaseName",
|
|
5337
5531
|
"type": {
|
|
@@ -5347,7 +5541,7 @@
|
|
|
5347
5541
|
"immutable": true,
|
|
5348
5542
|
"locationInModule": {
|
|
5349
5543
|
"filename": "lib/table.ts",
|
|
5350
|
-
"line":
|
|
5544
|
+
"line": 166
|
|
5351
5545
|
},
|
|
5352
5546
|
"name": "tableColumns",
|
|
5353
5547
|
"type": {
|
|
@@ -5368,7 +5562,7 @@
|
|
|
5368
5562
|
"immutable": true,
|
|
5369
5563
|
"locationInModule": {
|
|
5370
5564
|
"filename": "lib/table.ts",
|
|
5371
|
-
"line":
|
|
5565
|
+
"line": 161
|
|
5372
5566
|
},
|
|
5373
5567
|
"name": "tableName",
|
|
5374
5568
|
"type": {
|
|
@@ -5553,7 +5747,7 @@
|
|
|
5553
5747
|
"docs": {
|
|
5554
5748
|
"stability": "experimental",
|
|
5555
5749
|
"summary": "Username and password combination.",
|
|
5556
|
-
"example": "import * 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
|
|
5750
|
+
"example": "import * 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})",
|
|
5557
5751
|
"custom": {
|
|
5558
5752
|
"exampleMetadata": "infused"
|
|
5559
5753
|
}
|
|
@@ -5777,7 +5971,7 @@
|
|
|
5777
5971
|
},
|
|
5778
5972
|
"locationInModule": {
|
|
5779
5973
|
"filename": "lib/table.ts",
|
|
5780
|
-
"line":
|
|
5974
|
+
"line": 242
|
|
5781
5975
|
},
|
|
5782
5976
|
"parameters": [
|
|
5783
5977
|
{
|
|
@@ -5806,7 +6000,7 @@
|
|
|
5806
6000
|
"kind": "class",
|
|
5807
6001
|
"locationInModule": {
|
|
5808
6002
|
"filename": "lib/table.ts",
|
|
5809
|
-
"line":
|
|
6003
|
+
"line": 222
|
|
5810
6004
|
},
|
|
5811
6005
|
"methods": [
|
|
5812
6006
|
{
|
|
@@ -5816,7 +6010,7 @@
|
|
|
5816
6010
|
},
|
|
5817
6011
|
"locationInModule": {
|
|
5818
6012
|
"filename": "lib/table.ts",
|
|
5819
|
-
"line":
|
|
6013
|
+
"line": 226
|
|
5820
6014
|
},
|
|
5821
6015
|
"name": "fromTableAttributes",
|
|
5822
6016
|
"parameters": [
|
|
@@ -5854,7 +6048,7 @@
|
|
|
5854
6048
|
},
|
|
5855
6049
|
"locationInModule": {
|
|
5856
6050
|
"filename": "lib/table.ts",
|
|
5857
|
-
"line":
|
|
6051
|
+
"line": 293
|
|
5858
6052
|
},
|
|
5859
6053
|
"name": "applyRemovalPolicy",
|
|
5860
6054
|
"parameters": [
|
|
@@ -5873,7 +6067,7 @@
|
|
|
5873
6067
|
},
|
|
5874
6068
|
"locationInModule": {
|
|
5875
6069
|
"filename": "lib/table.ts",
|
|
5876
|
-
"line":
|
|
6070
|
+
"line": 214
|
|
5877
6071
|
},
|
|
5878
6072
|
"name": "grant",
|
|
5879
6073
|
"overrides": "@aws-cdk/aws-redshift-alpha.ITable",
|
|
@@ -5905,7 +6099,7 @@
|
|
|
5905
6099
|
"immutable": true,
|
|
5906
6100
|
"locationInModule": {
|
|
5907
6101
|
"filename": "lib/table.ts",
|
|
5908
|
-
"line":
|
|
6102
|
+
"line": 237
|
|
5909
6103
|
},
|
|
5910
6104
|
"name": "cluster",
|
|
5911
6105
|
"overrides": "@aws-cdk/aws-redshift-alpha.ITable",
|
|
@@ -5921,7 +6115,7 @@
|
|
|
5921
6115
|
"immutable": true,
|
|
5922
6116
|
"locationInModule": {
|
|
5923
6117
|
"filename": "lib/table.ts",
|
|
5924
|
-
"line":
|
|
6118
|
+
"line": 238
|
|
5925
6119
|
},
|
|
5926
6120
|
"name": "databaseName",
|
|
5927
6121
|
"overrides": "@aws-cdk/aws-redshift-alpha.ITable",
|
|
@@ -5937,7 +6131,7 @@
|
|
|
5937
6131
|
"immutable": true,
|
|
5938
6132
|
"locationInModule": {
|
|
5939
6133
|
"filename": "lib/table.ts",
|
|
5940
|
-
"line":
|
|
6134
|
+
"line": 236
|
|
5941
6135
|
},
|
|
5942
6136
|
"name": "tableColumns",
|
|
5943
6137
|
"overrides": "@aws-cdk/aws-redshift-alpha.ITable",
|
|
@@ -5958,7 +6152,7 @@
|
|
|
5958
6152
|
"immutable": true,
|
|
5959
6153
|
"locationInModule": {
|
|
5960
6154
|
"filename": "lib/table.ts",
|
|
5961
|
-
"line":
|
|
6155
|
+
"line": 235
|
|
5962
6156
|
},
|
|
5963
6157
|
"name": "tableName",
|
|
5964
6158
|
"overrides": "@aws-cdk/aws-redshift-alpha.ITable",
|
|
@@ -5983,7 +6177,7 @@
|
|
|
5983
6177
|
"kind": "enum",
|
|
5984
6178
|
"locationInModule": {
|
|
5985
6179
|
"filename": "lib/table.ts",
|
|
5986
|
-
"line":
|
|
6180
|
+
"line": 16
|
|
5987
6181
|
},
|
|
5988
6182
|
"members": [
|
|
5989
6183
|
{
|
|
@@ -6055,7 +6249,7 @@
|
|
|
6055
6249
|
"kind": "interface",
|
|
6056
6250
|
"locationInModule": {
|
|
6057
6251
|
"filename": "lib/table.ts",
|
|
6058
|
-
"line":
|
|
6252
|
+
"line": 187
|
|
6059
6253
|
},
|
|
6060
6254
|
"name": "TableAttributes",
|
|
6061
6255
|
"properties": [
|
|
@@ -6068,7 +6262,7 @@
|
|
|
6068
6262
|
"immutable": true,
|
|
6069
6263
|
"locationInModule": {
|
|
6070
6264
|
"filename": "lib/table.ts",
|
|
6071
|
-
"line":
|
|
6265
|
+
"line": 201
|
|
6072
6266
|
},
|
|
6073
6267
|
"name": "cluster",
|
|
6074
6268
|
"type": {
|
|
@@ -6084,7 +6278,7 @@
|
|
|
6084
6278
|
"immutable": true,
|
|
6085
6279
|
"locationInModule": {
|
|
6086
6280
|
"filename": "lib/table.ts",
|
|
6087
|
-
"line":
|
|
6281
|
+
"line": 206
|
|
6088
6282
|
},
|
|
6089
6283
|
"name": "databaseName",
|
|
6090
6284
|
"type": {
|
|
@@ -6100,7 +6294,7 @@
|
|
|
6100
6294
|
"immutable": true,
|
|
6101
6295
|
"locationInModule": {
|
|
6102
6296
|
"filename": "lib/table.ts",
|
|
6103
|
-
"line":
|
|
6297
|
+
"line": 196
|
|
6104
6298
|
},
|
|
6105
6299
|
"name": "tableColumns",
|
|
6106
6300
|
"type": {
|
|
@@ -6121,7 +6315,7 @@
|
|
|
6121
6315
|
"immutable": true,
|
|
6122
6316
|
"locationInModule": {
|
|
6123
6317
|
"filename": "lib/table.ts",
|
|
6124
|
-
"line":
|
|
6318
|
+
"line": 191
|
|
6125
6319
|
},
|
|
6126
6320
|
"name": "tableName",
|
|
6127
6321
|
"type": {
|
|
@@ -6145,7 +6339,7 @@
|
|
|
6145
6339
|
"kind": "enum",
|
|
6146
6340
|
"locationInModule": {
|
|
6147
6341
|
"filename": "lib/table.ts",
|
|
6148
|
-
"line":
|
|
6342
|
+
"line": 346
|
|
6149
6343
|
},
|
|
6150
6344
|
"members": [
|
|
6151
6345
|
{
|
|
@@ -6198,7 +6392,7 @@
|
|
|
6198
6392
|
"kind": "interface",
|
|
6199
6393
|
"locationInModule": {
|
|
6200
6394
|
"filename": "lib/table.ts",
|
|
6201
|
-
"line":
|
|
6395
|
+
"line": 112
|
|
6202
6396
|
},
|
|
6203
6397
|
"name": "TableProps",
|
|
6204
6398
|
"properties": [
|
|
@@ -6211,7 +6405,7 @@
|
|
|
6211
6405
|
"immutable": true,
|
|
6212
6406
|
"locationInModule": {
|
|
6213
6407
|
"filename": "lib/table.ts",
|
|
6214
|
-
"line":
|
|
6408
|
+
"line": 123
|
|
6215
6409
|
},
|
|
6216
6410
|
"name": "tableColumns",
|
|
6217
6411
|
"type": {
|
|
@@ -6233,7 +6427,7 @@
|
|
|
6233
6427
|
"immutable": true,
|
|
6234
6428
|
"locationInModule": {
|
|
6235
6429
|
"filename": "lib/table.ts",
|
|
6236
|
-
"line":
|
|
6430
|
+
"line": 130
|
|
6237
6431
|
},
|
|
6238
6432
|
"name": "distStyle",
|
|
6239
6433
|
"optional": true,
|
|
@@ -6251,7 +6445,7 @@
|
|
|
6251
6445
|
"immutable": true,
|
|
6252
6446
|
"locationInModule": {
|
|
6253
6447
|
"filename": "lib/table.ts",
|
|
6254
|
-
"line":
|
|
6448
|
+
"line": 144
|
|
6255
6449
|
},
|
|
6256
6450
|
"name": "removalPolicy",
|
|
6257
6451
|
"optional": true,
|
|
@@ -6269,7 +6463,7 @@
|
|
|
6269
6463
|
"immutable": true,
|
|
6270
6464
|
"locationInModule": {
|
|
6271
6465
|
"filename": "lib/table.ts",
|
|
6272
|
-
"line":
|
|
6466
|
+
"line": 137
|
|
6273
6467
|
},
|
|
6274
6468
|
"name": "sortStyle",
|
|
6275
6469
|
"optional": true,
|
|
@@ -6287,7 +6481,7 @@
|
|
|
6287
6481
|
"immutable": true,
|
|
6288
6482
|
"locationInModule": {
|
|
6289
6483
|
"filename": "lib/table.ts",
|
|
6290
|
-
"line":
|
|
6484
|
+
"line": 151
|
|
6291
6485
|
},
|
|
6292
6486
|
"name": "tableComment",
|
|
6293
6487
|
"optional": true,
|
|
@@ -6305,7 +6499,7 @@
|
|
|
6305
6499
|
"immutable": true,
|
|
6306
6500
|
"locationInModule": {
|
|
6307
6501
|
"filename": "lib/table.ts",
|
|
6308
|
-
"line":
|
|
6502
|
+
"line": 118
|
|
6309
6503
|
},
|
|
6310
6504
|
"name": "tableName",
|
|
6311
6505
|
"optional": true,
|
|
@@ -6330,7 +6524,7 @@
|
|
|
6330
6524
|
"kind": "enum",
|
|
6331
6525
|
"locationInModule": {
|
|
6332
6526
|
"filename": "lib/table.ts",
|
|
6333
|
-
"line":
|
|
6527
|
+
"line": 371
|
|
6334
6528
|
},
|
|
6335
6529
|
"members": [
|
|
6336
6530
|
{
|
|
@@ -6734,6 +6928,6 @@
|
|
|
6734
6928
|
"symbolId": "lib/user:UserProps"
|
|
6735
6929
|
}
|
|
6736
6930
|
},
|
|
6737
|
-
"version": "2.
|
|
6931
|
+
"version": "2.68.0-alpha.0",
|
|
6738
6932
|
"fingerprint": "**********"
|
|
6739
6933
|
}
|