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
not specified, defaults to Terraformhci
- specify product abbreviation (v = vault)
hci -p v
- specify full binary name
hci -p consul-template
- latest - don't specify
-i
hci
- specific version - use MAJOR.MINOR.PATCH format
hci -i 1.1.5
- latest patch release - use MAJOR.MINOR format
hci -i 1.1
find latest version or patch release, display info and exit without install
- display latest version of Terraform
hci -o
- display latest patch release for Vault 1.9
hci -p v -i 1.9 -o
- If installer detects Apple Silicon it attempts to install
arm64
binaries - If
arm64
binaries aren't available for a given product + version, it reverts toamd64
(Intel) - Force install of Intel binaries with
-m
flag- Useful for Terraform when using use older provider versions that lack an
arm64
build- the terraform binary and provider binary need to share the same cpu architecture
- Useful for Terraform when using use older provider versions that lack an
- macOS on Apple Silicon
- behavior change from previous scripts when running on Apple Silicon Macs
- installer looks for
darwin_arm64
binaries when Apple Silicon is detected - previous installers assumed
amd64
cpu on macOS
- installer looks for
- force old behavior (always use
amd64
binaries), with the-m
parameter
- behavior change from previous scripts when running on Apple Silicon Macs
- installing products other than terraform
- use
-p
parameter specifying the product to install
- use
- System with Bash Shell (Linux, macOS, Windows Subsystem for Linux)
curl
orwget
- script will use either one to retrieve metadata and downloadunzip
- terraform downloads are in zip format
I 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