VM not joining windows domain from template clone

My VM i snot joining windows domain from template clone

any idea?

main.tf

===================

Deploying VMware VM

===================

Connect to VMware vSphere vCenter

provider “vsphere” {
user = var.vsphere-user
password = var.vsphere-password
vsphere_server = var.vsphere-vcenter

If you have a self-signed cert

allow_unverified_ssl = var.vsphere-unverified-ssl
}

Define VMware vSphere

data “vsphere_datacenter” “dc” {
name = var.vsphere-datacenter
}
data “vsphere_datastore” “datastore” {
name = var.vm-datastore
datacenter_id = data.vsphere_datacenter.dc.id
}
data “vsphere_compute_cluster” “cluster” {
name = var.vsphere-cluster
datacenter_id = data.vsphere_datacenter.dc.id
}
data “vsphere_network” “network” {
name = var.vm-network
datacenter_id = data.vsphere_datacenter.dc.id
}
data “vsphere_virtual_machine” “template” {
name = “/{var.vsphere-datacenter}/vm/{var.vsphere-template-folder}/${var.vm-template-name}”
datacenter_id = data.vsphere_datacenter.dc.id
}

Create VMs

resource “vsphere_virtual_machine” “vm” {
count = var.vm-count
name = “{var.vm-name}-{count.index + 1}”
resource_pool_id = data.vsphere_compute_cluster.cluster.resource_pool_id
datastore_id = data.vsphere_datastore.datastore.id
num_cpus = var.vm-cpu
memory = var.vm-ram
guest_id = var.vm-guest-id
scsi_type = data.vsphere_virtual_machine.template.scsi_type
network_interface {
network_id = data.vsphere_network.network.id
}
disk {
label = “Hard Disk 1”
size = data.vsphere_virtual_machine.template.disks.0.size
eagerly_scrub = data.vsphere_virtual_machine.template.disks.0.eagerly_scrub
thin_provisioned = data.vsphere_virtual_machine.template.disks.0.thin_provisioned
}

clone {
template_uuid = data.vsphere_virtual_machine.template.id
customize {
timeout = 0

  windows_options {
    computer_name = "${var.vm-name}-${count.index + 1}"
  #  workgroup = "workgroup"
  # admin_password = "4r8d3rzs!"
    join_domain = var.vm-domain
    domain_admin_user = var.domain_user
    domain_admin_password = var.domain_pass
  }

network_interface {}

}
}
}

terraform.tfvars

VMware VMs configuration

vm-count = “1”
vm-name = “tftest”
vm-template-name = “2016STDx64_Template_7-26-18”
vm-cpu = “2”
vm-ram = “4096”
vm-guest-id = “windows9Server64Guest”

VMware vSphere configuration

VMware vCenter IP/FQDN

vsphere-vcenter = “10.200.1.26”

VMware vSphere username used to deploy the infrastructure

vsphere-user = “administrator@vsphere.local”

VMware vSphere password used to deploy the infrastructure

vsphere-password = “Password123@”

Skip the verification of the vCenter SSL certificate (true/false)

vsphere-unverified-ssl = “true”

vSphere datacenter name where the infrastructure will be deployed

vsphere-datacenter = “RW-VA”

vSphere cluster name where the infrastructure will be deployed

vsphere-cluster = “RW-VA”

vSphere Datastore used to deploy VMs

vm-datastore = “RW-VA-NIM-VOL1”

vSphere Network used to deploy VMs

vm-network = “vlan200”

vm-domain = “mydom.com
domain_user = “adm-tkw@mydom.com
domain_pass = “my pass”

I managed to fix the domain join issue by changing passw3ord to one without spaces.

why doesnt terraform recogize my password with spaces?