Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Make aws_s3_bucket_acl conditional
  • Loading branch information
robwittman committed Mar 8, 2022
commit d2a56eba9cca7b5b369161e9a4b1c8fe588a68b4
4 changes: 3 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,10 @@ resource "aws_s3_bucket_accelerate_configuration" "this" {
}

resource "aws_s3_bucket_acl" "this" {
count = var.acl == "" && length(keys(try(jsondecode(var.access_control_policy), var.access_control_policy))) == 0 ? 0 : 1

bucket = aws_s3_bucket.this.id
acl = var.acl != "null" ? var.acl : null
acl = var.acl

dynamic "access_control_policy" {
for_each = length(try(jsondecode(var.access_control_policy), var.access_control_policy)) == 0 ? [] : [try(jsondecode(var.access_control_policy), var.access_control_policy)]
Expand Down