Skip to content

Commit

Permalink
Try default lifecycle rules.
Browse files Browse the repository at this point in the history
  • Loading branch information
herman-wong-cf committed Jan 16, 2024
1 parent 0919cfb commit 4470347
Showing 1 changed file with 36 additions and 21 deletions.
57 changes: 36 additions & 21 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -47,34 +47,49 @@ variable "kms_master_key_id" {

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

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

enable_glacier_transition = bool
enable_deeparchive_transition = bool
enable_standard_ia_transition = bool
enable_current_object_expiration = bool
enable_noncurrent_version_expiration = bool

abort_incomplete_multipart_upload_days = number
noncurrent_version_glacier_transition_days = number
noncurrent_version_deeparchive_transition_days = number
noncurrent_version_expiration_days = number

standard_transition_days = number
glacier_transition_days = number
deeparchive_transition_days = number
expiration_days = number
tags = optional(map(string), null)

enable_glacier_transition = optional(bool, true)
enable_deeparchive_transition = optional(bool, false)
enable_standard_ia_transition = optional(bool, false)
enable_current_object_expiration = optional(bool, true)
enable_noncurrent_version_expiration = optional(bool, true)

abort_incomplete_multipart_upload_days = optional(number, null)
noncurrent_version_glacier_transition_days = optional(number, null)
noncurrent_version_deeparchive_transition_days = optional(number, null)
noncurrent_version_expiration_days = optional(number, null)

standard_transition_days = optional(number, null)
glacier_transition_days = optional(number, null)
deeparchive_transition_days = optional(number, null)
expiration_days = optional(number, null)
}))
default = 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
}
]
description = "A list of lifecycle rules"
}

Expand Down Expand Up @@ -250,4 +265,4 @@ variable "attach_policy" {
description = "Controls if S3 bucket should have bucket policy attached (set to `true` to use value of `policy` as bucket policy)"
type = bool
default = false
}
}

0 comments on commit 4470347

Please sign in to comment.