From 9e5b10b6794b1f97b0dc78df915975698d9b4f5d Mon Sep 17 00:00:00 2001 From: "Michael B. Klein" Date: Tue, 7 Nov 2023 21:16:34 +0000 Subject: [PATCH] Change noncurrent version expiration on fcrepo binary bucket from 7 days to 2 years --- fcrepo/main.tf | 20 +++++++++++++------- modules/dbschema/main.tf | 2 +- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/fcrepo/main.tf b/fcrepo/main.tf index 3d4a9cc..ef0e416 100644 --- a/fcrepo/main.tf +++ b/fcrepo/main.tf @@ -63,10 +63,18 @@ resource "aws_cloudwatch_log_group" "fcrepo_logs" { resource "aws_s3_bucket" "fedora_binary_bucket" { bucket = "${local.namespace}-fedora-binaries" - lifecycle_rule { - abort_incomplete_multipart_upload_days = 2 - enabled = true - id = "purge-deleted-objects" + tags = local.tags +} + +resource "aws_s3_bucket_lifecycle_configuration" "fedora_binary_bucket" { + bucket = aws_s3_bucket.fedora_binary_bucket.id + rule { + id = "purge-deleted-objects" + status = "Enabled" + + abort_incomplete_multipart_upload { + days_after_initiation = 2 + } expiration { days = 0 @@ -74,11 +82,9 @@ resource "aws_s3_bucket" "fedora_binary_bucket" { } noncurrent_version_expiration { - days = 7 + noncurrent_days = 730 } } - - tags = local.tags } resource "aws_iam_user" "fedora_binary_bucket_user" { diff --git a/modules/dbschema/main.tf b/modules/dbschema/main.tf index 482ad88..ca1065c 100644 --- a/modules/dbschema/main.tf +++ b/modules/dbschema/main.tf @@ -25,7 +25,7 @@ resource "random_string" "role_password" { length = 16 upper = true lower = true - number = true + numeric = true special = false }