locals { yq_node_groups = join("\n", flatten([ for name, group in var.node_groups : [ "./yq eval '.nodeGroups.${name}.role = \"${group.role}\"' -i constellation-conf.yaml", "./yq eval '.nodeGroups.${name}.zone = \"${group.zone}\"' -i constellation-conf.yaml", "./yq eval '.nodeGroups.${name}.instanceType = \"${group.instance_type}\"' -i constellation-conf.yaml", "./yq eval '.nodeGroups.${name}.stateDiskSizeGB = ${group.disk_size}' -i constellation-conf.yaml", "./yq eval '.nodeGroups.${name}.stateDiskType = \"${group.disk_type}\"' -i constellation-conf.yaml", "./yq eval '.nodeGroups.${name}.initialCount = ${group.initial_count}' -i constellation-conf.yaml" ] ])) gcp_sa_file_path = "service_account_file.json" } resource "null_resource" "ensure_cli" { provisioner "local-exec" { command = < "${local.gcp_sa_file_path}" EOT } provisioner "local-exec" { when = destroy command = "rm ${self.triggers.file_path}" } triggers = { always_run = timestamp() file_path = local.gcp_sa_file_path } } resource "null_resource" "gcp_config" { count = var.gcp_config != null ? 1 : 0 provisioner "local-exec" { command = <