Skip to content

Commit

Permalink
allow public accessible policy (cloudposse#288)
Browse files Browse the repository at this point in the history
Co-authored-by: Andriy Knysh <[email protected]>
  • Loading branch information
2 people authored and abeluck committed Aug 11, 2023
1 parent f92d5a0 commit f9b5c1c
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 f9b5c1c

Please sign in to comment.