UPD: added intelligent tiering and a couple other replication parameters to s3-bucket-replication module

This commit is contained in:
xpk 2024-01-12 15:14:46 +08:00
parent 0e0c86f16e
commit 4dadbd69b5
Signed by: xpk
GPG Key ID: CD4FF6793F09AB86

View File

@ -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."
}