Terraform
Installs Terraform from HashiCorp's own package sources.
Demo

What it does
- Installs HashiCorp's apt signing key on every apply, kept only when it matches the pinned fingerprint, then adds the apt repository and installs
terraformvia apt - On macOS, installs
terraformfrom thehashicorp/tapHomebrew tap - Upgrades only under
dotpro apply --upgrade; a normal apply leaves the installed version alone - Registers
terraformin~/.versions.d/soversionsreports its version - Installs shell aliases, with tab completion over workspace names for
workspace
Variables
| Variable | Default | Description |
|---|---|---|
terraform_apt_keys | HashiCorp's key, fingerprint D55C0D1AC78A8D8126CB631CFC9CA96ACA026560 | apt signing keys for HashiCorp's repository (name, url, keyring, optional fingerprint). When HashiCorp rotates its key, the apply fails with "has no key with fingerprint": check the new one on HashiCorp's trust page and override the entry |
Aliases
Rendered to ~/.profile.d/aliases/terraform.sh; override terraform_aliases to add or change them. The workspace alias tab-completes existing workspace names (from terraform workspace list).
| Alias | Command | Description |
|---|---|---|
plan | terraform plan | Run a plan |
apply | terraform apply | Apply changes |
workspaces | terraform workspace list | List workspaces |
workspace | terraform workspace select | Switch workspace |
tfi | terraform init | Initialise working directory |
tfp | terraform plan | Short alias for plan |
tfa | terraform apply | Short alias for apply |
Enable either this role or opentofu, not both on one host: the two share the generic plan, apply, and workspace alias names.