Skip to content

Commit

Permalink
use null as default for lookup (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
cyuanli committed Sep 2, 2024
1 parent b0a6543 commit a3a8c8c
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,7 @@ resource "google_storage_bucket" "buckets" {
}

dynamic "retention_policy" {
for_each = lookup(var.retention_policy, each.value, {
is_locked = null
retention_period = null
}) != {} ? [var.retention_policy[each.value]] : []
for_each = lookup(var.retention_policy, each.value, null) != null ? [var.retention_policy[each.value]] : []
content {
is_locked = lookup(retention_policy.value, "is_locked", null)
retention_period = lookup(retention_policy.value, "retention_period", null)
Expand Down

0 comments on commit a3a8c8c

Please sign in to comment.