From f025f396a86883e276fc3e281e8acc63da35d378 Mon Sep 17 00:00:00 2001 From: jackleary Date: Mon, 19 May 2025 16:24:37 +0100 Subject: [PATCH 1/2] NRL-1486 Reduce initial storage to 2 days and infrequent access to 7 --- terraform/account-wide-infrastructure/modules/glue/locals.tf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/terraform/account-wide-infrastructure/modules/glue/locals.tf b/terraform/account-wide-infrastructure/modules/glue/locals.tf index 1ae650b70..e92fe2a6c 100644 --- a/terraform/account-wide-infrastructure/modules/glue/locals.tf +++ b/terraform/account-wide-infrastructure/modules/glue/locals.tf @@ -3,11 +3,11 @@ locals { transition_storage = { infrequent_access = { storage_class = "STANDARD_IA" - days = 150 + days = 2 } glacier = { storage_class = "GLACIER" - days = 200 + days = 7 } } From e69b469e74027f6777ecd76af5cd5acda9303da9 Mon Sep 17 00:00:00 2001 From: jackleary Date: Mon, 19 May 2025 19:29:26 +0100 Subject: [PATCH 2/2] NRL-1486 Expire logs after 1 day. Up firehose filesize to further lower number of files --- .../modules/glue/locals.tf | 13 +------------ .../account-wide-infrastructure/modules/glue/s3.tf | 8 -------- .../infrastructure/modules/firehose/kinesis.tf | 6 ++++-- 3 files changed, 5 insertions(+), 22 deletions(-) diff --git a/terraform/account-wide-infrastructure/modules/glue/locals.tf b/terraform/account-wide-infrastructure/modules/glue/locals.tf index e92fe2a6c..9839cfe34 100644 --- a/terraform/account-wide-infrastructure/modules/glue/locals.tf +++ b/terraform/account-wide-infrastructure/modules/glue/locals.tf @@ -1,18 +1,7 @@ locals { s3 = { - transition_storage = { - infrequent_access = { - storage_class = "STANDARD_IA" - days = 2 - } - glacier = { - storage_class = "GLACIER" - days = 7 - } - } - expiration = { - days = 1095 + days = 1 } } } diff --git a/terraform/account-wide-infrastructure/modules/glue/s3.tf b/terraform/account-wide-infrastructure/modules/glue/s3.tf index 4b1bbff0e..14f7b9824 100644 --- a/terraform/account-wide-infrastructure/modules/glue/s3.tf +++ b/terraform/account-wide-infrastructure/modules/glue/s3.tf @@ -59,14 +59,6 @@ resource "aws_s3_bucket_lifecycle_configuration" "source-data-bucket-lifecycle" id = "bucket-versioning-rule" status = "Enabled" - transition { - days = local.s3.transition_storage.infrequent_access.days - storage_class = local.s3.transition_storage.infrequent_access.storage_class - } - transition { - days = local.s3.transition_storage.glacier.days - storage_class = local.s3.transition_storage.glacier.storage_class - } expiration { days = local.s3.expiration.days } diff --git a/terraform/infrastructure/modules/firehose/kinesis.tf b/terraform/infrastructure/modules/firehose/kinesis.tf index b44735357..144b8fa29 100644 --- a/terraform/infrastructure/modules/firehose/kinesis.tf +++ b/terraform/infrastructure/modules/firehose/kinesis.tf @@ -63,8 +63,10 @@ resource "aws_kinesis_firehose_delivery_stream" "reporting_stream" { destination = "extended_s3" extended_s3_configuration { - role_arn = aws_iam_role.firehose.arn - bucket_arn = var.reporting_bucket_arn + role_arn = aws_iam_role.firehose.arn + bucket_arn = var.reporting_bucket_arn + buffering_size = 64 + buffering_interval = 600 processing_configuration { enabled = "true"