Reduce verbosity of terraform logs

Is there an option in terraform so that the init command does not show the following


Initializing provider plugins...
- terraform.io/builtin/terraform is built in to Terraform
- Finding hashicorp/tls versions matching "2.0.0"...
- Finding hashicorp/google versions matching "3.9.0"...
.
.
.

as also the Refreshing state commands?

my_resource_1: Refreshing state...
my_resource_2: Refreshing state...
my_resource_3: Refreshing state...
.
.
.

There is not. Any time Terraform performs an operation that visibly blocks it will typically produce a progress message about it to reassure that it isn’t hanged and (in the case of the messages from plan and apply) to allow you to see the real order of operations in case you encounter an error due to incorrect ordering.

If you aren’t concerned by that, you could potentially write a wrapper that buffers the output somewhere invisible and shows it only if the command fails. There is no built-in way to achieve that.

1 Like