Hi Community,
I had created terraform code to deploy the Azure virtual desktops. The code is working fine and it is creating the VMs in Azure. However when i try to create new VMs, it is replacing the existing ones and redeploying them… Any guidance on how can I do incremental deployment?.
The code is here
resource “azurerm_windows_virtual_machine” “avd_vm” {
count = var.rdsh_count
name = “{var.prefix}-{count.index + 1}”
resource_group_name = azurerm_resource_group.rg.name
location = azurerm_resource_group.rg.location
size = var.vm_size
network_interface_ids = [“${azurerm_network_interface.avd_vm_nic.*.id[count.index]}”]
provision_vm_agent = true
admin_username = var.local_admin_username
admin_password = var.local_admin_password
os_disk {
name = “{lower(var.prefix)}-{count.index + 1}”
caching = “ReadWrite”
storage_account_type = “Standard_LRS”
}