diff --git a/main.tf b/main.tf index ad9aeab..8cf1eec 100644 --- a/main.tf +++ b/main.tf @@ -40,7 +40,7 @@ module "terraform_state_bucket_logs" { s3_bucket_name = local.logging_bucket default_allow = false s3_log_bucket_retention = var.log_retention - enable_versioning = var.log_bucket_versioning + versioning_status = var.log_bucket_versioning tags = var.log_bucket_tags } diff --git a/variables.tf b/variables.tf index 0c432df..3c6f49b 100644 --- a/variables.tf +++ b/variables.tf @@ -42,9 +42,13 @@ variable "log_name" { } variable "log_bucket_versioning" { - description = "Bool for toggling versioning for log bucket" - type = bool - default = false + description = "A string that indicates the versioning status for the log bucket." + default = "Disabled" + type = string + validation { + condition = contains(["Enabled", "Disabled", "Suspended"], var.log_bucket_versioning) + error_message = "Valid values for versioning_status are Enabled, Disabled, or Suspended." + } } variable "state_bucket_tags" {