Monday, 7 October 2024

Terraform Output Readability

Using Terraform in a pipeline or using a script locally can be a bit overwhelming with information. A couple of filters I use in Bash are helpful to make it more readable for changes. 

Compact:

terraform plan | sed -E '/Refreshing state|Reading|Read complete/Id'"

Very compact:

terraform plan | awk 'length' | sed -E '/Refreshing state|Reading|Read complete|Plan:|\.plan|Saved the plan to|To perform exactly|Terraform has compared|found no differences|You can apply this plan to save these new output values|without changing any real infrastructure/Id'"