diff --git a/s3_bucket.tf b/s3_bucket.tf index a0e1ff3..2e04890 100644 --- a/s3_bucket.tf +++ b/s3_bucket.tf @@ -13,6 +13,14 @@ resource "aws_s3_bucket" "logs" { tags = local.tags } +resource "aws_s3_bucket_ownership_controls" "logs" { + depends_on = [aws_s3_bucket_policy.logs] + bucket = aws_s3_bucket.logs.id + rule { + object_ownership = "ObjectWriter" + } +} + resource "aws_s3_bucket_policy" "logs" { bucket = aws_s3_bucket.logs.id policy = data.aws_iam_policy_document.bucket_policy.json