Fixed private IP address for azurerm_windows_virtual_machine

Hello, This is slee

I’m testing creating a vm with azurerm provider on teraform.

I want to set a fixed value of private ip in the “azurerm_windows_virtual_machine” resource, but I don’t know, so I’ll ask!

My module – (virtual_machine) main.tf

resource "azurerm_network_interface" "vm" {
  count                         = var.number_instances
  name                          = "${var.vm_hostname}-nic-${count.index}"
  resource_group_name           = data.azurerm_resource_group.rg.name
  location                      = data.azurerm_resource_group.rg.location


  ip_configuration {
    name                          = "${var.vm_hostname}-ip-${count.index}"
    subnet_id                     = data.azurerm_subnet.ski-osm-dev-ap-subnet.id
    private_ip_address_allocation = "Static"
 #       private_ip_addresses     = var.private_ip_addresses_list
private_ip_address = var.private_ip_addresses_list
    public_ip_address_id          = length(azurerm_public_ip.vm.*.id) > 0 ? element(concat(azurerm_public_ip.vm.*.id, tolist([""])), count.index) : ""
  }

  tags = var.tags
}

My module – (virtual_machine) variablestf

variable "private_ip_addresses_list" {
 type   = list(string)
}


My service – (virtual_machine) main.tf
module "windowsservers" {
  source              = "../../../modules/virtual_machine"
#  for_each     = var.private_ip_addresses
  number_instances    = var.vm_count
  resource_group_name = data.azurerm_resource_group.rg.name
  network_security_group_name   = data.azurerm_network_security_group.nsg.name
  is_windows_image    = true
  vm_hostname         = var.vm_hostname
 # admin_user         = var.admin_user
  admin_password      = var.admin_password
  vm_os_defined       = var.vm_os
#  vnet-import_subnet_id      = data.azurerm_subnet.ski-osm-dev-ap-subnet.id
  remote_port         = "3389"
 # managed_disk_name   = "iac-data-disk-${count.index}"
# network_interface_name = "${var.network_interface_name}-nic-${count.index}"
  private_ip_addresses_list = var.private_ip_addresses

  tags                = var.tags
  vm_size             = var.vm_type

}

My service – (virtual_machine) variables.tf

variable "private_ip_addresses" {
type = list(string)
}

Ip.tfvars

private_ip_addresses    = ["10.0.1.10, 10.0.1.11"]

What’s the problem?

+Private_ip_addresses has an argument in the document, but when applied, there is no corresponding argument.

Please check this as well!