Join domain extension not working

Hello, need some help with the join domain extension. I’m deploying VMs using Devops, the deployment works but when I added the join domain extension I started to get some weird erros. This is the error I’m getting:

2021-08-11T15:57:11.0712468Z e[0m on Modules\Windows\main.tf line 46, in resource “azurerm_virtual_machine_extension” “join-domain”:
2021-08-11T15:57:11.0713375Z 46: virtual_machine_id = e[4m[azurerm_windows_virtual_machine.vm1.id]e[0m
2021-08-11T15:57:11.0714001Z e[0m
2021-08-11T15:57:11.0714649Z Inappropriate value for attribute “virtual_machine_id”: string required.
2021-08-11T15:57:11.0715992Z e[0me[0m

Whats the correct value I need to send to the virtual_machine_id? This is the current code, vm1 being a resource in the same module:

resource “azurerm_virtual_machine_extension” “join-domain” {
name = “join-domain”
virtual_machine_id = [azurerm_windows_virtual_machine.vm1.id]
publisher = “Microsoft.Compute”
type = “JsonADDomainExtension”
type_handler_version = “1.3”

settings = <<SETTINGS
{
“Name”: “{var.domainname}", "OUPath": "OU=Test,OU=Servers,OU=Cloud Resources,DC=test,DC=com", "User": "{var.domainname}\{var.domainadmin}", "Restart": "true", "Options": "3" } SETTINGS protected_settings = <<SETTINGS { "Password": "{var.domainadminpassword}”
}
SETTINGS
depends_on = [azurerm_windows_virtual_machine.vm1]
}