Looking at getting started with terraform and I think it would be lovely if you guys offered some more system-specific installation options. Ubuntu PPAs specifically in my own case. Although I'm sure some have wished for a Windows installer as well.
At least a bash script, or a terraform command to autoupdate the binary.
The backwards incompatibility (which forces upgrades) and manual upgrade process is the worst part about terraform.
@atrauzzi For Windows there are Chocolatey packages. I do agree in the Ubuntu PPA's however.
As a user on Fedora, would also love to see Terraform on it.
Perhaps a Snap / Flatpak for being easily cross-OS ?
Even if as said by @polvoazul a simple shell script / terraform command would be enough for me
Providing cross platform RPM/PPA should be fairly straightforward since it's just a drop-in binary. Would love to see this also.
know they're not official, or an APT/PPA, but there's this COPR for EPEL7 and Fedora 28
https://copr.fedorainfracloud.org/coprs/danielfallon/hashicorp/packages/
Looks like there's a decent snap, at least:
https://snapcraft.io/terraform
It is owned by @nhandler.
@ted-sigsci I'm not employed by Hashicorp. I'm just an SRE who uses Terraform as part of his job and I'm also an Ubuntu MOTU and Debian Developer. The Snap is being built from this git repository, and they should be fine to use, but I wouldn't really call it "official".
er, fixed :)
The biggest issue that we have with snap and the default terraform install format is that we require the ability to get a list of everything installed on the system and maintain updates. Snap is not installed on our machines, so Apt is the only option. If Hashicorp is truly an Enterprise software provider, they'd be considering these types of requirements as they are quite common in traditional enterprise environments.
Official snap would be really nice. Installing and upgrading via zip file is a bit silly.
I am using https://github.com/tfutils/tfenv
I agree, this seems like a must have. No tool can be considered mature if it has to be distributed as a binary inside a zip file.
While the ppa is not out yet you may use this one liner. It requires the packages unzip and curl
CURRR_VER=$(curl -sk https://checkpoint-api.hashicorp.com/v1/check/terraform | jq -r -M '.current_version'); ZIP_NAME=terraform_${CURRR_VER}_linux_amd64.zip ; curl -qk "https://releases.hashicorp.com/terraform/${CURRR_VER}/${ZIP_NAME}" -o ${ZIP_NAME} ; unzip ${ZIP_NAME} ; rm ${ZIP_NAME} ; sudo mv terraform /usr/bin/terraform ; sudo chmod +x /usr/bin/terraform
After that you need only to call terraform from you terminal.
Cheers
I think a snap is kind of a must have for a project like terraform.
We have official snaps for aws-cli, azure-cli, google-cloud-sdk but not terraform?
It also seem relatively easy to do: https://docs.snapcraft.io/go-applications
What about https://tjend.github.io/repo_terraform/
wget -q -O - https://tjend.github.io/repo_terraform/repo_terraform.key | sudo apt-key add -
sudo echo 'deb [arch=amd64] https://tjend.github.io/repo_terraform stable main' >> /etc/apt/sources.list.d/terraform.list
sudo apt-get update
sudo apt-get install terraform
@ted-sigsci I'm not employed by Hashicorp. I'm just an SRE who uses Terraform as part of his job and I'm also an Ubuntu MOTU and Debian Developer. The Snap is being built from this git repository, and they should be fine to use, but I wouldn't really call it "official".
@nhandler I think it's great that you made the snap, thank you for that. Any chance you could update it, or maybe set up some kind of CI job to rebuild it for new releases? Thank you again!
@ziggy42 While a snap would be nice, snaps are almost exclusively used by Ubuntu systems. Not all enterprises will allow Snap (or Flatpak or AppImages) to be installed and only support (and require) system packages (Deb/RPM). This is the problem that needs to be solved.
@nhandler I couldn't find repo in your github from where you build terraform snap. Terraform needs to be updated there and it is still 0.11.x
.
@aleks-sidorenko a comment from @nhandler up above says:
The Snap is being built from this git repository, and they should be fine to use, but I wouldn't really call it "official".
meaning it's being built from https://github.com/hashicorp/terraform
I agree with OP though. snap is nice and all, but having an official ppa would be ideal.
Snap isn't supported in WSL.
$ snap list
Interacting with snapd is not yet supported on Windows Subsystem for Linux.
This command has been left available for documentation purposes only.
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.4 LTS
Release: 18.04
Codename: bionic
Looks like it may work in WSL 2 but that's still insider preview.
I just update the @andremmfaria to avoid use "jq":
CURRR_VER=$(curl -sk https://checkpoint-api.hashicorp.com/v1/check/terraform | sed 's/,/\n/g' | grep "current_version" | awk -F":" '{print $2}' | sed 's/"//g')
ZIP_NAME=terraform_${CURRR_VER}_linux_amd64.zip
curl -qk "https://releases.hashicorp.com/terraform/${CURRR_VER}/${ZIP_NAME}" -o ${ZIP_NAME}
unzip ${ZIP_NAME}
rm ${ZIP_NAME}
sudo mv terraform /usr/local/bin/
sudo chmod +x /usr/local/bin/terraform
Minor update to @obozek get the sudo on the right place:
wget -q -O - https://tjend.github.io/repo_terraform/repo_terraform.key | sudo apt-key add -
echo 'deb [arch=amd64] https://tjend.github.io/repo_terraform stable main' | sudo tee /etc/apt/sources.list.d/terraform.list
sudo apt-get update
sudo apt-get install terraform
There is now an official HashiCorp repository (yum/apt) available and it includes terraform.
https://www.hashicorp.com/blog/announcing-the-hashicorp-linux-repository
https://medium.com/hashicorp-engineering/hashicorp-packaging-is-here-4c6083dee4f6
addresses #25324
Hi all,
As @rptaylor mentioned, there are now terraform
packages available in the official HashiCorp APT and Yum repositories. It took us a little while to get the documentation updated to reflect that, but you can now see some instructions for using these to install Terraform here:
If you try these out and run into any trouble, please start a topic in the community forum to discuss it. The APT/Yum repositories themselves are not maintained in this repository, so the folks who would respond to that feedback typically won't be monitoring the issues here.
Please also note the caveat that these repositories also contain packages for other HashiCorp products, so unless you do extra configuration of your package manager adding these repositories could also affect existing systems that were installing existing distribution-specific packages from the main distribution repositories.
The HashiCorp engineering services team is also discussing the possibility of other package types for other operating systems, but again that is not something that the team which monitors this repository is directly involved in, so I'm going to close this issue now to represent that there are no changes we would make in _this_ repository to make that happen. Look for announcements elsewhere, such as in the HashiCorp blog, for other repository types that might come later. Thanks!
Most helpful comment
I agree, this seems like a must have. No tool can be considered mature if it has to be distributed as a binary inside a zip file.