@aws-cdk_aws-redshift-alpha.Table

class Table (construct) ๐Ÿ”น

LanguageType name
.NETAmazon.CDK.AWS.Redshift.Alpha.Table
Gogithub.com/aws/aws-cdk-go/awscdkredshiftalpha/v2#Table
Javasoftware.amazon.awscdk.services.redshift.alpha.Table
Pythonaws_cdk.aws_redshift_alpha.Table
TypeScript (source)@aws-cdk/aws-redshift-alpha ยป Table

Implements IConstruct, IDependable, ITable

A table in a Redshift cluster.

Example

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

Initializer

new Table(scope: Construct, id: string, props: TableProps)

Parameters

  • scope Construct
  • id string
  • props TableProps

Construct Props

NameTypeDescription
cluster๐Ÿ”นIClusterThe cluster containing the database.
databaseName๐Ÿ”นstringThe name of the database.
tableColumns๐Ÿ”นColumn[]The columns of the table.
adminUser?๐Ÿ”นISecretThe secret containing credentials to a Redshift user with administrator privileges.
distStyle?๐Ÿ”นTableDistStyleThe distribution style of the table.
removalPolicy?๐Ÿ”นRemovalPolicyThe policy to apply when this resource is removed from the application.
sortStyle?๐Ÿ”นTableSortStyleThe sort style of the table.
tableComment?๐Ÿ”นstringA comment to attach to the table.
tableName?๐Ÿ”นstringThe name of the table.

cluster๐Ÿ”น

Type: ICluster

The cluster containing the database.


databaseName๐Ÿ”น

Type: string

The name of the database.


tableColumns๐Ÿ”น

Type: Column[]

The columns of the table.


adminUser?๐Ÿ”น

Type: ISecret (optional, default: the admin secret is taken from the cluster)

The secret containing credentials to a Redshift user with administrator privileges.

Secret JSON schema: { username: string; password: string }.


distStyle?๐Ÿ”น

Type: TableDistStyle (optional, default: TableDistStyle.AUTO)

The distribution style of the table.


removalPolicy?๐Ÿ”น

Type: RemovalPolicy (optional, default: cdk.RemovalPolicy.Retain)

The policy to apply when this resource is removed from the application.


sortStyle?๐Ÿ”น

Type: TableSortStyle (optional, default: TableSortStyle.AUTO if no sort key is specified, TableSortStyle.COMPOUND if a sort key is specified)

The sort style of the table.


tableComment?๐Ÿ”น

Type: string (optional, default: no comment)

A comment to attach to the table.


tableName?๐Ÿ”น

Type: string (optional, default: a name is generated)

The name of the table.

Properties

NameTypeDescription
cluster๐Ÿ”นIClusterThe cluster where the table is located.
databaseName๐Ÿ”นstringThe name of the database where the table is located.
node๐Ÿ”นNodeThe tree node.
tableColumns๐Ÿ”นColumn[]The columns of the table.
tableName๐Ÿ”นstringName of the table.

cluster๐Ÿ”น

Type: ICluster

The cluster where the table is located.


databaseName๐Ÿ”น

Type: string

The name of the database where the table is located.


node๐Ÿ”น

Type: Node

The tree node.


tableColumns๐Ÿ”น

Type: Column[]

The columns of the table.


tableName๐Ÿ”น

Type: string

Name of the table.

Methods

NameDescription
applyRemovalPolicy(policy)๐Ÿ”นApply the given removal policy to this resource.
grant(user, ...actions)๐Ÿ”นGrant a user privilege to access this table.
toString()๐Ÿ”นReturns a string representation of this construct.
static fromTableAttributes(scope, id, attrs)๐Ÿ”นSpecify a Redshift table using a table name and schema that already exists.

applyRemovalPolicy(policy)๐Ÿ”น

public applyRemovalPolicy(policy: RemovalPolicy): void

Parameters

  • policy RemovalPolicy

Apply the given removal policy to this resource.

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.

The resource can be destroyed (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN).

This resource is retained by default.


grant(user, ...actions)๐Ÿ”น

public grant(user: IUser, ...actions: TableAction[]): void

Parameters

  • user IUser
  • actions TableAction

Grant a user privilege to access this table.


toString()๐Ÿ”น

public toString(): string

Returns

  • string

Returns a string representation of this construct.


static fromTableAttributes(scope, id, attrs)๐Ÿ”น

public static fromTableAttributes(scope: Construct, id: string, attrs: TableAttributes): ITable

Parameters

  • scope Construct
  • id string
  • attrs TableAttributes

Returns

  • ITable

Specify a Redshift table using a table name and schema that already exists.