Skip to content

Commit 1dc4708

Browse files
milldraknysh
andauthored
allow public accessible policy (#288)
Co-authored-by: Andriy Knysh <[email protected]>
1 parent da423ce commit 1dc4708

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

main.tf

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -305,12 +305,17 @@ resource "aws_s3_bucket" "origin" {
305305
}
306306

307307
resource "aws_s3_bucket_public_access_block" "origin" {
308-
count = (local.create_s3_origin_bucket || local.override_origin_bucket_policy) ? 1 : 0
309-
bucket = local.bucket
310-
block_public_acls = true
308+
count = (local.create_s3_origin_bucket || local.override_origin_bucket_policy) ? 1 : 0
309+
310+
bucket = local.bucket
311+
312+
# Allows the bucket to be publicly accessible by policy
311313
block_public_policy = var.block_origin_public_access_enabled
312-
ignore_public_acls = true
313-
restrict_public_buckets = true
314+
restrict_public_buckets = var.block_origin_public_access_enabled
315+
316+
# Always block ACL access. We're using policies instead
317+
block_public_acls = true
318+
ignore_public_acls = true
314319
}
315320

316321
resource "aws_s3_bucket_ownership_controls" "origin" {

0 commit comments

Comments
 (0)