An open API service indexing awesome lists of open source software.

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.

Awesome Lists containing this project

README

          

[![Geek Cell GmbH](https://raw.githubusercontent.com/geekcell/.github/main/geekcell-github-banner.png)](https://www.geekcell.io/)

### Code Quality
[![License](https://img.shields.io/github/license/geekcell/terraform-aws-s3)](https://github.com/geekcell/terraform-aws-s3/blob/master/LICENSE)
[![GitHub release (latest tag)](https://img.shields.io/github/v/release/geekcell/terraform-aws-s3?logo=github&sort=semver)](https://github.com/geekcell/terraform-aws-s3/releases)
[![Release](https://github.com/geekcell/terraform-aws-s3/actions/workflows/release.yaml/badge.svg)](https://github.com/geekcell/terraform-aws-s3/actions/workflows/release.yaml)
[![Validate](https://github.com/geekcell/terraform-aws-s3/actions/workflows/validate.yaml/badge.svg)](https://github.com/geekcell/terraform-aws-s3/actions/workflows/validate.yaml)
[![Lint](https://github.com/geekcell/terraform-aws-s3/actions/workflows/linter.yaml/badge.svg)](https://github.com/geekcell/terraform-aws-s3/actions/workflows/linter.yaml)
[![Test](https://github.com/geekcell/terraform-aws-s3/actions/workflows/test.yaml/badge.svg)](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
}
]
}
```