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

(experimental) A Glue table.

Stability

experimental

Parameters
  • scope (Construct) –

  • id (str) –

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

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

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

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

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

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

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

  • encryption (Optional[TableEncryption]) – (experimental) 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]) – (experimental) 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]]) – (experimental) Partition columns of the table. Default: table is not partitioned

  • s3_prefix (Optional[str]) – (experimental) S3 prefix under which table objects are stored. Default: - No prefix. The data will be stored under the root of the bucket.

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

Stability

experimental

Methods

grant_read(grantee)

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

Parameters

grantee (IGrantable) – the principal.

Stability

experimental

Return type

Grant

grant_read_write(grantee)

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

experimental

Return type

Grant

grant_write(grantee)

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

Parameters

grantee (IGrantable) – the principal.

Stability

experimental

Return type

Grant

to_string()

Returns a string representation of this construct.

Return type

str

Attributes

bucket

(experimental) S3 bucket in which the table’s data resides.

Stability

experimental

Return type

IBucket

columns

(experimental) This table’s columns.

Stability

experimental

Return type

List[Column]

compressed

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

Stability

experimental

Return type

bool

data_format

(experimental) Format of this table’s data files.

Stability

experimental

Return type

DataFormat

database

(experimental) Database this table belongs to.

Stability

experimental

Return type

IDatabase

encryption

(experimental) The type of encryption enabled for the table.

Stability

experimental

Return type

TableEncryption

encryption_key

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

Otherwise, undefined.

Stability

experimental

Return type

Optional[IKey]

env

The environment this resource belongs to.

For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.

Return type

ResourceEnvironment

node

The construct tree node associated with this construct.

Return type

ConstructNode

partition_keys

(experimental) This table’s partition keys if the table is partitioned.

Stability

experimental

Return type

Optional[List[Column]]

s3_prefix

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

Stability

experimental

Return type

str

stack

The stack in which this resource is defined.

Return type

Stack

table_arn

(experimental) ARN of this table.

Stability

experimental

Return type

str

table_name

(experimental) Name of this table.

Stability

experimental

Return type

str

Static Methods

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

  • id (str) –

  • table_arn (str) –

Stability

experimental

Return type

ITable

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

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

experimental

Return type

ITable

classmethod is_construct(x)

Return whether the given object is a Construct.

Parameters

x (Any) –

Return type

bool