Skip to content

vmware/terraform-provider-vcfa

Terraform VMware Cloud Foundation Automation Provider

Latest Release License

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:

Part of Terraform

Terraform logo

Requirements

Building the Provider

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 build

Installing the Provider from source code

Note: 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 install

This 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.0

On Linux:

├── checkpoint_cache
├── checkpoint_signature
└── plugins
    └── registry.terraform.io
        └── vmware
            └── vcfa
                └── 1.0.0
                    └── linux_amd64
                        └── terraform-provider-vcfa_v1.0.0

Once 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 apply

Developing the Provider

When 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-director

See CODING_GUIDELINES.md for more advice on how to write code for this project.

Troubleshooting the Provider

Read TROUBLESHOOTING.md to learn how to configure and understand logs, and how to diagnose common errors.

License

© 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.

About

Terraform Provider for VMware Cloud Foundation Automation

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Contributors 7