{% set config = merged_configs.get('aws_s3_bucket_public_access_block', {}) %}
{% set comments = compliance_comments.get('aws_s3_bucket_public_access_block', []) %}
# ------------------------------------------------------------------------------
# S3 Bucket Public Access Block
# ------------------------------------------------------------------------------
{% for comment in comments %}
# {{ comment }}
{% endfor %}

resource "aws_s3_bucket_public_access_block" "this" {
  bucket = aws_s3_bucket.this.id

  block_public_acls       = {{ config.get('block_public_acls', true) | lower }}
  block_public_policy     = {{ config.get('block_public_policy', true) | lower }}
  ignore_public_acls      = {{ config.get('ignore_public_acls', true) | lower }}
  restrict_public_buckets = {{ config.get('restrict_public_buckets', true) | lower }}
}
