terraform-aws-s3-bucket module repository includes a set of fully-working example configurations. Each example can be deployed as-is or used as a starting point for your own configuration.
Complete
A comprehensive example with most supported features enabled — versioning, encryption, lifecycle rules, CORS, website hosting, logging, and more.
Cross-Region Replication
Demonstrates setting up Cross-Region Replication (CRR) between two S3 buckets in different AWS regions, including the required IAM role.
S3 Notifications
Configures S3 event notifications to Lambda functions, SQS queues, and SNS topics using the
notification submodule.S3 Object
Demonstrates managing S3 bucket objects (files) using the
object submodule, including content uploads, metadata, and encryption.S3 Analytics
Shows how to configure S3 Analytics to analyze storage access patterns and identify data that should be transitioned to a different storage class.
S3 Inventory
Configures S3 Inventory to generate regular reports of objects in your bucket, including metadata and encryption status.
Account-Level Public Access Block
Demonstrates managing S3 account-level Public Access Block settings using the
account-public-access submodule.S3 Directory Bucket
Creates an S3 Directory Bucket — a high-performance bucket type optimized for latency-sensitive use cases in a single Availability Zone.
S3 Table Bucket
Creates an S3 Table Bucket for storing Apache Iceberg tables, with encryption, maintenance configuration, and table creation.
Running an Example
To run any of the examples locally:Each example directory contains its own
main.tf, variables.tf, and outputs.tf. Review the README.md within each example directory for specific instructions and prerequisites.
