taliesins / terraform-provider-hyperv

HyperV provider for Terraform
Mozilla Public License 2.0
225 stars 80 forks source link

List All VirtualSwitch Names (possible feature request) #242

Open jeremyjbutler opened 6 months ago

jeremyjbutler commented 6 months ago

Forgive me if this is already a feature but Im new to terraform and GO, I want to get a list of all the virtual switches already configured on the host and while creating the vm create an adapter attached to each switch. I am working in an environment where the switch names, order, vlan, and number of switches are all highly variable per hypervisor. I had a look at the code for getting the virtualswitch but I see switch name seems to be required. Is there any possible way I can read into a list all the switches on the hypervisor ? Right now my plan is just to make a tfvars for every single hypervisor