From 4dadbd69b504099ea82fbec250a0ce031ceb3896 Mon Sep 17 00:00:00 2001 From: xpk Date: Fri, 12 Jan 2024 15:14:46 +0800 Subject: [PATCH] UPD: added intelligent tiering and a couple other replication parameters to s3-bucket-replication module --- modules/storage/s3-bucket-replication/main.tf | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/modules/storage/s3-bucket-replication/main.tf b/modules/storage/s3-bucket-replication/main.tf index a5b5a4c..f114e26 100644 --- a/modules/storage/s3-bucket-replication/main.tf +++ b/modules/storage/s3-bucket-replication/main.tf @@ -116,22 +116,37 @@ resource "aws_s3_bucket_replication_configuration" "replication-config" { destination { bucket = data.aws_s3_bucket.destination-bucket.arn + storage_class = "INTELLIGENT_TIERING" account = var.destination-bucket-account-id + access_control_translation { owner = "Destination" } + encryption_configuration { replica_kms_key_id = var.destination-bucket-encryption-key-arn } + + replication_time { + status = "Enabled" + time { + minutes = 15 + } + } + metrics { status = "Enabled" + event_threshold { + minutes = 15 + } } } } } resource "aws_s3_object" "test-file" { - bucket = data.aws_s3_bucket.source-bucket.id - key = "replication-test-file" - content = "If this file shows up in the destination bucket, replication has been successfully configured." + depends_on = [aws_s3_bucket_replication_configuration.replication-config] + bucket = data.aws_s3_bucket.source-bucket.id + key = "replication-test-file" + content = "If this file shows up in the destination bucket, replication has been successfully configured." } \ No newline at end of file