From 26e84939279e277493ca7f0ef087a7be1565312e Mon Sep 17 00:00:00 2001 From: nozaq Date: Sat, 16 Apr 2022 16:56:30 +0900 Subject: [PATCH] feat: use S3 replication rule V2 (#85) --- README.md | 6 +++--- main.tf | 2 +- replica.tf | 7 ++++++- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 2602faa..67d0405 100644 --- a/README.md +++ b/README.md @@ -83,14 +83,14 @@ See [the official document](https://www.terraform.io/docs/backends/types/s3.html | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.1.4 | -| [aws](#requirement\_aws) | >= 4.0 | +| [aws](#requirement\_aws) | >= 4.3 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 4.0 | -| [aws.replica](#provider\_aws.replica) | >= 4.0 | +| [aws](#provider\_aws) | >= 4.3 | +| [aws.replica](#provider\_aws.replica) | >= 4.3 | ## Inputs diff --git a/main.tf b/main.tf index e1f8c66..0b72607 100644 --- a/main.tf +++ b/main.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 4.0" + version = ">= 4.3" configuration_aliases = [aws.replica] } diff --git a/replica.tf b/replica.tf index 47a4d6c..51a6566 100644 --- a/replica.tf +++ b/replica.tf @@ -260,9 +260,14 @@ resource "aws_s3_bucket_replication_configuration" "state" { rule { id = "replica_configuration" - prefix = "" status = "Enabled" + filter {} + + delete_marker_replication { + status = "Disabled" + } + source_selection_criteria { sse_kms_encrypted_objects { status = "Enabled"