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