Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,14 +202,14 @@ module "s3_bucket" {
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.3.0 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.9.0 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.27 |
| <a name="requirement_time"></a> [time](#requirement\_time) | >= 0.7 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 4.9.0 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.27 |
| <a name="provider_time"></a> [time](#provider\_time) | >= 0.7 |

## Modules
Expand Down Expand Up @@ -289,7 +289,7 @@ module "s3_bucket" {
| <a name="input_lifecycle_configuration_rules"></a> [lifecycle\_configuration\_rules](#input\_lifecycle\_configuration\_rules) | A list of lifecycle V2 rules | <pre>list(object({<br/> enabled = optional(bool, true)<br/> id = string<br/><br/> abort_incomplete_multipart_upload_days = optional(number)<br/><br/> # `filter_and` is the `and` configuration block inside the `filter` configuration.<br/> # This is the only place you should specify a prefix.<br/> filter_and = optional(object({<br/> object_size_greater_than = optional(number) # integer >= 0<br/> object_size_less_than = optional(number) # integer >= 1<br/> prefix = optional(string)<br/> tags = optional(map(string), {})<br/> }))<br/> expiration = optional(object({<br/> date = optional(string) # string, RFC3339 time format, GMT<br/> days = optional(number) # integer > 0<br/> expired_object_delete_marker = optional(bool)<br/> }))<br/> noncurrent_version_expiration = optional(object({<br/> newer_noncurrent_versions = optional(number) # integer > 0<br/> noncurrent_days = optional(number) # integer >= 0<br/> }))<br/> transition = optional(list(object({<br/> date = optional(string) # string, RFC3339 time format, GMT<br/> days = optional(number) # integer > 0<br/> storage_class = optional(string)<br/> # string/enum, one of GLACIER, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, DEEP_ARCHIVE, GLACIER_IR.<br/> })), [])<br/><br/> noncurrent_version_transition = optional(list(object({<br/> newer_noncurrent_versions = optional(number) # integer >= 0<br/> noncurrent_days = optional(number) # integer >= 0<br/> storage_class = optional(string)<br/> # string/enum, one of GLACIER, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, DEEP_ARCHIVE, GLACIER_IR.<br/> })), [])<br/> }))</pre> | `[]` | no |
| <a name="input_lifecycle_rule_ids"></a> [lifecycle\_rule\_ids](#input\_lifecycle\_rule\_ids) | DEPRECATED (use `lifecycle_configuration_rules`): A list of IDs to assign to corresponding `lifecycle_rules` | `list(string)` | `[]` | no |
| <a name="input_lifecycle_rules"></a> [lifecycle\_rules](#input\_lifecycle\_rules) | DEPRECATED (`use lifecycle_configuration_rules`): A list of lifecycle rules | <pre>list(object({<br/> prefix = string<br/> enabled = bool<br/> tags = map(string)<br/><br/> enable_glacier_transition = bool<br/> enable_deeparchive_transition = bool<br/> enable_standard_ia_transition = bool<br/> enable_current_object_expiration = bool<br/> enable_noncurrent_version_expiration = bool<br/><br/> abort_incomplete_multipart_upload_days = number<br/> noncurrent_version_glacier_transition_days = number<br/> noncurrent_version_deeparchive_transition_days = number<br/> noncurrent_version_expiration_days = number<br/><br/> standard_transition_days = number<br/> glacier_transition_days = number<br/> deeparchive_transition_days = number<br/> expiration_days = number<br/> }))</pre> | `null` | no |
| <a name="input_logging"></a> [logging](#input\_logging) | Bucket access logging configuration. Empty list for no logging, list of 1 to enable logging. | <pre>list(object({<br/> bucket_name = string<br/> prefix = string<br/> }))</pre> | `[]` | no |
| <a name="input_logging"></a> [logging](#input\_logging) | Bucket access logging configuration. Empty list for no logging, list of 1 to enable logging. | <pre>list(object({<br/> bucket_name = string<br/> prefix = string<br/> object_key_partition_date = string<br/> }))</pre> | `[]` | no |
| <a name="input_minimum_tls_version"></a> [minimum\_tls\_version](#input\_minimum\_tls\_version) | Set the minimum TLS version for in-transit traffic | `string` | `null` | no |
| <a name="input_name"></a> [name](#input\_name) | ID element. Usually the component or solution name, e.g. 'app' or 'jenkins'.<br/>This is the only ID element not also included as a `tag`.<br/>The "name" tag is set to the full `id` string. There is no tag with the value of the `name` input. | `string` | `null` | no |
| <a name="input_namespace"></a> [namespace](#input\_namespace) | ID element. Usually an abbreviation of your organization name, e.g. 'eg' or 'cp', to help ensure generated IDs are globally unique | `string` | `null` | no |
Expand Down
2 changes: 1 addition & 1 deletion examples/complete/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 4.9.0"
version = ">= 5.27"
}
time = {
source = "hashicorp/time"
Expand Down
9 changes: 9 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,15 @@ resource "aws_s3_bucket_logging" "default" {

target_bucket = var.logging[0]["bucket_name"]
target_prefix = var.logging[0]["prefix"]

dynamic "target_object_key_format" {
for_each = try(var.logging[0]["object_key_partition_date"], "") != "" ? [1] : []
content {
partitioned_prefix {
partition_date_source = var.logging[0]["object_key_partition_date"]
}
}
}
}

# https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-encryption.html
Expand Down
5 changes: 3 additions & 2 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,9 @@ variable "versioning_enabled" {

variable "logging" {
type = list(object({
bucket_name = string
prefix = string
bucket_name = string
prefix = string
object_key_partition_date = string
}))
default = []
description = "Bucket access logging configuration. Empty list for no logging, list of 1 to enable logging."
Expand Down
2 changes: 1 addition & 1 deletion versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 4.9.0"
version = ">= 5.27"
}
time = {
source = "hashicorp/time"
Expand Down