hci automates the process of downloading and installing HashiCorp products. It supports all binaries on releases.hashicorp.com; including terraform, packer, vault, consul, boundary, waypoint, etc..
This script searches releases, determines correct binary for the system, downloads binary and installs it to the selected location. It allows install of the most recent version of any product with only one parameter. There are many optional parameters which allow it to be used to query/validate version numbers, retrieve enterprise binaries, and specifying custom location for the downloaded binary.
Example, display the latest patch release for terraform 1.1: hci -i 1.1 -o
This is an upgrade and replacement for the earlier projects: Terraform Installer and Packer Installer. It has been designed for easy migration and allows drop-in-replacement with minimal adjustments.
hci [-p PRODUCT] [-i VERSION] [-e] [-o] [-h] [-v] [-m] [-a] [-c] [-d]
-p PRODUCT : product (default='terraform')
-i VERSION : version (default=latest)
specify either product version (ex: '1.1') or specific release (ex: '1.1.9')
-e : download enterprise binary for PRODUCT = vault, consul or nomad
-o : only output release info (don't download, install)
-h : help
-v : display script version
-m : Mac - force Intel binary (ignore detection of Apple Silicon)
-a : automatically use sudo to install to /usr/local/bin (or $INSTALL_DIR env var)
-c : leave binary in current working directory
-d : debug output
PRODUCT may specify product name or abbreviation
product names : https://releases.hashicorp.com
abbreviations : b=boundary, c=consul, n=nomad, p=packer, t=terraform, v=vault, w=waypoint
Download latest release from my bootstrap server (iac.sh or https://iac.sh)
curl iac.sh/hci > hci
chmod +x hci
# optional - move to system binary directory
sudo mv hci /usr/local/bin
Download from GitHub
curl -LO https://raw.github.com/robertpeteuil/hashicorp-installer/master/hci
chmod +x hci
-p
-p
not specified, defaults to Terraform
hci
hci -p v
hci -p consul-template
-i
-i
hci
hci -i 1.1.5
hci -i 1.1
-o
find latest version or patch release, display info and exit without install
hci -o
hci -p v -i 1.9 -o
-m
arm64
binariesarm64
binaries aren't available for a given product + version, it reverts to amd64
(Intel)-m
flag
arm64
build
darwin_arm64
binaries when Apple Silicon is detectedamd64
cpu on macOSamd64
binaries), with the -m
parameter-p
parameter specifying the product to installcurl
or wget
- script will use either one to retrieve metadata and downloadunzip
- terraform downloads are in zip formatI am a HashiCorp employee, but this is a personal project and not officially endorsed or supported by HashiCorp.
Apache 2.0 License - Copyright (c) 2024 Robert Peteuil