tiv plan
See what a Terraform plan will do before you apply it: every change with before and after values, and a graph of how the changing resources relate.
Quick start
Section titled “Quick start”From an initialized Terraform directory:
tiv plantiv runs terraform plan into a temporary file, converts it, and serves the report at http://127.0.0.1:4747, opening your browser. Nothing is applied, and no plan files are left behind.
Reading the report
Section titled “Reading the report”- Change counts across the top: add (green), change (amber), destroy (red), replace (purple). Each chip is a filter. Click one to hide that kind of change in both the list and the graph.
- The graph shows changed resources inside their module containers, with arrows for dependencies between them. A module called from another module draws inside its parent’s container. Clicking a node jumps to its detail card. When filters change, the graph re-lays itself out.
- Change cards, grouped by module, expand to an attribute diff. Values Terraform cannot know yet show as
(known after apply). Sensitive values are masked. Updates show only the attributes that change, with a count of the hidden unchanged ones. - Dependency chips on each card (“depends on” / “used by”) jump to the related resource.
- Search filters cards by resource address.
Console mode
Section titled “Console mode”Pass --console to review the same plan without leaving the terminal:
tiv plan --consoleChanged resources are laid out in dependency columns, each card bordered in its action’s colour and led by its sign: + create (green), ~ update (amber), − destroy (red), ± replace (purple). Resources the plan leaves alone stay hidden until you ask for them.
↑↓move within a column;←→follow dependency edges across columns, with connector arrows drawn beside the selectionspaceexpands the selected change into a diff:-lines are values leaving,+lines are values arriving,(known after apply)marks what Terraform cannot know yet, and sensitive values stay maskedureveals the unchanged resources, with their current values; press it again to hide themtcycles three views of the plan: the dependency graph, a flat list, and the modules the changes sit in. The module view shows what each module is passed and declares/searches by resource address andEnterjumps to the first match, thennandNwalk forward and back through the restmcycles all → each action present;pcycles providers; the two filters combine?shows the full key reference;qquits
--console and --browser are mutually exclusive. The browser remains the default for now.
Supplying a plan yourself
Section titled “Supplying a plan yourself”Terraform saves plans as a binary file that no tool reads directly. terraform show -json converts it, so producing plan input by hand is a two-step process:
terraform plan -out=tf.planterraform show -json tf.plan > plan.jsonThen any of these work:
tiv plan --plan plan.json # explicit pathtiv plan < plan.json # redirectedterraform show -json tf.plan | tiv plan # piped, skipping the .json filetiv plan # picks up plan.json from the current directoryWhat is not accepted
Section titled “What is not accepted”- The binary plan file itself (
tf.plan) - Human-readable
terraform planoutput, with or without-no-color - The
terraform plan -jsonlog stream, which carries no before/after values
If you pass one of these, tiv tells you the exact commands to produce the right format.
Passing options to terraform
Section titled “Passing options to terraform”These apply when tiv runs terraform for you, and are omitted otherwise:
tiv plan --chdir infra --var 'region=eu-west-1' --var-file prod.tfvars| Flag | Default | What it does |
|---|---|---|
--plan |
none | Path to a plan JSON file |
--console |
false | Render the report as an interactive terminal UI |
--browser |
false | Serve the report in the browser (the current default; excludes --console) |
--port |
4747 | Report server port (random fallback when taken) |
--open |
true | Open the report in your browser |
--chdir |
none | Directory to run terraform in (like terraform -chdir) |
--var |
none | Terraform input variable, repeatable |
--var-file |
none | Terraform variable file, repeatable |