Table

class aws_cdk.aws_redshift.Table(scope, id, *, table_columns, dist_style=None, removal_policy=None, sort_style=None, table_name=None, cluster, database_name, admin_user=None)

Bases: Construct

(experimental) A table in a Redshift cluster.

Stability:

experimental

ExampleMetadata:

fixture=cluster infused

Example:

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
)
Parameters:
  • scope (Construct) –

  • id (str) –

  • table_columns (Sequence[Union[Column, Dict[str, Any]]]) – (experimental) The columns of the table.

  • dist_style (Optional[TableDistStyle]) – (experimental) The distribution style of the table. Default: TableDistStyle.AUTO

  • removal_policy (Optional[RemovalPolicy]) – (experimental) The policy to apply when this resource is removed from the application. Default: cdk.RemovalPolicy.Retain

  • sort_style (Optional[TableSortStyle]) – (experimental) The sort style of the table. Default: TableSortStyle.AUTO if no sort key is specified, TableSortStyle.COMPOUND if a sort key is specified

  • table_name (Optional[str]) – (experimental) The name of the table. Default: - a name is generated

  • cluster (ICluster) – (experimental) The cluster containing the database.

  • database_name (str) – (experimental) The name of the database.

  • admin_user (Optional[ISecret]) – (experimental) The secret containing credentials to a Redshift user with administrator privileges. Secret JSON schema: { username: string; password: string }. Default: - the admin secret is taken from the cluster

Stability:

experimental

Methods

apply_removal_policy(policy)

(experimental) 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.

Parameters:

policy (RemovalPolicy) –

Stability:

experimental

Return type:

None

grant(user, *actions)

(experimental) Grant a user privilege to access this table.

Parameters:
Stability:

experimental

Return type:

None

to_string()

Returns a string representation of this construct.

Return type:

str

Attributes

cluster

(experimental) The cluster where the table is located.

Stability:

experimental

database_name

(experimental) The name of the database where the table is located.

Stability:

experimental

node

The construct tree node associated with this construct.

table_columns

(experimental) The columns of the table.

Stability:

experimental

table_name

(experimental) Name of the table.

Stability:

experimental

Static Methods

classmethod from_table_attributes(scope, id, *, cluster, database_name, table_columns, table_name)

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

Parameters:
  • scope (Construct) –

  • id (str) –

  • cluster (ICluster) – (experimental) The cluster where the table is located.

  • database_name (str) – (experimental) The name of the database where the table is located.

  • table_columns (Sequence[Union[Column, Dict[str, Any]]]) – (experimental) The columns of the table.

  • table_name (str) – (experimental) Name of the table.

Stability:

experimental

Return type:

ITable

classmethod is_construct(x)

Return whether the given object is a Construct.

Parameters:

x (Any) –

Return type:

bool