Skip to content

BarnabyShearer/tftool

Repository files navigation

tftool

https://readthedocs.org/projects/tftool/badge/?version=latest https://img.shields.io/pypi/v/tftool?color=success https://img.shields.io/docker/v/barnabyshearer/tftool/latest?color=success&label=docker

Ergonomic utilities for the terraform CLI.

Install

python3 -m pip install tftool

Usage

# Force terraform to be a bit more Unix philosophy
alias tfplan="terraform plan -refresh=false -input=false -out=/tmp/plan > /dev/null && terraform show -json /tmp/plan"
alias tfapply="xargs -or0 terraform apply"
alias tfimport="xargs -or0L2 terraform import"

# Only create new resources
tfplan | tftool target --no-updates | tfapply

# Automatically import new resources if their name/index matches the id.
tfplan | tftool autoimport | tfimport