title: Error: Invalid value for module argument. list of string required
body: <p>I'm running a &quot;terraform plan&quot; against my Linux VM and I'm receiving the following error:</p>
  <pre><code>Error: Invalid value for module argument
  │
  │   on compute_lin_vm.tf line 10, in module &quot;vm-ansiblecontroller&quot;:
  │   10:   nic_id = module.vm-ansiblecontroller.nic_id
  │
  │ The given value is not suitable for child module variable &quot;nic_id&quot; defined at
  │ .terraform/modules/vm-ansiblecontroller/virtual-machine/linux/variables.tf:83,1-18: list of string required.
  </code></pre>
  <p>I haven't included any code from my RGs &amp; vNets, as I'm hoping what I have included is enough to solve this.</p>
  <p>I've set nic_id type to list(string) and it's still giving me the error listed above, I must be missing something simple.</p>
  <pre><code>module &quot;vm-ansiblecontroller&quot; {
    resource_group_name = module.rg-ansiblecontroller.resource_group_name
    location            = local.location
    linux_machine_name  = &quot;linux-test1&quot;
    tags                = var.tags
  
    nic_id = module.vm-ansiblecontroller.nic_id
    subnet_id = module.subnet-networkcore.subnet_id
  
    virtual_machine_size = &quot;Standard_D2&quot;
  
    admin_username       = &quot;jpadmin&quot;
    admin_ssh_public_key = file(&quot;~/.ssh/id_rsa.pub&quot;)
  
    source_image_publisher = &quot;Canonical&quot;
    source_image_offer     = &quot;UbuntuServer&quot;
    source_image_sku       = &quot;16.04-LTS&quot;
    source_image_version   = &quot;latest&quot;
  
    operating_system_disk_cache = &quot;ReadWrite&quot;
    operating_system_disk_type  = &quot;Standard_LRS&quot;
  
    ip_configuration_name         = &quot;internal&quot;
    private_ip_address_allocation = &quot;Dynamic&quot;
  
    public_ip_allocation_method = &quot;Static&quot;
    public_ip_sku               = &quot;Standard&quot;
  
  }
  </code></pre>
  <p>modules/virtualmachine/main.tf</p>
  <pre><code>    # Linux Virtual Machine
      resource &quot;azurerm_linux_virtual_machine&quot; &quot;vm-linux&quot; {
      
        name                = var.linux_machine_name
        location            = var.location
        resource_group_name = var.resource_group_name
        tags                = var.tags
      
        size                            = var.virtual_machine_size
        admin_username                  = var.admin_username
        disable_password_authentication = true
        # network_interface_ids           = [azurerm_network_interface.nic-linux.id]
        network_interface_ids = var.nic_id
      
        admin_ssh_key {
          username   = var.admin_username
          public_key = var.admin_ssh_public_key
        }
      
        source_image_reference {
      
          publisher = var.source_image_publisher
          offer     = var.source_image_offer
          sku       = var.source_image_sku
          version   = var.source_image_version
        }
      
        os_disk {
          caching              = var.operating_system_disk_cache
          storage_account_type = var.operating_system_disk_type
        }
      }
      
      # Network Interfaces for Linux VM
      
      resource &quot;azurerm_network_interface&quot; &quot;nic-linux&quot; {
        name                = var.linux_machine_name
        location            = var.location
        resource_group_name = var.resource_group_name
        tags                = var.tags
      
        ip_configuration {
          name                          = var.ip_configuration_name
          # subnet_id                     = azurerm_subnet.subnet.id
          subnet_id                     = var.subnet_id
          private_ip_address_allocation = var.private_ip_address_allocation
          public_ip_address_id          = azurerm_public_ip.pip-linux.id
        }
      }
      resource &quot;azurerm_public_ip&quot; &quot;pip-linux&quot; {
        name                = var.linux_machine_name
        location            = var.location
        resource_group_name = var.resource_group_name
        tags                = var.tags
      
        allocation_method = var.public_ip_allocation_method
        sku               = var.public_ip_sku
      }
  </code></pre>
  <p>modules/virtualmachine/variables.tf</p>
  <pre><code># VM Name
  variable &quot;linux_machine_name&quot; {
    description = &quot;Linux Virtual Machine Name - If left blank generated from metadata module&quot;
    type        = string
    default     = &quot;&quot;
  }
  
  variable &quot;resource_group_name&quot; {
    description = &quot;Resource group name&quot;
    type        = string
  }
  
  variable &quot;location&quot; {
    description = &quot;Azure region&quot;
    type        = string
  }
  
  variable &quot;tags&quot; {
    description = &quot;tags to be applied to resources&quot;
    type        = map(string)
  }
  
  # VM Size
  variable &quot;virtual_machine_size&quot; {
    description = &quot;Instance size to be provisioned&quot;
    type        = string
  }
  
  variable &quot;admin_username&quot; {
    description = &quot;names to be applied to resources&quot;
    type        = string
  }
  
  variable &quot;admin_ssh_public_key&quot; {
    description = &quot;(Linux) Public SSH Key - Generated if left blank&quot;
    type        = string
    default     = &quot;&quot;
    sensitive   = true
  }
  
  # Operating System
  variable &quot;source_image_publisher&quot; {
    description = &quot;Operating System Publisher&quot;
    type        = string
  }
  
  variable &quot;source_image_offer&quot; {
    description = &quot;Operating System Name&quot;
    type        = string
  }
  
  variable &quot;source_image_sku&quot; {
    description = &quot;Operating System SKU&quot;
    type        = string
  }
  
  variable &quot;source_image_version&quot; {
    description = &quot;Operating System Version&quot;
    type        = string
    default     = &quot;latest&quot;
  }
  
  # Operating System Disk
  variable &quot;operating_system_disk_cache&quot; {
    description = &quot;Type of caching to use on the OS disk - Options: None, ReadOnly or ReadWrite&quot;
    type        = string
    default     = &quot;ReadWrite&quot;
  }
  
  variable &quot;operating_system_disk_type&quot; {
    description = &quot;Type of storage account to use with the OS disk - Options: Standard_LRS, StandardSSD_LRS or Premium_LRS&quot;
    type        = string
    default     = &quot;StandardSSD_LRS&quot;
  }
  
  variable &quot;ip_configuration_name&quot; {
    description = &quot;ip configuration name&quot;
    type        = string
    default     = &quot;&quot;
  }
  
  # Networking
  variable &quot;nic_id&quot; {
    type        = list(string)
    description = &quot;ID of the nic&quot;
  }
  
  variable &quot;subnet_id&quot; {
    type        = string
    description = &quot;ID of the subnet&quot;
  }
  
  variable &quot;private_ip_address_allocation&quot; {
    type        = string
    description = &quot;Private ip allocation method&quot;
  }
  
  variable &quot;public_ip_allocation_method&quot; {
    type        = string
    description = &quot;Public ip allocation method&quot;
  }
  
  
  variable &quot;public_ip_sku&quot; {
    description = &quot;SKU to be used with this public IP - Basic or Standard&quot;
    type        = string
    default     = &quot;Standard&quot;
  }
  </code></pre>
  <p>modules/virtualmachine/outputs.tf</p>
  <pre><code>output &quot;nic_id&quot; {
    description = &quot;ids of the vm nics provisoned.&quot;
    value = azurerm_network_interface.nic-linux.id
  }
  </code></pre>