terraform-provider-vcd

Terraform VMware vCloud Director provider

  • 所有者: hashicorp/terraform-provider-vcd
  • 平台:
  • 许可证: Mozilla Public License 2.0
  • 分类:
  • 主题:
  • 喜欢:
    0
      比较:

Github星跟踪图

Terraform vCloud Director Provider

The official Terraform provider for VMware vCloud Director

Part of Terraform

Requirements

Building The Provider (the modules way)

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.

Starting with version 2.1 provider started using Go modules
This means that it is no longer necessary to be in GOPATH.
See more on how to use modules
and toggle between modes.

$ cd ~/mydir
$ git clone https://github.com/terraform-providers/terraform-provider-vcd.git
$ cd terraform-provider-vcd/
$ make build

Building The Provider (the old vendor way)

Prior to version 2.1 provider used Go vendor directory for dependency management. This method is not recommended
anymore, but can be used to build provider on Go versions < 1.11.

Clone repository to: $GOPATH/src/github.com/terraform-providers/terraform-provider-vcd

$ mkdir -p $GOPATH/src/github.com/terraform-providers; cd $GOPATH/src/github.com/terraform-providers
$ git clone https://github.com/terraform-providers/terraform-provider-vcd.git

Enter the provider directory and build the provider

$ cd $GOPATH/src/github.com/terraform-providers/terraform-provider-vcd
$ make build

Developing the Provider

Starting with terraform-provider-vcd version 2.1 Go modules are used, while vendor directory is left for backwards
compatibility only. This means a few things:

  • The code no longer needs to stay in your GOPATH. It can though -
    see more on how to use modules and toggle between modes.
  • vendor directory is not to be changed manually. Always use Go modules when introducing new dependencies
    and always rebuild the vendor directory using go mod vendor if you have changed go.mod or go.sum. Travis CI will
    catch and fail if it is not done. Note Go 1.13+ must be used for go mod vendor as starting with this version
    "/vendor" directory structure changed and Travis will fail if "/vendor" is built and commited with Go <1.12.
  • When developing terraform-provider-vcd one often needs to add extra stuff to go-vcloud-director. Go modules
    have a convenient replace
    directive which can allow you to redirect import path to your own version of go-vcloud-director.
    go.mod can be altered:
  • You can replace your import with a forked branch like this:
   module github.com/terraform-providers/terraform-provider-vcd/v2
   require (
   	...
   	github.com/vmware/go-vcloud-director/v2 v2.1.0-alpha.2
   	)
   replace github.com/vmware/go-vcloud-director/v2 v2.1.0-alpha.2 => github.com/my-git-user/go-vcloud-director/v2 v2.1.0-alpha.2    
  • You can also replace pointer to a branch with relative directory
    module github.com/terraform-providers/terraform-provider-vcd/v2
    require (
    	...
    	github.com/vmware/go-vcloud-director/v2 v2.1.0-alpha.2
    	)
    replace github.com/vmware/go-vcloud-director/v2 v2.1.0-alpha.2 => ../go-vcloud-director

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

Using the provider

Installing the built provider

For a more thorough test using the Terraform client, you may want to transfer the plugin in the Terraform directory. A make command can do this for you:

$ make install

This command will build the plugin and transfer it to $HOME/.terraform.d/plugins, with a name that includes the version (as taken from the ./VERSION file).

Using the new plugin

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

主要指标

概览
名称与所有者hashicorp/terraform-provider-vcd
主编程语言Go
编程语言Makefile (语言数: 5)
平台
许可证Mozilla Public License 2.0
所有者活动
创建于2020-08-13 20:54:10
推送于2020-08-11 15:43:21
最后一次提交2020-07-23 08:28:38
发布数15
最新版本名称v2.9.0 (发布于 2020-06-30 16:28:02)
第一版名称v0.1.0 (发布于 2017-06-20 23:36:08)
用户参与
星数1
关注者数1
派生数5
提交数534
已启用问题?
问题数0
打开的问题数0
拉请求数0
打开的拉请求数0
关闭的拉请求数0
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?