Skip to content

Commit

Permalink
Updating for_each expression, fix linting error
Browse files Browse the repository at this point in the history
  • Loading branch information
shujaatsscripts committed Oct 28, 2024
1 parent c23c657 commit 1a03194
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions modules/compute-vm/resource-policies.tf
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,7 @@ resource "google_compute_resource_policy" "snapshot" {
}

resource "google_compute_disk_resource_policy_attachment" "boot" {
for_each = var.boot_disk.snapshot_schedule != null ? {
for i, v in var.boot_disk.snapshot_schedule : i => v
} : {}
for_each = var.boot_disk.snapshot_schedule != null ? toset(var.boot_disk.snapshot_schedule) : []
project = var.project_id
zone = var.zone
name = try(
Expand Down

0 comments on commit 1a03194

Please sign in to comment.