diff --git a/s3.tf b/s3.tf index 528e1f8..c5dc03c 100644 --- a/s3.tf +++ b/s3.tf @@ -38,7 +38,6 @@ resource "aws_s3_bucket" "apiary_data_bucket" { for schema in local.schemas_info : "${schema["schema_name"]}" => schema } bucket = each.value["data_bucket"] - acl = "private" request_payer = "BucketOwner" policy = local.bucket_policy_map[each.key] tags = merge(tomap({"Name"=each.value["data_bucket"]}), @@ -123,6 +122,15 @@ resource "aws_s3_bucket_ownership_controls" "apiary_bucket" { } } +resource "aws_s3_bucket_acl" "apiary_data_bucket" { + for_each = { + for schema in local.schemas_info : "${schema["schema_name"]}" => schema + } + depends_on = [aws_s3_bucket_ownership_controls.apiary_bucket[each.key]] + bucket = aws_s3_bucket.apiary_data_bucket[each.key].id + acl = "private" +} + resource "aws_s3_bucket_notification" "data_events" { for_each = var.enable_data_events ? { for schema in local.schemas_info : "${schema["schema_name"]}" => schema if lookup(schema, "enable_data_events_sqs", "0") == "0"