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,21 +116,36 @@ resource "aws_s3_bucket_replication_configuration" "replication-config" {
destination { destination {
bucket = data.aws_s3_bucket.destination-bucket.arn bucket = data.aws_s3_bucket.destination-bucket.arn
storage_class = "INTELLIGENT_TIERING"
account = var.destination-bucket-account-id account = var.destination-bucket-account-id
access_control_translation { access_control_translation {
owner = "Destination" owner = "Destination"
} }
encryption_configuration { encryption_configuration {
replica_kms_key_id = var.destination-bucket-encryption-key-arn replica_kms_key_id = var.destination-bucket-encryption-key-arn
} }
replication_time {
status = "Enabled"
time {
minutes = 15
}
}
metrics { metrics {
status = "Enabled" status = "Enabled"
event_threshold {
minutes = 15
}
} }
} }
} }
} }
resource "aws_s3_object" "test-file" { resource "aws_s3_object" "test-file" {
depends_on = [aws_s3_bucket_replication_configuration.replication-config]
bucket = data.aws_s3_bucket.source-bucket.id bucket = data.aws_s3_bucket.source-bucket.id
key = "replication-test-file" key = "replication-test-file"
content = "If this file shows up in the destination bucket, replication has been successfully configured." content = "If this file shows up in the destination bucket, replication has been successfully configured."