class Table (construct)
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.Glue.Alpha.Table |
![]() | github.com/aws/aws-cdk-go/awscdkgluealpha/v2#Table |
![]() | software.amazon.awscdk.services.glue.alpha.Table |
![]() | aws_cdk.aws_glue_alpha.Table |
![]() | @aws-cdk/aws-glue-alpha » Table |
⚠️ Deprecated: Use {@link S3Table } instead.
Implements
IConstruct
, IDependable
, IResource
, ITable
A Glue table.
Example
declare const glueDatabase: glue.IDatabase;
const table = new glue.Table(this, 'Table', {
storageParameters: [
glue.StorageParameter.skipHeaderLineCount(1),
glue.StorageParameter.compressionType(glue.CompressionType.GZIP),
glue.StorageParameter.custom('foo', 'bar'), // Will have no effect
glue.StorageParameter.custom('separatorChar', ','), // Will describe the separator char used in the data
glue.StorageParameter.custom(glue.StorageParameters.WRITE_PARALLEL, 'off'),
],
// ...
database: glueDatabase,
columns: [{
name: 'col1',
type: glue.Schema.STRING,
}],
dataFormat: glue.DataFormat.CSV,
});
Initializer
new Table(scope: Construct, id: string, props: S3TableProps)
⚠️ Deprecated: Use {@link S3Table } instead.
Parameters
- scope
Construct
- id
string
- props
S3
Table Props
Construct Props
Name | Type | Description |
---|---|---|
columns | Column [] | Columns of the table. |
data | Data | Storage type of the table's data. |
database | IDatabase | Database in which to store the table. |
bucket? | IBucket | S3 bucket in which to store data. |
compressed? | boolean | Indicates whether the table's data is compressed or not. |
description? | string | Description of the table. |
enable | boolean | Enables partition filtering. |
encryption? | Table | The kind of encryption to secure the data with. |
encryption | IKey | External KMS key to use for bucket encryption. |
parameters? | { [string]: string } | The key/value pairs define properties associated with the table. |
partition | Partition [] | Partition indexes on the table. |
partition | Column [] | Partition columns of the table. |
s3 | string | S3 prefix under which table objects are stored. |
storage | Storage [] | The user-supplied properties for the description of the physical storage of this table. |
stored | boolean | Indicates whether the table data is stored in subdirectories. |
table | string | Name of the table. |
columns
Type:
Column
[]
Columns of the table.
dataFormat
Type:
Data
Storage type of the table's data.
database
Type:
IDatabase
Database in which to store the table.
bucket?
Type:
IBucket
(optional, default: one is created for you)
S3 bucket in which to store data.
compressed?
Type:
boolean
(optional, default: false)
Indicates whether the table's data is compressed or not.
description?
Type:
string
(optional, default: generated)
Description of the table.
enablePartitionFiltering?
Type:
boolean
(optional, default: The parameter is not defined)
Enables partition filtering.
encryption?
Type:
Table
(optional, default: BucketEncryption.S3_MANAGED)
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
.
encryptionKey?
Type:
IKey
(optional, default: key is managed by KMS.)
External KMS key to use for bucket encryption.
The encryption
property must be SSE-KMS
or CSE-KMS
.
parameters?
Type:
{ [string]: string }
(optional, default: The parameter is not defined)
The key/value pairs define properties associated with the table.
The key/value pairs that are allowed to be submitted are not limited, however their functionality is not guaranteed.
partitionIndexes?
Type:
Partition
[]
(optional, default: table has no partition indexes)
Partition indexes on the table.
A maximum of 3 indexes are allowed on a table. Keys in the index must be part of the table's partition keys.
partitionKeys?
Type:
Column
[]
(optional, default: table is not partitioned)
Partition columns of the table.
s3Prefix?
Type:
string
(optional, default: No prefix. The data will be stored under the root of the bucket.)
S3 prefix under which table objects are stored.
storageParameters?
Type:
Storage
[]
(optional, default: The parameter is not defined)
The user-supplied properties for the description of the physical storage of this table.
These properties help describe the format of the data that is stored within the crawled data sources.
The key/value pairs that are allowed to be submitted are not limited, however their functionality is not guaranteed.
Some keys will be auto-populated by glue crawlers, however, you can override them by specifying the key and value in this property.
See also: [https://docs.aws.amazon.com/redshift/latest/dg/r_CREATE_EXTERNAL_TABLE.html#r_CREATE_EXTERNAL_TABLE-parameters - under "TABLE PROPERTIES"](https://docs.aws.amazon.com/redshift/latest/dg/r_CREATE_EXTERNAL_TABLE.html#r_CREATE_EXTERNAL_TABLE-parameters - under "TABLE PROPERTIES") Example
declare const glueDatabase: glue.IDatabase;
const table = new glue.Table(this, 'Table', {
storageParameters: [
glue.StorageParameter.skipHeaderLineCount(1),
glue.StorageParameter.compressionType(glue.CompressionType.GZIP),
glue.StorageParameter.custom('foo', 'bar'), // Will have no effect
glue.StorageParameter.custom('separatorChar', ','), // Will describe the separator char used in the data
glue.StorageParameter.custom(glue.StorageParameters.WRITE_PARALLEL, 'off'),
],
// ...
database: glueDatabase,
columns: [{
name: 'col1',
type: glue.Schema.STRING,
}],
dataFormat: glue.DataFormat.CSV,
});
storedAsSubDirectories?
Type:
boolean
(optional, default: false)
Indicates whether the table data is stored in subdirectories.
tableName?
Type:
string
(optional, default: generated by CDK.)
Name of the table.
Properties
Name | Type | Description |
---|---|---|
bucket | IBucket | S3 bucket in which the table's data resides. |
columns | Column [] | This table's columns. |
compressed | boolean | Indicates whether the table's data is compressed or not. |
data | Data | Format of this table's data files. |
database | IDatabase | Database this table belongs to. |
encryption | Table | The type of encryption enabled for the table. |
env | Resource | The environment this resource belongs to. |
node | Node | The tree node. |
s3 | string | S3 Key Prefix under which this table's files are stored in S3. |
stack | Stack | The stack in which this resource is defined. |
table | string | ARN of this table. |
table | string | Name of this table. |
encryption | IKey | The KMS key used to secure the data if encryption is set to CSE-KMS or SSE-KMS . |
partition | Partition [] | This table's partition indexes. |
partition | Column [] | This table's partition keys if the table is partitioned. |
storage | Storage [] | The tables' storage descriptor properties. |
bucket
⚠️ Deprecated: Use {@link S3Table } instead.
Type:
IBucket
S3 bucket in which the table's data resides.
columns
⚠️ Deprecated: Use {@link S3Table } instead.
Type:
Column
[]
This table's columns.
compressed
⚠️ Deprecated: Use {@link S3Table } instead.
Type:
boolean
Indicates whether the table's data is compressed or not.
dataFormat
⚠️ Deprecated: Use {@link S3Table } instead.
Type:
Data
Format of this table's data files.
database
⚠️ Deprecated: Use {@link S3Table } instead.
Type:
IDatabase
Database this table belongs to.
encryption
⚠️ Deprecated: Use {@link S3Table } instead.
Type:
Table
The type of encryption enabled for the table.
env
⚠️ Deprecated: Use {@link S3Table } instead.
Type:
Resource
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.
node
⚠️ Deprecated: Use {@link S3Table } instead.
Type:
Node
The tree node.
s3Prefix
⚠️ Deprecated: Use {@link S3Table } instead.
Type:
string
S3 Key Prefix under which this table's files are stored in S3.
stack
⚠️ Deprecated: Use {@link S3Table } instead.
Type:
Stack
The stack in which this resource is defined.
tableArn
⚠️ Deprecated: Use {@link S3Table } instead.
Type:
string
ARN of this table.
tableName
⚠️ Deprecated: Use {@link S3Table } instead.
Type:
string
Name of this table.
encryptionKey?
⚠️ Deprecated: Use {@link S3Table } instead.
Type:
IKey
(optional)
The KMS key used to secure the data if encryption
is set to CSE-KMS
or SSE-KMS
.
Otherwise, undefined
.
partitionIndexes?
⚠️ Deprecated: Use {@link S3Table } instead.
Type:
Partition
[]
(optional)
This table's partition indexes.
partitionKeys?
⚠️ Deprecated: Use {@link S3Table } instead.
Type:
Column
[]
(optional)
This table's partition keys if the table is partitioned.
storageParameters?
⚠️ Deprecated: Use {@link S3Table } instead.
Type:
Storage
[]
(optional)
The tables' storage descriptor properties.
Methods
Name | Description |
---|---|
add | Add a partition index to the table. |
apply | Apply the given removal policy to this resource. |
grant(grantee, actions) | Grant the given identity custom permissions. |
grant | Grant read permissions to the table and the underlying data stored in S3 to an IAM principal. |
grant | Grant read and write permissions to the table and the underlying data stored in S3 to an IAM principal. |
grant | Grant the given identity custom permissions to ALL underlying resources of the table. |
grant | Grant write permissions to the table and the underlying data stored in S3 to an IAM principal. |
to | Returns a string representation of this construct. |
addPartitionIndex(index)
public addPartitionIndex(index: PartitionIndex): void
⚠️ Deprecated: Use {@link S3Table } instead.
Parameters
- index
Partition
Index
Add a partition index to the table.
You can have a maximum of 3 partition indexes to a table. Partition index keys must be a subset of the table's partition keys.
See also: https://docs.aws.amazon.com/glue/latest/dg/partition-indexes.html
applyRemovalPolicy(policy)
public applyRemovalPolicy(policy: RemovalPolicy): void
⚠️ Deprecated: Use {@link S3Table } instead.
Parameters
- policy
Removal
Policy
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 deleted (RemovalPolicy.DESTROY
), or left in your AWS
account for data recovery and cleanup later (RemovalPolicy.RETAIN
).
grant(grantee, actions)
public grant(grantee: IGrantable, actions: string[]): Grant
⚠️ Deprecated: Use {@link S3Table } instead.
Parameters
- grantee
IGrantable
- actions
string[]
Returns
Grant the given identity custom permissions.
grantRead(grantee)
public grantRead(grantee: IGrantable): Grant
⚠️ Deprecated: Use {@link S3Table } instead.
Parameters
- grantee
IGrantable
— the principal.
Returns
Grant read permissions to the table and the underlying data stored in S3 to an IAM principal.
grantReadWrite(grantee)
public grantReadWrite(grantee: IGrantable): Grant
⚠️ Deprecated: Use {@link S3Table } instead.
Parameters
- grantee
IGrantable
— the principal.
Returns
Grant read and write permissions to the table and the underlying data stored in S3 to an IAM principal.
grantToUnderlyingResources(grantee, actions)
public grantToUnderlyingResources(grantee: IGrantable, actions: string[]): Grant
⚠️ Deprecated: Use {@link S3Table } instead.
Parameters
- grantee
IGrantable
- actions
string[]
Returns
Grant the given identity custom permissions to ALL underlying resources of the table.
Permissions will be granted to the catalog, the database, and the table.
grantWrite(grantee)
public grantWrite(grantee: IGrantable): Grant
⚠️ Deprecated: Use {@link S3Table } instead.
Parameters
- grantee
IGrantable
— the principal.
Returns
Grant write permissions to the table and the underlying data stored in S3 to an IAM principal.
toString()
public toString(): string
⚠️ Deprecated: Use {@link S3Table } instead.
Returns
string
Returns a string representation of this construct.