Skip to main content

Overview

S3 Table Buckets are a purpose-built storage tier for tabular data that integrates natively with Apache Iceberg. They are designed for analytics workloads, data lakes, and any use case that benefits from open table formats with built-in compaction and maintenance.

Apache Iceberg

Table buckets expose data through the Iceberg open table format, enabling query engines such as Amazon Athena, Apache Spark, and Trino to read and write tables directly.

Managed maintenance

AWS handles compaction, snapshot expiry, and unreferenced file cleanup so you do not need to run a separate maintenance job.

Use cases

  • Analytics pipelines — store processed event data in Iceberg format for low-latency ad hoc queries.
  • Data lakes — land raw and curated data in the same table bucket and query across namespaces.
  • Audit tables — maintain a queryable, immutable history of configuration changes or access events.
  • Machine learning feature stores — version features as Iceberg snapshots for reproducible training runs.

Module source

The table-bucket functionality lives in the modules/table-bucket/ submodule. Reference it with a double-slash path:
module "s3_table_bucket" {
  source = "terraform-aws-modules/s3-bucket/aws//modules/table-bucket"

  table_bucket_name = "my-analytics-table-bucket"

  tags = {
    Environment = "production"
  }
}

Resources created

The submodule manages the following AWS resources:
ResourceDescription
aws_s3tables_table_bucketThe S3 Table Bucket itself
aws_s3tables_table_bucket_policyOptional resource-based policy for the table bucket
aws_s3tables_tableOne or more Iceberg tables inside the bucket
aws_s3tables_table_policyOptional per-table resource-based policies

Input variables

NameTypeDefaultDescription
createbooltrueWhether to create S3 table resources
regionstringnullAWS region. Defaults to the provider region
table_bucket_namestringnullName of the table bucket. 3–63 characters, lowercase letters, numbers, and hyphens
encryption_configurationanynullMap of encryption configurations
maintenance_configurationanynullMap of table bucket maintenance configurations
create_table_bucket_policyboolfalseWhether to create an S3 table bucket policy
table_bucket_policystringnullRaw JSON policy document. When null, the policy is built from table_bucket_policy_statements
table_bucket_source_policy_documentslist(string)[]IAM policy documents merged into the bucket policy (statements must have unique sids)
table_bucket_override_policy_documentslist(string)[]IAM policy documents merged into the bucket policy (statements with non-blank sids override matching ones)
table_bucket_policy_statementsany{}Map of IAM policy statements for custom permission usage
tablesany{}Map of table configurations
tagsmap(string){}Key-value map of resource tags

Outputs

NameDescription
s3_table_bucket_arnARN of the table bucket
s3_table_bucket_created_atDate and time when the bucket was created
s3_table_bucket_owner_account_idAccount ID of the account that owns the table bucket
s3_table_arnsMap of table ARNs, keyed by the tables map key
s3_table_created_atMap of table creation timestamps
s3_table_created_byMap of account IDs that created each table
s3_table_metadata_locationsMap of table metadata locations
s3_table_modified_atMap of last-modified timestamps
s3_table_modified_byMap of account IDs that last modified each table
s3_table_owner_account_idsMap of account IDs that own each table
s3_table_typesMap of table types (customer or aws)
s3_table_version_tokensMap of version tokens for the current table data
s3_table_warehouse_locationsMap of S3 URIs pointing to the table data

Examples

Create a table bucket without any tables. Tables can be added later or managed separately.
module "s3_table_bucket" {
  source = "terraform-aws-modules/s3-bucket/aws//modules/table-bucket"

  table_bucket_name = "my-analytics-bucket"

  tags = {
    Environment = "production"
  }
}

Referencing outputs

output "table_bucket_arn" {
  value = module.s3_table_bucket.s3_table_bucket_arn
}

output "events_table_arn" {
  value = module.s3_table_bucket.s3_table_arns["events"]
}

output "warehouse_locations" {
  value = module.s3_table_bucket.s3_table_warehouse_locations
}
S3 Table Buckets and the aws_s3tables_* resources require AWS provider version >= 6.37 and Terraform >= 1.5.7.