Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Public Bucket Policy #288

Merged
merged 2 commits into from
Jul 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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