> **Experimental**
>
> `@aws-cdk/aws-redshift-alpha` is an [**experimental**](/stability) (alpha) package: its API may change in any release, without a major version bump.
# TableProps

Properties for configuring a Redshift table.

Extends: [DatabaseOptions](/cdk/api/v2/docs/@aws-cdk_aws-redshift-alpha.DatabaseOptions.html)
Used as props by: [Table](/cdk/api/v2/docs/@aws-cdk_aws-redshift-alpha.Table.html)

- Stability: [Experimental](/cdk/api/stability.html)
- Source: [`lib/table.ts`](https://github.com/aws/aws-cdk/blob/v2.277.0/packages/@aws-cdk/aws-redshift-alpha/lib/table.ts#L115)

## Example

TypeScript:

```ts
new Table(this, 'Table', {
  tableColumns: [
    { name: 'col1', dataType: 'varchar(4)', distKey: true },
    { name: 'col2', dataType: 'float' },
  ],
  cluster: cluster,
  databaseName: 'databaseName',
  distStyle: TableDistStyle.KEY,
});
```

Python:

```python
from aws_cdk.aws_redshift_alpha import Column, Column
Table(self, "Table",
    table_columns=[Column(name="col1", data_type="varchar(4)", dist_key=True), Column(name="col2", data_type="float")
    ],
    cluster=cluster,
    database_name="databaseName",
    dist_style=TableDistStyle.KEY
)
```

Java:

```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();
```

C# / .NET:

```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
});
```

Golang:

```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

- `adminUser`: [ISecret](/cdk/api/v2/docs/aws-cdk-lib.aws_secretsmanager.ISecret.html) — 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 }`.

- `cluster`: [ICluster](/cdk/api/v2/docs/@aws-cdk_aws-redshift-alpha.ICluster.html) (required) — The cluster containing the database.

- `databaseName`: string (required) — The name of the database.

- `distStyle`: [TableDistStyle](/cdk/api/v2/docs/@aws-cdk_aws-redshift-alpha.TableDistStyle.html) = TableDistStyle.AUTO — The distribution style of the table.

- `removalPolicy`: [RemovalPolicy](/cdk/api/v2/docs/aws-cdk-lib.RemovalPolicy.html) = cdk.RemovalPolicy.Retain — The policy to apply when this resource is removed from the application.

- `sortStyle`: [TableSortStyle](/cdk/api/v2/docs/@aws-cdk_aws-redshift-alpha.TableSortStyle.html) — The sort style of the table.

  **Default:** TableSortStyle.AUTO if no sort key is specified, TableSortStyle.COMPOUND if a sort key is specified

- `tableColumns`: [Column](/cdk/api/v2/docs/@aws-cdk_aws-redshift-alpha.Column.html)[] (required) — The columns of the table.

- `tableComment`: string — A comment to attach to the table.

  **Default:** no comment

- `tableName`: string — The name of the table.

  **Default:** a name is generated

  May be schema-qualified.

- `timeout`: [Duration](/cdk/api/v2/docs/aws-cdk-lib.Duration.html) — Handler timeout duration.

  **Default:** 1 minute

  Valid values are between 1 second and 15 minutes.
