diff --git a/modules/instance_template/main.tf b/modules/instance_template/main.tf index 8b076508..fe202049 100644 --- a/modules/instance_template/main.tf +++ b/modules/instance_template/main.tf @@ -96,7 +96,7 @@ resource "google_compute_instance_template" "tpl" { } dynamic "service_account" { - for_each = [var.service_account] + for_each = var.service_account == null ? [] : [var.service_account] content { email = lookup(service_account.value, "email", null) scopes = lookup(service_account.value, "scopes", null)