When using TF in automation, It will be useful if you could add a --quiet option for the init command.
currently the verbosity of this command is less relevant when running TF in our CI server IMHO.
for example, I'd be happy to get rid of the following output for the init command -
```
Initializing modules...
Initializing the backend...
Successfully configured the backend "s3"! Terraform will automatically
use this backend unless the backend configuration changes.
Initializing provider plugins...
````
Hi @giladsh1!
Is your expectation that --quiet would silence the output completely unless there is an error, or are there some parts of the output that you still want to see?
For the short term I might suggest redirecting the stdout of this command to null (on a unix system, e.g. terraform init >/dev/null) which should still show any errors since they will be printed to stderr.
In the short term we are generally leaning towards minimizing the number of available options on most commands in order to keep things easy to maintain and test, but once work on the lower levels of Terraform (the configuration, provider APIs, etc) is stabilized in a few releases we're likely to be more open to carefully introducing some additional cases in the test matrix.
fwiw, setting the environment variable TF_IN_AUTOMATION will make terraform init (and some other commands) a little quieter:
$ TF_IN_AUTOMATION=true terraform init
Initializing modules...
- module.test_image_0_0_1
- module.test_image_0_0_2
- module.test1_eks
- module.test2_eks
- module.ingress_controller_policy
- module.worker_nodes_instance_role
Initializing the backend...
Initializing provider plugins...
Terraform has been successfully initialized!
It still shows the list of modules, but it does cut down any of the instructions usually shown at the end of the above output.
Most helpful comment
Hi @giladsh1!
Is your expectation that
--quietwould silence the output completely unless there is an error, or are there some parts of the output that you still want to see?For the short term I might suggest redirecting the stdout of this command to null (on a unix system, e.g.
terraform init >/dev/null) which should still show any errors since they will be printed to stderr.In the short term we are generally leaning towards minimizing the number of available options on most commands in order to keep things easy to maintain and test, but once work on the lower levels of Terraform (the configuration, provider APIs, etc) is stabilized in a few releases we're likely to be more open to carefully introducing some additional cases in the test matrix.