CDK Constructs for S3 Tables
Project description
Amazon S3 Tables Construct Library
---The APIs of higher level constructs in this module are experimental and under active development. They are subject to non-backward compatible changes or removal in any future version. These are not subject to the Semantic Versioning model and breaking changes will be announced in the release notes. This means that while you may use them, you may need to update your source code when upgrading to a newer version of this package.
Amazon S3 Tables
Amazon S3 Tables deliver the first cloud object store with built-in Apache Iceberg support and streamline storing tabular data at scale.
Usage
Define an S3 Table Bucket
# Build a Table bucket
sample_table_bucket = TableBucket(scope, "ExampleTableBucket",
table_bucket_name="example-bucket-1",
# optional fields:
unreferenced_file_removal=UnreferencedFileRemoval(
status=UnreferencedFileRemovalStatus.ENABLED,
noncurrent_days=20,
unreferenced_days=20
)
)
Learn more about table buckets maintenance operations and default behavior from the S3 Tables User Guide
Controlling Table Bucket Permissions
# Grant the principal read permissions to the bucket and all tables within
account_id = "123456789012"
table_bucket.grant_read(iam.AccountPrincipal(account_id), "*")
# Grant the role write permissions to the bucket and all tables within
role = iam.Role(stack, "MyRole", assumed_by=iam.ServicePrincipal("sample"))
table_bucket.grant_write(role, "*")
# Grant the user read and write permissions to the bucket and all tables within
table_bucket.grant_read_write(iam.User(stack, "MyUser"), "*")
# Grant permissions to the bucket and a particular table within it
table_id = "6ba046b2-26de-44cf-9144-0c7862593a7b"
table_bucket.grant_read_write(iam.AccountPrincipal(account_id), table_id)
# Add custom resource policy statements
permissions = iam.PolicyStatement(
effect=iam.Effect.ALLOW,
actions=["s3tables:*"],
principals=[iam.ServicePrincipal("example.aws.internal")],
resources=["*"]
)
table_bucket.add_to_resource_policy(permissions)
Controlling Table Bucket Encryption Settings
S3 TableBuckets have SSE (server-side encryption with AES-256) enabled by default with S3 managed keys. You can also bring your own KMS key for KMS-SSE or have S3 create a KMS key for you.
If a bucket is encrypted with KMS, grant functions on the bucket will also grant access to the TableBucket's associated KMS key.
# Provide a user defined KMS Key:
key = kms.Key(scope, "UserKey")
encrypted_bucket = TableBucket(scope, "EncryptedTableBucket",
table_bucket_name="table-bucket-1",
encryption=TableBucketEncryption.KMS,
encryption_key=key
)
# This account principal will also receive kms:Decrypt access to the KMS key
encrypted_bucket.grant_read(iam.AccountPrincipal("123456789012"), "*")
# Use S3 managed server side encryption (default)
encrypted_bucket_default = TableBucket(scope, "EncryptedTableBucketDefault",
table_bucket_name="table-bucket-3",
encryption=TableBucketEncryption.S3_MANAGED
)
When using KMS encryption (TableBucketEncryption.KMS), if no encryption key is provided, CDK will automatically create a new KMS key for the table bucket with necessary permissions.
# If no key is provided, one will be created automatically
encrypted_bucket_auto = TableBucket(scope, "EncryptedTableBucketAuto",
table_bucket_name="table-bucket-2",
encryption=TableBucketEncryption.KMS
)
Coming Soon
L2 Construct support for:
- Namespaces
- Tables
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file aws_cdk_aws_s3tables_alpha-2.207.0a0.tar.gz.
File metadata
- Download URL: aws_cdk_aws_s3tables_alpha-2.207.0a0.tar.gz
- Upload date:
- Size: 78.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
22bf184cd39d8fc1da9ea5ad3f85b4f1b7f81709ba19b3be1e710a719bfb20e5
|
|
| MD5 |
5bccb1580923e48bbc31e0df2a60b7a6
|
|
| BLAKE2b-256 |
7309264e0dd937062a800edd18fa817969a936b15a23ec14f87567585bb87121
|
File details
Details for the file aws_cdk_aws_s3tables_alpha-2.207.0a0-py3-none-any.whl.
File metadata
- Download URL: aws_cdk_aws_s3tables_alpha-2.207.0a0-py3-none-any.whl
- Upload date:
- Size: 76.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4974bd72f80be338965720b98c31d1dbb0b161acafdb417a884e72b178681b67
|
|
| MD5 |
9c3adba15f08906161766e5252c0d11b
|
|
| BLAKE2b-256 |
792be0548a742392def7540db44e55ae4e7d9e221191df6760eafbf6512a7ea9
|