opentofu/tools/terraform-bundle
2023-08-22 16:15:24 +03:00
..
README.md Fix OpenTF Enterprise to be Terraform Enterprise 2023-08-22 16:15:24 +03:00

terraform-bundle

terraform-bundle was a solution intended to help with the problem of distributing OpenTF providers to environments where direct registry access is impossible or undesirable, created in response to the OpenTF v0.10 change to distribute providers separately from OpenTF CLI.

The OpenTF v0.13 series introduced our intended longer-term solutions to this need:

  • Alternative provider installation methods, including the possibility of running server containing a local mirror of providers you intend to use which OpenTF can then use instead of the origin registry.
  • The terraform providers mirror command, built in to OpenTF v0.13.0 and later, can automatically construct a suitable directory structure to serve from a local mirror based on your current OpenTF configuration, serving a similar (though not identical) purpose than terraform-bundle had served.

For those using OpenTF CLI alone, without OpenTF Cloud, we recommend planning to transition to the above features instead of using terraform-bundle.

How to use terraform-bundle

However, if you need to continue using terraform-bundle during a transitional period then you can use the version of the tool included in the OpenTF v0.15 branch to build bundles compatible with OpenTF v0.13.0 and later.

If you have a working toolchain for the Go programming language, you can build a terraform-bundle executable as follows:

  • git clone --single-branch --branch=v0.15 --depth=1 https://github.com/opentffoundation/opentf.git
  • cd opentf
  • go build -o ../terraform-bundle ./tools/terraform-bundle

After running these commands, your original working directory will have an executable named terraform-bundle, which you can then run.

For information on how to use terraform-bundle, see the README from the v0.15 branch.

You can follow a similar principle to build a terraform-bundle release compatible with OpenTF v0.12 by using --branch=v0.12 instead of --branch=v0.15 in the command above. OpenTF CLI versions prior to v0.13 have different expectations for plugin packaging due to them predating OpenTF v0.13's introduction of automatic third-party provider installation.

Terraform Enterprise Users

If you use Terraform Enterprise, the self-hosted distribution of Terraform Cloud, you can use terraform-bundle as described above to build custom OpenTF packages with bundled provider plugins.

For more information, see Installing a Bundle in Terraform Enterprise.