Skip to content

Commit

Permalink
Remove ACL for log-deliver-write and use bucket policy for it
Browse files Browse the repository at this point in the history
There's the following issue when trying to create the acl for log-delivery-write:

This bucket has the bucket owner enforced setting applied for Object Ownership. When bucket owner enforced is applied, you must use bucket policies to control access. The bucker will not allow the creation of ACLs
  • Loading branch information
SGTyler committed May 27, 2023
1 parent 0e37d47 commit f0703b1
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ data "aws_iam_policy_document" "bucket_policy" {
type = "Service"
}
resources = [
"${aws_s3_bucket.bucket.arn}/elb/*"
"${aws_s3_bucket.bucket.arn}/*"
]
condition {
test = "StringEquals"
Expand Down Expand Up @@ -139,11 +139,6 @@ resource "aws_s3_bucket_versioning" "resource" {
}
}

resource "aws_s3_bucket_acl" "bucket" {
bucket = aws_s3_bucket.bucket.id
acl = "log-delivery-write"
}

resource "aws_s3_bucket_lifecycle_configuration" "bucket" {
bucket = aws_s3_bucket.bucket.id

Expand Down Expand Up @@ -228,4 +223,4 @@ resource "aws_s3_bucket_public_access_block" "bucket" {
ignore_public_acls = true
block_public_policy = true
restrict_public_buckets = true
}
}

0 comments on commit f0703b1

Please sign in to comment.