Skip to content

Commit

Permalink
feat: Set object ownership to support CloudFront logs. (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesiarmes authored Oct 17, 2024
1 parent f6c220c commit c0da8f6
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@ resource "aws_s3_bucket" "logs" {
tags = var.tags
}

resource "aws_s3_bucket_ownership_controls" "example" {
bucket = aws_s3_bucket.logs.id

rule {
# This is necessary for certain AWS services to write to the bucket,
# including CloudFront
object_ownership = "ObjectWriter"
}
}

resource "aws_s3_bucket_public_access_block" "good_example" {
bucket = aws_s3_bucket.logs.id
block_public_acls = true
Expand Down

0 comments on commit c0da8f6

Please sign in to comment.