Workaround for Homebrew: “terraform@0.12 has been disabled because it is not supported upstream!”

I needed to install an older version of Terraform on my work Mac, but got this error:

Error: terraform@0.12 has been disabled because it is not supported upstream!

I tried to edit terraform@0.12 and tried to install without success. This is what worked:

HOMEBREW_NO_INSTALL_FROM_API=1 brew install terraform@0.12


?  Source brew install terraform@0.12
Error: terraform@0.12 has been disabled because it is not supported upstream!
?  Source HOMEBREW_NO_INSTALL_FROM_API=1 brew install terraform@0.12
==> Fetching terraform@0.12
==> Downloading https://ghcr.io/v2/homebrew/core/terraform/0.12/manifests/0.12.31
####################################################################################################################################################################################################################### 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/terraform/0.12/blobs/sha256:21aa5de3857889453b4ec7ed810df350b22838cda61baa7e6db6a0c3946d5891
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:21aa5de3857889453b4ec7ed810df350b22838cda61baa7e6db6a0c3946d5891?se=2023-05-16T20%3A55%3A00Z&sig=Cdb%2F%2FXmhPJNspNN6FdcDiFLysIMJiYZvKxCH
####################################################################################################################################################################################################################### 100.0%
==> Pouring terraform@0.12--0.12.31.monterey.bottle.tar.gz
==> Caveats
terraform@0.12 is keg-only, which means it was not symlinked into /usr/local,
because this is an alternate version of another formula.

If you need to have terraform@0.12 first in your PATH, run:
echo ‘export PATH=”/usr/local/opt/terraform@0.12/bin:$PATH”‘ >> ~/.zshrc
==> Summary
? /usr/local/Cellar/terraform@0.12/0.12.31: 6 files, 42.7MB
==> Running `brew cleanup terraform@0.12`…
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
? Source terraform version
Terraform v0.12.31

Your version of Terraform is out of date! The latest version
is 1.4.6. You can update by downloading from https://www.terraform.io/downloads.html

GCloud: List roles a service account is a member of

GCloud command to list roles a service account is a member of:


SERVICE_ACCOUNT=my-service-account@my-gcp-project.iam.gserviceaccount.com
GCP_PROJECT=my-gcp-project
gcloud projects get-iam-policy $GCP_PROJECT \
--flatten="bindings[].members" \
--format='table(bindings.role)' \
--filter="bindings.members:$SERVICE_ACCOUNT"

Reference: https://jamiekt.wordpress.com/2019/06/13/use-gcloud-to-list-all-project-roles-that-a-service-account-is-a-member-of/

iTerm2: Add Keystroke to move between words

On a Mac, I use iTerm2 as my default terminal due to the added features, such as auto-copy and the ability to split multiple terminals. One nuance was not having the ability to move between words (like in vim); however, I found the below how-to on Stack Overflow — where else? 🙂

  1. Go to Preferences, Profile, Keys.
  2. Set your left ? key to act as an escape character.
  3. Locate the current shortcut for ? ? or create a new one, with the following settings:
    • Keyboard Shortcut: ??
    • Action: Send Escape Sequence
    • Esc+: b
  4. repeat for the ?? keyboard shortcut with the following settings:
    • Keyboard Shortcut: ??
    • Action: Send Escape Sequence
    • Esc+: f

From this point, you can use Option + [left/right arrow keys]. Yass, productivity skill level increase! Later.

How to add environment variables in Mac OS X

Adding here for reference (tried this in Mac OS X Mojave):


# To set an environment variable, enter the following command:
launchctl setenv variable "value"

# To find out if an environment variable is set, use the following command:
launchctl getenv variable

# To clear an environment variable, use the following command:
launchctl unsetenv variable