Skip to content

Commit 30a9e9f

Browse files
authored
fix: crash when replication is disabled (#113)
1 parent 42f63c6 commit 30a9e9f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

replica.tf

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,11 @@ resource "aws_s3_bucket" "replica" {
174174
}
175175

176176
resource "aws_s3_bucket_ownership_controls" "replica" {
177-
bucket = aws_s3_bucket.replica[0].id
177+
count = var.enable_replication ? 1 : 0
178178
provider = aws.replica
179179

180+
bucket = aws_s3_bucket.replica[0].id
181+
180182
rule {
181183
object_ownership = "BucketOwnerPreferred"
182184
}

0 commit comments

Comments
 (0)