Registry /
aws / aws-cdk-aws-s3tables-alpha
Install & Compatibility
Where this runs
tested against v2.259.0a0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.910 runs
installs and imports cleanly · install 0.0s · import 0.000s · 359.6MB
glibcpy 3.10–3.910 runs
installs and imports cleanly · install 17.4s · import 0.000s · 360MB
397MB installed
● package 397MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
S3Table
✓ from aws_cdk_aws_s3tables_alpha import S3Table
TableOptions
✓ from aws_cdk_aws_s3tables_alpha import TableOptions
DataFormat
✓ from aws_cdk_aws_s3tables_alpha import DataFormat
Column
✓ from aws_cdk_aws_s3tables_alpha import Column
aws_s3 as s3
✓ from aws_cdk import aws_s3 as s3
✗ import aws_cdk.aws_s3 as s3
CDK v2 imports AWS service modules as `aws_service` directly from `aws_cdk`.
This quickstart demonstrates how to create an S3 bucket and then define an S3-backed Glue Data Catalog table using `S3Table`. The table is configured with a PARQUET data format and several columns. Replace placeholder values like `product_sales` and `sales_data_db` with your specific requirements. This code synthesizes a CDK CloudFormation template.
import os
from aws_cdk import App, Stack, Environment, aws_s3 as s3
from aws_cdk.aws_s3 import Bucket, RemovalPolicy
from aws_cdk_aws_s3tables_alpha import S3Table, TableOptions, DataFormat, Column
class MyS3TableStack(Stack):
def __init__(self, scope: App, id: str, **kwargs) -> None:
super().__init__(scope, id, **kwargs)
# Define an S3 Bucket to store the table data
# In production, use RemovalPolicy.RETAIN and consider bucket versioning
data_bucket = Bucket(self, "MyDataLakeBucket",
versioned=True,
removal_policy=RemovalPolicy.DESTROY # CAUTION: Deletes bucket and contents on stack delete
)
# Define the S3 Table construct, creating a Glue Table
s3_glue_table = S3Table(self, "MyProductSalesS3Table",
bucket=data_bucket,
table_name="product_sales",
database_name="sales_data_db", # The AWS Glue database name
table_options=TableOptions(
data_format=DataFormat.PARQUET, # Common for data lakes
columns=[
Column(name="product_id", type="string"),
Column(name="sale_date", type="date"),
Column(name="amount", type="double"),
Column(name="region", type="string")
],
),
# Example: Partition by year and month for efficient querying
# partition_keys=[
# Column(name="year", type="string"),
# Column(name="month", type="string")
# ]
)
# You can access properties like table_name or database_name
# CfnOutput(self, "S3BucketName", value=data_bucket.bucket_name)
# CfnOutput(self, "GlueTableName", value=s3_glue_table.table_name)
# Standard CDK application entry point
app = App()
MyS3TableStack(app, "MyS3TableStack",
env=Environment(
account=os.environ.get("CDK_DEFAULT_ACCOUNT"),
region=os.environ.get("CDK_DEFAULT_REGION")
)
)
app.synth()
cdk --version
Debug
Known issues
breakingThis is an ALPHA module. Stability is not guaranteed. Breaking changes can and do occur frequently, even between minor versions. Always consult the latest module documentation before updating.fixPin your module versions (e.g., `aws-cdk-aws-s3tables-alpha==2.250.0a0`) and review changelogs or module-specific READMEs carefully before upgrading. Be prepared to refactor code when updating.
affects: All versions with 'a' or 'alpha' suffix
gotchaCDK v1 vs. v2 import paths: This module is exclusively for AWS CDK v2. Trying to import `aws_cdk` components in the v1 style (e.g., `import aws_cdk.aws_s3`) will lead to `ModuleNotFoundError` or other incompatibilities if using CDK v2.fixEnsure all CDK imports follow the v2 pattern (e.g., `from aws_cdk import aws_s3 as s3`). If migrating from v1, consult the CDK v1 to v2 migration guide.
affects: All CDK v2 versions
gotchaThe `S3Table` construct creates AWS Glue Data Catalog tables. Ensure your CDK deployment role has sufficient IAM permissions to create, update, and delete Glue databases and tables, as well as S3 bucket permissions for the data.fixVerify that the IAM role associated with your CDK deployment (e.g., `cdk deploy`) has policies like `AWSGlueConsoleFullAccess` (for development) or more granular `glue:CreateDatabase`, `glue:CreateTable`, `s3:GetObject`, `s3:PutObject` permissions for production environments.
affects: All versions
Upgrade
Version history
2.259.0a0latest on PyPI · released Jun 12, 2026
Audit
Dependencies
aws-cdk-librequiredCore AWS CDK v2 library, required for all CDK applications.
constructsrequiredFoundation library for constructing and composing AWS CDK applications.