3 ms·
Much as I love the service homebrew provides, terraform is one of the edge cases that is better being managed outside of brew. I believe tf-switch is now the mo
by hnlmorg 3y ago
Much as I love the service homebrew provides, terraform is one of the edge cases that is better being managed outside of brew. I believe tf-switch is now the most popular option?
The problem with Terraform is that you often need a pinned version because accidentally updating your state file can be dangerous. (Though in fairness, updating Terraform is significantly less troublesome than it was in the pre-1.0 days)
- cmclaughlin 3y ago> Much as I love the service homebrew provides, terraform is one of the edge cases that is better being managed outside of brew. I believe tf-switch is now the most popular option? tfenv is also available in homebrew for installing multiple/different versions of terraform
- wwalexander 3y agoYou‘re right, it‘s best managed inside of MacPorts, which allows you to install specific versions of packages and switch between them easily!
- whalesalad 3y agotil macports still exists
- wwalexander 3y agoIt not only exists but is vastly superior to Homebrew.
- hnlmorg 3y agoYou can do that with homebrew too. But in the case of Terraform, where you can have developers on Windows and macOS and CI/CD pipeines based on Debian/Ubuntu/CentOS/Alpine/etc, it's handy having everyone use the same tool for managing Terraform versions. It's just like how you wouldn't have different people manage the same Python codebase with different package managers. You agree on the standard for that business or project and have every instantiation of that project follow that same standard.
- wwalexander 3y agoI definitely agree overall. My last job was standardized on Homebrew and used tfswitch; I personally translated to MacPorts but I do agree that tying a project to a specific package manager (and thus OS, etc.) isn’t advisable.
- soraminazuki 3y agoI think Nix is better suited for that kind of thing. You can specify multiple versions of packages and expose them on a per-project basis. It eliminates the need to switch packages globally.
- Zizizizz 3y agoI use rtx (rust asdf) https://github.com/jdx/rtx https://github.com/jdx/rtx as it lets me install all the languages with one tool (plus project environmental variables like direnv)
- bloopernova 3y agoIs it compatible with asdf?
- mpwoz 3y agoFrom the first bullet point under 'features': > asdf-compatible - rtx is compatible with asdf plugins and .tool-versions files. It can be used as a drop-in replacement.
- bloopernova 3y agoI'm going to blame being distracted by my dog for not reading the link you posted. asdf + direnv makes my work life so much easier. I have one .envrc that checks what branch I'm on and switches you to the right Terraform workspace and sets correct env-vars too.
- Zizizizz 3y agoYeah I use this same setup with rtx