https://github.com/geekcell/terraform-aws-s3
Terraform module to provision an AWS S3 bucket.
https://github.com/geekcell/terraform-aws-s3
aws s3 s3-bucket terraform terraform-module
Last synced: 9 months ago
JSON representation
Terraform module to provision an AWS S3 bucket.
- Host: GitHub
- URL: https://github.com/geekcell/terraform-aws-s3
- Owner: geekcell
- License: apache-2.0
- Created: 2023-02-07T10:30:34.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-07-01T00:24:16.000Z (about 3 years ago)
- Last Synced: 2025-10-09T19:31:55.421Z (9 months ago)
- Topics: aws, s3, s3-bucket, terraform, terraform-module
- Language: HCL
- Homepage: https://www.geekcell.io
- Size: 64.5 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://www.geekcell.io/)
### Code Quality
[](https://github.com/geekcell/terraform-aws-s3/blob/master/LICENSE)
[](https://github.com/geekcell/terraform-aws-s3/releases)
[](https://github.com/geekcell/terraform-aws-s3/actions/workflows/release.yaml)
[](https://github.com/geekcell/terraform-aws-s3/actions/workflows/validate.yaml)
[](https://github.com/geekcell/terraform-aws-s3/actions/workflows/linter.yaml)
[](https://github.com/geekcell/terraform-aws-s3/actions/workflows/test.yaml)
# Terraform AWS S3
This Terraform module provides a preconfigured solution for setting up
AWS S3 buckets in your AWS account. With this module, you can easily
and efficiently create and manage S3 buckets with advanced features
such as transitions, security, encryption, and public access restriction.
Our team has extensive experience working with AWS S3 and has optimized
this module to provide the best possible experience for users.
By using this Terraform module, you can save time and effort in setting up
and managing your S3 buckets, as well as ensure that your data is secure
and protected. The module encapsulates all necessary configurations,
making it easy to use and integrate into your existing AWS environment.
Whether you are just getting started with AWS S3 or looking for a more
efficient way to manage your buckets, this Terraform module provides a
preconfigured solution with advanced features.
## Inputs
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| [expiration](#input\_expiration) | The number of days after which to expunge the objects. | `number` | `0` | no |
| [name](#input\_name) | The name of the bucket. | `string` | n/a | yes |
| [noncurrent\_version\_expiration](#input\_noncurrent\_version\_expiration) | The number of days after which to delete the noncurrent object. | `number` | `90` | no |
| [noncurrent\_version\_transitions](#input\_noncurrent\_version\_transitions) | Transition to another storage class for noncurrent\_versions. |
list(object({
noncurrent_days = number
storage_class = string
})) | [
{
"noncurrent_days": 30,
"storage_class": "STANDARD_IA"
}
]
| no |
| [policy](#input\_policy) | A valid bucket policy JSON document. | `string` | `null` | no |
| [tags](#input\_tags) | Tags to add to the AWS Customer Managed Key. | `map(any)` | `{}` | no |
| [transitions](#input\_transitions) | Transition to another storage class. | list(object({
days = number
storage_class = string
})) | [
{
"days": 30,
"storage_class": "STANDARD_IA"
},
{
"days": 60,
"storage_class": "GLACIER"
},
{
"days": 180,
"storage_class": "DEEP_ARCHIVE"
}
]
| no |
## Outputs
| Name | Description |
|------|-------------|
| [arn](#output\_arn) | The arn of the bucket. |
| [id](#output\_id) | The id of the bucket. |
## Providers
| Name | Version |
|------|---------|
| [aws](#provider\_aws) | >= 4.40 |
## Resources
- resource.aws_s3_bucket.main (main.tf#19)
- resource.aws_s3_bucket_lifecycle_configuration.main (main.tf#52)
- resource.aws_s3_bucket_metric.main (main.tf#85)
- resource.aws_s3_bucket_policy.main (main.tf#25)
- resource.aws_s3_bucket_public_access_block.main (main.tf#31)
- resource.aws_s3_bucket_server_side_encryption_configuration.main (main.tf#40)
# Examples
### Basic Example
```hcl
module "basic-example" {
source = "../../"
name = var.name
policy = var.policy
}
```
### with Transitions
```hcl
module "with-transitions" {
source = "../../"
name = "my-bucket-123"
transitions = [
{
storage_class = "STANDARD_IA"
days = 90
}
]
}
```