Skip to content

Commit

Permalink
Remove default lifecycle rules.
Browse files Browse the repository at this point in the history
  • Loading branch information
herman-wong-cf committed Nov 21, 2024
1 parent 3511320 commit e2a09b4
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 19 deletions.
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,28 @@ module "s3_bucket" {
}
```

If you do not specify lifecycle rules when calling this module, none will be created.
Custom lifecycle rules:
```
enable_lifecycle_configuration_rules = true
lifecycle_configuration_rules = [
{
id = "default"
enabled = true
enable_glacier_transition = true
enable_current_object_expiration = true
enable_noncurrent_version_expiration = true
abort_incomplete_multipart_upload_days = 1
noncurrent_version_glacier_transition_days = 90
noncurrent_version_expiration_days = 365
glacier_transition_days = 90
expiration_days = 365
}
]
```

<!-- BEGIN_TF_DOCS -->
## Requirements

Expand Down
23 changes: 4 additions & 19 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ variable "kms_master_key_id" {

variable "enable_lifecycle_configuration_rules" {
type = bool
default = true
default = false
description = "enable or disable lifecycle_configuration_rules"
}

variable "lifecycle_configuration_rules" {
type = list(object({
id = string
id = optional(string)
prefix = optional(string, null)
enabled = bool
enabled = optional(bool)
tags = optional(map(string), null)

enable_glacier_transition = optional(bool, true)
Expand All @@ -74,22 +74,7 @@ variable "lifecycle_configuration_rules" {
deeparchive_transition_days = optional(number, null)
expiration_days = optional(number, null)
}))
default = [
{
id = "default"
enabled = true

enable_glacier_transition = true
enable_current_object_expiration = true
enable_noncurrent_version_expiration = true

abort_incomplete_multipart_upload_days = 1
noncurrent_version_glacier_transition_days = 90
noncurrent_version_expiration_days = 365
glacier_transition_days = 90
expiration_days = 365
}
]
default = []
description = "A list of lifecycle rules"
}

Expand Down

0 comments on commit e2a09b4

Please sign in to comment.