Skip to content

Commit

Permalink
fix: removes local.public_access_block_enabled (#194)
Browse files Browse the repository at this point in the history
  • Loading branch information
rankin-tr committed Jun 3, 2023
1 parent 8559e39 commit 7030cbd
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ locals {
bucket_name = var.bucket_name != null && var.bucket_name != "" ? var.bucket_name : module.this.id
bucket_arn = "arn:${local.partition}:s3:::${join("", aws_s3_bucket.default[*].id)}"

public_access_block_enabled = var.block_public_acls || var.block_public_policy || var.ignore_public_acls || var.restrict_public_buckets

acl_grants = var.grants == null ? [] : flatten(
[
for g in var.grants : [
Expand Down Expand Up @@ -471,7 +469,7 @@ resource "aws_s3_bucket_policy" "default" {
# https://www.terraform.io/docs/providers/aws/r/s3_bucket_public_access_block.html
# for the nuances of the blocking options
resource "aws_s3_bucket_public_access_block" "default" {
count = module.this.enabled && local.public_access_block_enabled ? 1 : 0
count = module.this.enabled ? 1 : 0
bucket = join("", aws_s3_bucket.default[*].id)

block_public_acls = var.block_public_acls
Expand Down

0 comments on commit 7030cbd

Please sign in to comment.