From 18936e18f52a676ccfac4fa7dc88c4e122ba382b Mon Sep 17 00:00:00 2001 From: githubjianli <51385385+githubjianli@users.noreply.github.com> Date: Wed, 15 Nov 2023 15:10:44 -0800 Subject: [PATCH] feat: update aws acl --- s3.tf | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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"