Experimental
@aws-cdk/aws-redshift-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.
TableProps Struct
Properties for configuring a Redshift table.
| Stability | Experimental |
|---|---|
| Source | lib/table.ts |
Example
ts
new Table(this, 'Table', {
tableColumns: [
{ name: 'col1', dataType: 'varchar(4)', distKey: true },
{ name: 'col2', dataType: 'float' },
],
cluster: cluster,
databaseName: 'databaseName',
distStyle: TableDistStyle.KEY,
});
java
Table.Builder.create(this, "Table")
.tableColumns(List.of(Column.builder().name("col1").dataType("varchar(4)").distKey(true).build(), Column.builder().name("col2").dataType("float").build()))
.cluster(cluster)
.databaseName("databaseName")
.distStyle(TableDistStyle.KEY)
.build();
csharp
// Install: dotnet add package Amazon.CDK.AWS.Redshift.Alpha
new Table(this, "Table", new TableProps {
TableColumns = new [] { new Column { Name = "col1", DataType = "varchar(4)", DistKey = true }, new Column { Name = "col2", DataType = "float" } },
Cluster = cluster,
DatabaseName = "databaseName",
DistStyle = TableDistStyle.KEY
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdkredshiftalpha/v2
awscdkredshiftalpha.NewTable(this, jsii.String("Table"), &TableProps{
TableColumns: []Column{
&Column{
Name: jsii.String("col1"),
DataType: jsii.String("varchar(4)"),
DistKey: jsii.Boolean(true),
},
&Column{
Name: jsii.String("col2"),
DataType: jsii.String("float"),
},
},
Cluster: cluster,
DatabaseName: jsii.String("databaseName"),
DistStyle: awscdkredshiftalpha.TableDistStyle_KEY,
})
Properties
adminUseroptionalISecretadmin_useroptionalISecretadminUseroptionalISecretAdminUseroptionalISecretAdminUseroptionalISecret #The secret containing credentials to a Redshift user with administrator privileges.
Default: the admin secret is taken from the cluster
Secret JSON schema: { username: string; password: string }.
The cluster containing the database.
databaseNamestringdatabase_namestrdatabaseNameStringDatabaseNamestringDatabaseName*string required #The name of the database.
distStyleoptionalTableDistStyledist_styleoptionalTableDistStyledistStyleoptionalTableDistStyleDistStyleoptionalTableDistStyleDistStyleoptionalTableDistStyle = TableDistStyle.AUTO #The distribution style of the table.
removalPolicyoptionalRemovalPolicyremoval_policyoptionalRemovalPolicyremovalPolicyoptionalRemovalPolicyRemovalPolicyoptionalRemovalPolicyRemovalPolicyoptionalRemovalPolicy = cdk.RemovalPolicy.Retain #The policy to apply when this resource is removed from the application.
sortStyleoptionalTableSortStylesort_styleoptionalTableSortStylesortStyleoptionalTableSortStyleSortStyleoptionalTableSortStyleSortStyleoptionalTableSortStyle #The sort style of the table.
Default: TableSortStyle.AUTO if no sort key is specified, TableSortStyle.COMPOUND if a sort key is specified
tableColumnsColumn[]table_columnstyping.List[Column]tableColumnsList<Column>TableColumnsColumn[]TableColumns*[]Column required #The columns of the table.
tableCommentoptionalstringtable_commentoptionalstrtableCommentoptionalStringTableCommentoptionalstringTableCommentoptional*string #A comment to attach to the table.
Default: no comment
tableNameoptionalstringtable_nameoptionalstrtableNameoptionalStringTableNameoptionalstringTableNameoptional*string #The name of the table.
Default: a name is generated
May be schema-qualified.