class ExternalTable (construct)
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.Glue.Alpha.ExternalTable |
Go | github.com/aws/aws-cdk-go/awscdkgluealpha/v2#ExternalTable |
Java | software.amazon.awscdk.services.glue.alpha.ExternalTable |
Python | aws_cdk.aws_glue_alpha.ExternalTable |
TypeScript (source) | @aws-cdk/aws-glue-alpha » ExternalTable |
⚠️ Deprecated: undefined
Implements
IConstruct, IDependable, IResource, IEnvironment, ITable
A Glue table that targets an external data location (e.g. A table in a Redshift Cluster).
Example
declare const myConnection: glue.Connection;
declare const myDatabase: glue.Database;
new glue.ExternalTable(this, 'MyTable', {
connection: myConnection,
externalDataLocation: 'default_db_public_example', // A table in Redshift
// ...
database: myDatabase,
columns: [{
name: 'col1',
type: glue.Schema.STRING,
}],
dataFormat: glue.DataFormat.JSON,
});
Initializer
new ExternalTable(scope: Construct, id: string, props: ExternalTableProps)
⚠️ Deprecated: undefined
Parameters
- scope
Construct - id
string - props
ExternalTable Props
Construct Props
| Name | Type | Description |
|---|---|---|
| columns | Column[] | Columns of the table. |
| connection | IConnection | The connection the table will use when performing reads and writes. |
| data | Data | Storage type of the table's data. |
| database | IDatabase | Database in which to store the table. |
| external | string | The data source location of the glue table, (e.g. default_db_public_example for Redshift). |
| compressed? | boolean | Indicates whether the table's data is compressed or not. |
| description? | string | Description of the table. |
| enable | boolean | Enables partition filtering. |
| has | boolean | Whether the data stored in the table is encrypted. |
| 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. |
| partition | { [string]: Partition } | Partition projection configuration for this table. |
| 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
⚠️ Deprecated: undefined
Type:
Column[]
Columns of the table.
connection
⚠️ Deprecated: undefined
Type:
IConnection
The connection the table will use when performing reads and writes.
dataFormat
⚠️ Deprecated: undefined
Type:
Data
Storage type of the table's data.
database
⚠️ Deprecated: undefined
Type:
IDatabase
Database in which to store the table.
externalDataLocation
⚠️ Deprecated: undefined
Type:
string
The data source location of the glue table, (e.g. default_db_public_example for Redshift).
If this property is set, it will override both bucket and s3Prefix.
compressed?
⚠️ Deprecated: undefined
Type:
boolean
(optional, default: false)
Indicates whether the table's data is compressed or not.
description?
⚠️ Deprecated: undefined
Type:
string
(optional, default: generated)
Description of the table.
enablePartitionFiltering?
⚠️ Deprecated: undefined
Type:
boolean
(optional, default: The parameter is not defined)
Enables partition filtering.
hasEncryptedData?
⚠️ Deprecated: undefined
Type:
boolean
(optional, default: true)
Whether the data stored in the table is encrypted.
This sets the has_encrypted_data table parameter. Athena reads it when
querying client-side (CSE-KMS) encrypted datasets; for server-side
encrypted (SSE-S3 / SSE-KMS) or unencrypted data it has no effect, since
Amazon S3 decrypts server-side encrypted objects transparently.
Do not also set has_encrypted_data through parameters - use this
property instead. A conflicting value in parameters is rejected.
parameters?
⚠️ Deprecated: undefined
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?
⚠️ Deprecated: undefined
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?
⚠️ Deprecated: undefined
Type:
Column[]
(optional, default: table is not partitioned)
Partition columns of the table.
partitionProjection?
⚠️ Deprecated: undefined
Type:
{ [string]: Partition }
(optional, default: No partition projection)
Partition projection configuration for this table.
Partition projection allows Athena to automatically add new partitions
without requiring ALTER TABLE ADD PARTITION statements.
See also: https://docs.aws.amazon.com/athena/latest/ug/partition-projection.html
storageParameters?
⚠️ Deprecated: undefined
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.S3Table(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?
⚠️ Deprecated: undefined
Type:
boolean
(optional, default: false)
Indicates whether the table data is stored in subdirectories.
tableName?
⚠️ Deprecated: undefined
Type:
string
(optional, default: generated by CDK.)
Name of the table.
Properties
| Name | Type | Description |
|---|---|---|
| columns | Column[] | This table's columns. |
| compressed | boolean | Indicates whether the table's data is compressed or not. |
| connection | IConnection | The connection associated to this table. |
| data | Data | Format of this table's data files. |
| database | IDatabase | Database this table belongs to. |
| env | Resource | The environment this resource belongs to. |
| node | Node | The tree node. |
| stack | Stack | The stack in which this resource is defined. |
| table | string | ARN of this table. |
| table | string | Name of this table. |
| table | Cfn | |
| partition | Partition[] | This table's partition indexes. |
| partition | Column[] | This table's partition keys if the table is partitioned. |
| partition | { [string]: Partition } | This table's partition projection configuration if enabled. |
| storage | Storage[] | The tables' storage descriptor properties. |
| static PROPERTY_INJECTION_ID | string | Uniquely identifies this class. |
columns
⚠️ Deprecated: undefined
Type:
Column[]
This table's columns.
compressed
⚠️ Deprecated: undefined
Type:
boolean
Indicates whether the table's data is compressed or not.
connection
⚠️ Deprecated: undefined
Type:
IConnection
The connection associated to this table.
dataFormat
⚠️ Deprecated: undefined
Type:
Data
Format of this table's data files.
database
⚠️ Deprecated: undefined
Type:
IDatabase
Database this table belongs to.
env
⚠️ Deprecated: undefined
Type:
Resource
The environment this resource belongs to.
For resources that are created and managed in a Stack (those created by
creating new class instances like new Role(), new Bucket(), etc.), this
is always the same as the environment of the stack they belong to.
For referenced resources (those obtained from referencing methods like
Role.fromRoleArn(), Bucket.fromBucketName(), etc.), they might be
different than the stack they were imported into.
node
⚠️ Deprecated: undefined
Type:
Node
The tree node.
stack
⚠️ Deprecated: undefined
Type:
Stack
The stack in which this resource is defined.
tableArn
⚠️ Deprecated: undefined
Type:
string
ARN of this table.
tableName
⚠️ Deprecated: undefined
Type:
string
Name of this table.
tableResource
⚠️ Deprecated: undefined
Type:
Cfn
partitionIndexes?
⚠️ Deprecated: undefined
Type:
Partition[]
(optional)
This table's partition indexes.
partitionKeys?
⚠️ Deprecated: undefined
Type:
Column[]
(optional)
This table's partition keys if the table is partitioned.
partitionProjection?
⚠️ Deprecated: undefined
Type:
{ [string]: Partition }
(optional)
This table's partition projection configuration if enabled.
storageParameters?
⚠️ Deprecated: undefined
Type:
Storage[]
(optional)
The tables' storage descriptor properties.
static PROPERTY_INJECTION_ID
⚠️ Deprecated: undefined
Type:
string
Uniquely identifies this class.
Methods
| Name | Description |
|---|---|
| add | Add a partition index to the table. |
| apply | Override the cross-stack reference strength for this resource. |
| apply | Apply the given removal policy to this resource. |
| grant(grantee, actions) | Grant the given identity custom permissions on this table. |
| grant | Grant read permissions to the table [disable-awslint:no-grants]. |
| grant | Grant read and write permissions to the table [disable-awslint:no-grants]. |
| grant | Grant the given identity custom permissions on this table AND its parent catalog and database. |
| grant | Grant write permissions to the table [disable-awslint:no-grants]. |
| to | Returns a string representation of this construct. |
| with(...mixins) | Applies one or more mixins to this construct. |
addPartitionIndex(index)
public addPartitionIndex(index: PartitionIndex): void
⚠️ Deprecated: undefined
Parameters
- index
PartitionIndex
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
applyCrossStackReferenceStrength(strength)
public applyCrossStackReferenceStrength(strength: ReferenceStrength): void
⚠️ Deprecated: undefined
Parameters
- strength
Reference— - The reference strength to use for this resource.Strength
Override the cross-stack reference strength for this resource.
When set, any cross-stack reference to this resource will use the specified
mechanism instead of the global default determined by the
@aws-cdk/core:defaultCrossStackReferences context key. This is useful for
selectively weakening specific references to avoid the "deadly embrace" problem
without changing the app-wide default.
applyRemovalPolicy(policy)
public applyRemovalPolicy(policy: RemovalPolicy): void
⚠️ Deprecated: undefined
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 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: undefined
Parameters
- grantee
IGrantable— the principal. - actions
string[]— the set of Glue actions to allow (for exampleglue:GetTable).
Returns
Grant the given identity custom permissions on this table.
This is a low-level escape hatch: the actions are applied verbatim,
scoped to this table's ARN. Prefer the intent-based grantRead /
grantWrite / grantReadWrite methods, which grant a curated set of
actions and also cover the underlying S3 data. Only pass the specific
actions the grantee needs - avoid service wildcards such as glue:*.
[disable-awslint:no-grants]
grantRead(grantee)
public grantRead(grantee: IGrantable): Grant
⚠️ Deprecated: undefined
Parameters
- grantee
IGrantable— the principal.
Returns
Grant read permissions to the table [disable-awslint:no-grants].
grantReadWrite(grantee)
public grantReadWrite(grantee: IGrantable): Grant
⚠️ Deprecated: undefined
Parameters
- grantee
IGrantable— the principal.
Returns
Grant read and write permissions to the table [disable-awslint:no-grants].
grantToUnderlyingResources(grantee, actions)
public grantToUnderlyingResources(grantee: IGrantable, actions: string[]): Grant
⚠️ Deprecated: undefined
Parameters
- grantee
IGrantable— the principal. - actions
string[]— the set of Glue actions to allow (for exampleglue:GetTable).
Returns
Grant the given identity custom permissions on this table AND its parent catalog and database.
This is a low-level escape hatch for actions (such as certain Lake
Formation or crawler operations) that must be authorized against the
catalog and database in addition to the table. The actions are applied
verbatim to all three ARNs (table, catalog, database), so scope them
tightly: pass only the specific actions the grantee needs and avoid
service wildcards such as glue:*, which would grant broad access across
every resource in the catalog and database.
[disable-awslint:no-grants]
grantWrite(grantee)
public grantWrite(grantee: IGrantable): Grant
⚠️ Deprecated: undefined
Parameters
- grantee
IGrantable— the principal.
Returns
Grant write permissions to the table [disable-awslint:no-grants].
toString()
public toString(): string
⚠️ Deprecated: undefined
Returns
string
Returns a string representation of this construct.
with(...mixins)
public with(...mixins: IMixin[]): IConstruct
⚠️ Deprecated: undefined
Parameters
- mixins
IMixin
Returns
Applies one or more mixins to this construct.
Mixins are applied in order. The list of constructs is captured at the
start of the call, so constructs added by a mixin will not be visited.
Use multiple with() calls if subsequent mixins should apply to added
constructs.

.NET
Go
Java
Python
TypeScript (