Skip to content

Commit

Permalink
allow public accessible policy (#288)
Browse files Browse the repository at this point in the history
Co-authored-by: Andriy Knysh <[email protected]>
  • Loading branch information
milldr and aknysh authored Jul 27, 2023
1 parent da423ce commit 1dc4708
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -305,12 +305,17 @@ resource "aws_s3_bucket" "origin" {
}

resource "aws_s3_bucket_public_access_block" "origin" {
count = (local.create_s3_origin_bucket || local.override_origin_bucket_policy) ? 1 : 0
bucket = local.bucket
block_public_acls = true
count = (local.create_s3_origin_bucket || local.override_origin_bucket_policy) ? 1 : 0

bucket = local.bucket

# Allows the bucket to be publicly accessible by policy
block_public_policy = var.block_origin_public_access_enabled
ignore_public_acls = true
restrict_public_buckets = true
restrict_public_buckets = var.block_origin_public_access_enabled

# Always block ACL access. We're using policies instead
block_public_acls = true
ignore_public_acls = true
}

resource "aws_s3_bucket_ownership_controls" "origin" {
Expand Down

0 comments on commit 1dc4708

Please sign in to comment.