Skip to content

Commit

Permalink
merge master
Browse files Browse the repository at this point in the history
  • Loading branch information
ian-hoyle committed Jan 22, 2025
2 parents 67aa4b4 + cdf00e6 commit fe00475
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions root_s3_object_lifecycle.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
locals {
default_expiration_days = local.environment == "prod" ? 30 : 7

backend_checks_bucket_policy_status = local.environment == "intg" ? "Enabled" : "Disabled"
}

resource "aws_s3_bucket_lifecycle_configuration" "backend_checks_results_s3_bucket" {
bucket = module.backend_lambda_function_bucket.s3_bucket_id
rule {
id = "delete-backend-checks-results-bucket-objects"
status = local.backend_checks_bucket_policy_status
expiration {
days = local.default_expiration_days
}
noncurrent_version_expiration {
noncurrent_days = local.default_expiration_days
}
}
}

0 comments on commit fe00475

Please sign in to comment.