From eaea580fef56c220b623ce8e8b4ad33121c3a4ea Mon Sep 17 00:00:00 2001 From: Philippe Caseiro Date: Wed, 5 Jul 2023 10:10:11 +0200 Subject: [PATCH] fix(vmware): using data providers instead of vm definition values --- modules/vmware/main.tf | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/modules/vmware/main.tf b/modules/vmware/main.tf index 4bdb69e..d6c4b06 100644 --- a/modules/vmware/main.tf +++ b/modules/vmware/main.tf @@ -14,8 +14,6 @@ variable "vms" { mac = string } )) - resource_pool_id = string - datastore_id = string folder = string } )) @@ -57,10 +55,10 @@ data "vsphere_network" "network" { resource "vsphere_virtual_virtual_machine" "vm" { for_each = var.vms - iterator = "machine" + iterator = "machines" name = "${machine.key}.${machine.value.domain}" - resource_pool_id = "${machine.key.resource_pool_id}" - datastore_id = machine.key.datastore_id + resource_pool_id = data.vsphere_resource_pool.id + datastore_id = data.vsphere_datastore.id folder = machine.folder num_cpus = machine.cpu memory = machine.ram