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:
Thank you very much!
super
Thanks!
for me it is not working even using -no-color
What behavior do you see when using it? I was using this in Windows Terminal, perhaps it is different if you’re using a different shell?
try the tool terraform_landscape.
This is hard to install on Windows but easy for mac.
Otherwise, I try this:
terraform plan > color_output.txt
less -R color_output.txt
-R option prints colors