The Terraform Provider for VMware Cloud Foundation Automation is a plugin for Terraform that allows you to interact with VMware Cloud Foundation Automation 9+ by Broadcom.
Learn more:
- Read the provider documentation
- Have a look at the configuration examples
- This project is using go-vcloud-director Go SDK for making API calls
Note: You only need to build the provider plugin if you want to develop it. Refer to
documentation for using it. Terraform will
automatically download officially released binaries of this provider plugin on the first run of terraform init
command.
cd ~/mydir
git clone https://github.com/vmware/terraform-provider-vcfa.git
cd terraform-provider-vcfa/
make buildNote: You only need to install the provider from source code if you want to test unreleased features or to develop it. Refer to
documentation for using it in a standard way. Terraform will
automatically download officially released binaries of this provider plugin on the first run of terraform init
command.
cd ~/mydir
git clone https://github.com/vmware/terraform-provider-vcfa.git
cd terraform-provider-vcfa/
make installThis command will build the plugin and transfer it to
$HOME/.terraform.d/plugins/registry.terraform.io/vmware/vcfa/${VERSION}/${OS}_${ARCH}/terraform-provider-vcfa_v${VERSION},
with a name that includes the version (as taken from the ./VERSION file).
For example, on macOS:
$HOME/.terraform.d/
├── checkpoint_cache
├── checkpoint_signature
└── plugins
└── registry.terraform.io
└── vmware
└── vcfa
└── 1.0.0
└── darwin_amd64
└── terraform-provider-vcfa_v1.0.0On Linux:
├── checkpoint_cache
├── checkpoint_signature
└── plugins
└── registry.terraform.io
└── vmware
└── vcfa
└── 1.0.0
└── linux_amd64
└── terraform-provider-vcfa_v1.0.0Once you have installed the plugin as mentioned above, you can simply create a new config.tf as defined in the manual and run
terraform init
terraform plan
terraform applyWhen developing terraform-provider-vcfa one often needs to modify the underlying go-vcloud-director SDK to consume
new methods and types. Go has a convenient replace
directive which can allow you to redirect the import path to your own version of go-vcloud-director:
module github.com/vmware/terraform-provider-vcfa
require (
...
github.com/vmware/go-vcloud-director/v3 v3.1.0-alpha.3
)
replace github.com/vmware/go-vcloud-director/v3 v3.1.0-alpha.3 => github.com/my-git-user/go-vcloud-director/v3 v3.1.0-alpha.3 You can also replace pointer to a branch with relative directory:
module github.com/vmware/terraform-provider-vcfa
require (
...
github.com/vmware/go-vcloud-director/v3 v3.1.0-alpha.2
)
replace github.com/vmware/go-vcloud-director/v3 v3.1.0-alpha.2 => ../go-vcloud-directorSee CODING_GUIDELINES.md for more advice on how to write code for this project.
Read TROUBLESHOOTING.md to learn how to configure and understand logs, and how to diagnose common errors.
Because this Terraform provider is developed as an open-source project and follows standard GitHub community practices, we encourage customers to submit bug reports and enhancement requests directly in the project's GitHub repository. However, we recognize that some situations may require formal technical support through our Global Support Services (GSS) process. In those cases, please open a case through the Broadcom support portal, referencing the provider, the provider version, and any related GitHub issue(s). When opening your case, please select VMware ESXi as the Product and choose VCF Terraform from the components drop-down menu.
© Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
The Terraform Provider for VMware Cloud Foundation Automation is available under the Mozilla Public License, version 2.0 license.