Skip to content

Commit

Permalink
feat: update aws acl
Browse files Browse the repository at this point in the history
  • Loading branch information
githubjianli authored Nov 15, 2023
1 parent 4dd9d8c commit 18936e1
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion s3.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"]}),
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 18936e1

Please sign in to comment.