Table

class aws_cdk.aws_glue.Table(scope, id, *, columns, database, data_format, table_name, bucket=None, compressed=None, description=None, encryption=None, encryption_key=None, partition_keys=None, s3_prefix=None, stored_as_sub_directories=None)

Bases: aws_cdk.core.Resource

A Glue table.

stability :stability: experimental

__init__(scope, id, *, columns, database, data_format, table_name, bucket=None, compressed=None, description=None, encryption=None, encryption_key=None, partition_keys=None, s3_prefix=None, stored_as_sub_directories=None)
Parameters
  • scope (Construct) –

  • id (str) –

  • columns (List[Column]) – Columns of the table.

  • database (IDatabase) – Database in which to store the table.

  • data_format (DataFormat) – Storage type of the table’s data.

  • table_name (str) – Name of the table.

  • bucket (Optional[IBucket]) – S3 bucket in which to store data. Default: one is created for you

  • compressed (Optional[bool]) – Indicates whether the table’s data is compressed or not. Default: false

  • description (Optional[str]) – Description of the table. Default: generated

  • encryption (Optional[TableEncryption]) – The kind of encryption to secure the data with. You can only provide this option if you are not explicitly passing in a bucket. If you choose SSE-KMS, you can provide an un-managed KMS key with encryptionKey. If you choose CSE-KMS, you must provide an un-managed KMS key with encryptionKey. Default: Unencrypted

  • encryption_key (Optional[IKey]) – External KMS key to use for bucket encryption. The encryption property must be SSE-KMS or CSE-KMS. Default: key is managed by KMS.

  • partition_keys (Optional[List[Column]]) – Partition columns of the table. Default: table is not partitioned

  • s3_prefix (Optional[str]) – S3 prefix under which table objects are stored. Default: data/

  • stored_as_sub_directories (Optional[bool]) – Indicates whether the table data is stored in subdirectories. Default: false

stability :stability: experimental

Return type

None

Methods

grant_read(grantee)

Grant read permissions to the table and the underlying data stored in S3 to an IAM principal.

Parameters

grantee (IGrantable) – the principal.

stability :stability: experimental

Return type

Grant

grant_read_write(grantee)

Grant read and write permissions to the table and the underlying data stored in S3 to an IAM principal.

Parameters

grantee (IGrantable) – the principal.

stability :stability: experimental

Return type

Grant

grant_write(grantee)

Grant write permissions to the table and the underlying data stored in S3 to an IAM principal.

Parameters

grantee (IGrantable) – the principal.

stability :stability: experimental

Return type

Grant

to_string()

Returns a string representation of this construct.

Return type

str

Attributes

bucket

S3 bucket in which the table’s data resides.

stability :stability: experimental

Return type

IBucket

columns

This table’s columns.

stability :stability: experimental

Return type

List[Column]

compressed

Indicates whether the table’s data is compressed or not.

stability :stability: experimental

Return type

bool

data_format

Format of this table’s data files.

stability :stability: experimental

Return type

DataFormat

database

Database this table belongs to.

stability :stability: experimental

Return type

IDatabase

encryption

The type of encryption enabled for the table.

stability :stability: experimental

Return type

TableEncryption

encryption_key

The KMS key used to secure the data if encryption is set to CSE-KMS or SSE-KMS.

Otherwise, undefined.

stability :stability: experimental

Return type

Optional[IKey]

node

The construct tree node associated with this construct.

Return type

ConstructNode

partition_keys

This table’s partition keys if the table is partitioned.

stability :stability: experimental

Return type

Optional[List[Column]]

s3_prefix

S3 Key Prefix under which this table’s files are stored in S3.

stability :stability: experimental

Return type

str

stack

The stack in which this resource is defined.

Return type

Stack

table_arn

ARN of this table.

stability :stability: experimental

Return type

str

table_name

Name of this table.

stability :stability: experimental

Return type

str

Static Methods

classmethod from_table_arn(scope, id, table_arn)
Parameters
  • scope (Construct) –

  • id (str) –

  • table_arn (str) –

stability :stability: experimental

Return type

ITable

classmethod from_table_attributes(scope, id, *, table_arn, table_name)

Creates a Table construct that represents an external table.

Parameters
  • scope (Construct) – The scope creating construct (usually this).

  • id (str) – The construct’s id.

  • table_arn (str) –

  • table_name (str) –

stability :stability: experimental

Return type

ITable

classmethod is_construct(x)

Return whether the given object is a Construct.

Parameters

x (Any) –

Return type

bool