Skip to content

Commit

Permalink
Default to BucketOwnerEnforced s3 bucket ownership controls (#929)
Browse files Browse the repository at this point in the history
  • Loading branch information
0AdityaD authored Aug 1, 2022
1 parent 78b0087 commit ce5d57f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions modules/aws_s3/tf_module/bucket.tf
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,14 @@ resource "aws_s3_bucket_public_access_block" "block" {
depends_on = [aws_s3_bucket_policy.policy]
}

resource "aws_s3_bucket_ownership_controls" "ownership_controls" {
bucket = aws_s3_bucket.bucket.id

rule {
object_ownership = "BucketOwnerEnforced"
}
}

resource "aws_s3_bucket_policy" "policy" {
bucket = aws_s3_bucket.bucket.id
policy = data.aws_iam_policy_document.s3_policy.json
Expand Down

0 comments on commit ce5d57f

Please sign in to comment.