starhawking / python-terrascript

Create Terraform files using Python scripts.
BSD 2-Clause "Simplified" License
516 stars 76 forks source link

vSphere: missing some data sources and resources #35

Closed austin-millan closed 6 years ago

austin-millan commented 6 years ago

Error:

vm_template = d.vsphere_virtual_machine('vm_template', AttributeError: module 'terrascript.vsphere.d' has no attribute 'vsphere_virtual_machine'

python-terrascript/terrascript/vsphere/d.py is missing the declaration for a vsphere_virtual_machine data source.

This data source is required by Terraform for cloning from an existing template. Which means for Terraform, the vsphere_virtual_machine is required as both a resource and data source.

Fix: Adding the following fixes this issue:

# ~/vsphere/d.py
class vsphere_virtual_machine(_data): pass
virtual_machine = vsphere_virtual_machine

Additional missing data sources: vsphere_custom_attribute vsphere_datastore_cluster

Additional missing resources vsphere_custom_attribute vsphere_datastore_cluster vsphere_storage_drs_vm_override

mjuenema commented 6 years ago

See tests/test_issue35.py.