Skip to content
This repository has been archived by the owner on Sep 27, 2024. It is now read-only.

Commit

Permalink
Batiai-1398 Fix object cycle (#7)
Browse files Browse the repository at this point in the history
* BATIAI-1398 updated code to have 7 day expiration on dev environments
  • Loading branch information
arunsanna authored Mar 29, 2023
1 parent 42b2be8 commit b47fb7b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}

0 comments on commit b47fb7b

Please sign in to comment.