From b47fb7b6c30ad16e460df80eeb5717fa89f082f9 Mon Sep 17 00:00:00 2001 From: thisiz_A Date: Wed, 29 Mar 2023 12:59:34 -0400 Subject: [PATCH] Batiai-1398 Fix object cycle (#7) * BATIAI-1398 updated code to have 7 day expiration on dev environments --- main.tf | 2 +- variables.tf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/main.tf b/main.tf index ec15881..2925e37 100644 --- a/main.tf +++ b/main.tf @@ -98,7 +98,7 @@ resource "aws_s3_bucket_server_side_encryption_configuration" "bucket" { # Lifecycle configuration for the dev buckets to remove all objects older than var.lifecycle_expiration_days. resource "aws_s3_bucket_lifecycle_configuration" "lifecycle_expiration_days" { - for_each = var.lifecycle_expiration_days > 0 ? aws_s3_bucket.landing_zone_buckets : [] + for_each = var.lifecycle_expiration_days > 0 ? aws_s3_bucket.landing_zone_buckets : {} bucket = each.value.id diff --git a/variables.tf b/variables.tf index cb78bd5..b428dbd 100644 --- a/variables.tf +++ b/variables.tf @@ -25,7 +25,7 @@ variable "sse_algorithm" { } variable "lifecycle_expiration_days" { - type = string + type = number default = "0" description = "Number of days for object lifecycle to expire the objects in dev env. Defaults to 0, which disables the rule" } \ No newline at end of file