Learning Terraform

Terraform is a provisioning tool from Hashicorp. It manages the process of setting up and tearing down and updating your computing infrastructure. Commands necessary to set up your machines are stored in files, with just enough language features in that configuration description language to accomplish simple automation efforts and to keep secrets out of common config files.

Terraform lives in the same computational universe as other packages like Vagrant, Puppet, Chef, Ansible, and Salt. Indeed, you might end up using a combination of tools to get done what you want to get done, depending on which of these systems might already be in place and your familiarity and comfort with each.

In comparison with Salt, Terraform is quite straightforward. Rather than storing state information and secrets in databases or complex directory structures, they are all kept neatly in files that would fit in a single directory. Salt really wants you to run a long-running daemon on your infrastructure to accept commands, but Terraform is content just ssh’ing into your managed system to do its work.

Because Terraform uses ssh, the system that invokes Terraform needs to have a solid and stable connection to the system being created or updated, for the duration of the update process. This poses a challenge for the cafe worker, who might have a crappy network to deal with on occasion. Use a bastion host, and know that mosh the mobile shell is a good way to keep a connection alive.