A quick note to myself on how to get terraform plan output as a file.
By default running a “terraform plan” will output a nice graphical display of all expected changes. Sometimes you want to be able to distribute this as a file. In the past, I’ve tried commands like:
terraform plan > tfplan.txt
However that produces confusing output like this:
Instead, you can do this to get better output:
terraform plan -no-color > tfplan.txt
Now it will display in the console, and produce a text file that looks like this: