Go module for downloading or locating HashiCorp binaries, verifying signatures and checksums, and asserting version constraints.
See the codeAn experimental Go module for downloading or locating HashiCorp binaries, verifying signatures and checksums, and asserting version constraints.
This module is a successor to tfinstall, available in pre-1.0 versions of terraform-exec. Current users of tfinstall are advised to move to hc-install before upgrading terraform-exec to v1.0.0.
This library is intended for use within Go programs or automated environments (such as CIs) which have some business downloading or otherwise locating HashiCorp binaries.
The included command-line utility, hc-install, is a convenient way of using
the library in ad-hoc or CI shell scripting outside of Go.
hc-install does not:
/usr/bin or /usr/local/bin on Unix based system.$PATH.The Installer offers a few high-level methods:
Ensure(context.Context, []src.Source) to find, install, or build a product versionInstall(context.Context, []src.Installable) to install a product versionThe Installer methods accept number of different Source types.
Each comes with different trade-offs described below.
fs.{AnyVersion,ExactVersion,Version} - Finds a binary in $PATH (or additional paths)
releases.{LatestVersion,ExactVersion} - Downloads, verifies & installs any known product from releases.hashicorp.com
checkpoint below)checkpoint.LatestVersion - Downloads, verifies & installs any known product available in HashiCorp Checkpoint
releases above)build.GitRevision - Clones raw source code and builds the product from it
See examples at https://pkg.go.dev/github.com/hashicorp/hc-install#example-Installer.
In addition to the Go library, which is the intended primary use case of hc-install, we also distribute CLI.
The CLI comes with some trade-offs:
releases.ExactVersion)Given that one of the key roles of the CLI/library is integrity checking, you should choose the installation method which involves the same level of integrity checks, and/or perform these checks yourself. go install provides only minimal to no integrity checks, depending on exact use. We recommend any of the installation methods documented below.
brew install hashicorp/tap/hc-install
We support Debian & Ubuntu via apt and RHEL, CentOS, Fedora and Amazon Linux via RPM.
You can follow the instructions in the Official Packaging Guide to install the package from the official HashiCorp-maintained repositories. The package name is hc-install in all repositories.
hc-install_<VERSION>_SHA256SUMS).PATH.hc-install --version.
You should see the latest version printed to your terminal.Usage: hc-install install [options] -version <version> <product>
This command installs a HashiCorp product.
Options:
-version [REQUIRED] Version of product to install.
-path Path to directory where the product will be installed.
Defaults to current working directory.
-log-file Path to file where logs will be written. /dev/stdout
or /dev/stderr can be used to log to STDOUT/STDERR.
hc-install install -version 1.3.7 terraform
hc-install: will install terraform@1.3.7
installed terraform@1.3.7 to /current/working/dir/terraform
62 followers · starred Oct 2022
118 followers · starred Sep 2024
240 followers · starred Sep 2021
215 followers · starred Apr 2021
Go module for downloading or locating HashiCorp binaries, verifying signatures and checksums, and asserting version constraints.
See the codeAn experimental Go module for downloading or locating HashiCorp binaries, verifying signatures and checksums, and asserting version constraints.
This module is a successor to tfinstall, available in pre-1.0 versions of terraform-exec. Current users of tfinstall are advised to move to hc-install before upgrading terraform-exec to v1.0.0.
This library is intended for use within Go programs or automated environments (such as CIs) which have some business downloading or otherwise locating HashiCorp binaries.
The included command-line utility, hc-install, is a convenient way of using
the library in ad-hoc or CI shell scripting outside of Go.
hc-install does not:
/usr/bin or /usr/local/bin on Unix based system.$PATH.The Installer offers a few high-level methods:
Ensure(context.Context, []src.Source) to find, install, or build a product versionInstall(context.Context, []src.Installable) to install a product versionThe Installer methods accept number of different Source types.
Each comes with different trade-offs described below.
fs.{AnyVersion,ExactVersion,Version} - Finds a binary in $PATH (or additional paths)
releases.{LatestVersion,ExactVersion} - Downloads, verifies & installs any known product from releases.hashicorp.com
checkpoint below)checkpoint.LatestVersion - Downloads, verifies & installs any known product available in HashiCorp Checkpoint
releases above)build.GitRevision - Clones raw source code and builds the product from it
See examples at https://pkg.go.dev/github.com/hashicorp/hc-install#example-Installer.
In addition to the Go library, which is the intended primary use case of hc-install, we also distribute CLI.
The CLI comes with some trade-offs:
releases.ExactVersion)Given that one of the key roles of the CLI/library is integrity checking, you should choose the installation method which involves the same level of integrity checks, and/or perform these checks yourself. go install provides only minimal to no integrity checks, depending on exact use. We recommend any of the installation methods documented below.
brew install hashicorp/tap/hc-install
We support Debian & Ubuntu via apt and RHEL, CentOS, Fedora and Amazon Linux via RPM.
You can follow the instructions in the Official Packaging Guide to install the package from the official HashiCorp-maintained repositories. The package name is hc-install in all repositories.
hc-install_<VERSION>_SHA256SUMS).PATH.hc-install --version.
You should see the latest version printed to your terminal.Usage: hc-install install [options] -version <version> <product>
This command installs a HashiCorp product.
Options:
-version [REQUIRED] Version of product to install.
-path Path to directory where the product will be installed.
Defaults to current working directory.
-log-file Path to file where logs will be written. /dev/stdout
or /dev/stderr can be used to log to STDOUT/STDERR.
hc-install install -version 1.3.7 terraform
hc-install: will install terraform@1.3.7
installed terraform@1.3.7 to /current/working/dir/terraform
62 followers · starred Oct 2022
118 followers · starred Sep 2024
240 followers · starred Sep 2021
215 followers · starred Apr 2021