This repo contains tools some tools that Skyscrapers and/or its customers use. These tools are then published in our Homebrew tap.
All our infrastructure is deployed via Terraform. We heavily rely on Terraform for our day-to-day work. So this is a small helper script to make our lives, and those of our customers, a bit easier when running Terraform on our stacks.
These are the main two features of the helper script:
- full support for Terraform standard stacks, including the ability to run
output
,state
andimport
commands. - automatically load variables and backend config from the customer repository root folder. Usefull to set a common backend config for all customer stacks or when there are some variables common for multiple stacks.
See the description in the script for more information.
You can install it with:
brew tap skyscrapers/tap
brew install tf
Examples:
export TF_STACK_PATH=~/projects/skyscrapers/stacks/kubernetes-stack/eks-cluster
tf init
tf workspace select staging
tf apply
tf output cluster_name
tf import 'foo.bar[\"lorem\"].hello' 'ipsum'
tf state list
Note that it is important to correctly escape the input parameters for import
commands.
When it's time to release a new version of a tool contained in this repo, you must create a new release in this Github repository, following the Semantic Versioning schema. Then you need to update the Brew manifest of the Homebrew tap. The two values that must be updated in that manifest are url
and sha256
, which you can get by running:
brew create <the-new-release-archive-url.tar.gz>