From 167f0f01a73857ad8bf69a7e61159f8a73eb701e Mon Sep 17 00:00:00 2001 From: atthematyo Date: Mon, 17 Jun 2024 11:57:49 -0700 Subject: [PATCH] Update main.tf --- main.tf | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/main.tf b/main.tf index d2cbc62..0d39706 100644 --- a/main.tf +++ b/main.tf @@ -9,7 +9,16 @@ resource "aws_s3_bucket" "main" { } +resource "aws_s3_bucket_ownership_controls" "main" { + bucket = aws_s3_bucket.main.id + rule { + object_ownership = "BucketOwnerPreferred" + } +} + resource "aws_s3_bucket_acl" "main_acl" { + depends_on = [aws_s3_bucket_ownership_controls.main] + bucket = aws_s3_bucket.main.id acl = "private" }