From 1f7627cb50dd3ba8bea6694e8dbac45482fe895d Mon Sep 17 00:00:00 2001 From: Mike VanDenburgh <37340715+mvandenburgh@users.noreply.github.com> Date: Mon, 6 Jan 2025 21:04:34 -0500 Subject: [PATCH] Fix `noncurrent_version_expiration` The `noncurrent_days` field is actually mandatory. The AWS Terraform provider docs are incorrect, see https://github.com/hashicorp/terraform-provider-aws/issues/35328 --- terraform/modules/dandiset_bucket/main.tf | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/terraform/modules/dandiset_bucket/main.tf b/terraform/modules/dandiset_bucket/main.tf index 38415f6..37ad8d9 100644 --- a/terraform/modules/dandiset_bucket/main.tf +++ b/terraform/modules/dandiset_bucket/main.tf @@ -357,9 +357,11 @@ resource "aws_s3_bucket_lifecycle_configuration" "expire_noncurrent_manifest_fil prefix = "dandisets/" } - # Only keep 1 noncurrent version of manifest files noncurrent_version_expiration { + # keep most recent noncurrent version indefinitely newer_noncurrent_versions = 1 + # delete all other noncurrent versions after 1 day + noncurrent_days = 1 } # Also delete any delete markers associated with the expired object