data "azurerm_subnet" "subnet_manual" { name = "snet-manual" virtual_network_name = azurerm_virtual_network.vnet.name resource_group_name = azurerm_resource_group.rg.name } resource "random_password" "admin_password3" { length = 10 special = true override_special = "!#$%*()-_=+[]{}:?" } resource "azurerm_network_interface" "nic3" { name = "nic-vm-sjoerd3" location = azurerm_resource_group.rg.location resource_group_name = azurerm_resource_group.rg.name ip_configuration { name = "Configuration" subnet_id = data.azurerm_subnet.subnet_manual.id private_ip_address_allocation = "Dynamic" } } resource "azurerm_windows_virtual_machine" "vm3" { name = "vm-sjoerd3" admin_username = "azureuser" admin_password = random_password.admin_password3.result location = azurerm_resource_group.rg.location resource_group_name = azurerm_resource_group.rg.name network_interface_ids = [azurerm_network_interface.nic3.id] size = "Standard_DS1_v2" os_disk { caching = "ReadWrite" storage_account_type = "Standard_LRS" } source_image_reference { publisher = "MicrosoftWindowsServer" offer = "WindowsServer" sku = "2022-datacenter-azure-edition" version = "latest" } }