josenk / terraform-provider-esxi

Terraform-provider-esxi plugin
GNU General Public License v3.0
544 stars 154 forks source link

network_interfaces from readme.md seems broken #68

Closed bish0polis closed 5 years ago

bish0polis commented 5 years ago

The code from the readme.md seems to allow for multiple interfaces:

  network_interfaces = [
    {
      virtual_network = "VM Network"
    },
  ]

However, no combination of syntactical massaging seems to allow me to use that syntax to instantiate even a single interface.

This format seems to work for a single interface:

  network_interfaces {
    virtual_network = "VM Network" # Required for each network interface, Specify the Virtual Network name.
  }

.. but that syntax doesn't look like it will allow multiple interfaces.

Is the example broken? Is there a new method of instantiating multiple interfaces? Can an example be created that shows multiple interfaces on different vLANs?

josenk commented 5 years ago

That example is for Terraform 0.11.x. I'll assume you are using Terraform 0.12.x... Take a look at the 0.12.x examples

https://github.com/josenk/terraform-provider-esxi/tree/master/examples

I don't have any specific example for multiple network_interfaces, but there is examples for multiple virtual_disks. They use the same format.

https://github.com/josenk/terraform-provider-esxi/blob/master/examples/03%20Resource%20Pools%20-%20Additional%20Storage/main.tf

    network_interfaces {
      virtual_network = "VM Network"
    }
    network_interfaces {
      virtual_network = "VM Network2"
    }
bish0polis commented 5 years ago

Hey @josenk,

Thanks a heap for the example. It seems so obvious now, but I would never believe that was the format. It looks so bizarre!

Can we mod the readme.md so others don't get stuck like me (assuming I'm not the only one!) ?