terragrunt
terragrunt copied to clipboard
Suppress output of successful init
Is there a way to not print the following initial logs of terragrunt apply?
terragrunt apply
Initializing the backend...
Initializing provider plugins...
- Reusing previous version of hashicorp/kubernetes from the dependency lock file
- Reusing previous version of hashicorp/aws from the dependency lock file
- Using previously-installed hashicorp/aws v4.18.0
- Using previously-installed hashicorp/kubernetes v2.11.0
Terraform has been successfully initialized!
You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.
If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.
Using terragrunt-log-level, f.e. terragrunt apply --terragrunt-log-level warn doesn't work.
Related: https://github.com/gruntwork-io/terragrunt/issues/246#issuecomment-785796133
The init output is terraform output not terragrunt output so setting the log level for terragrunt won't help currently. You can try to set the terraform log level via https://www.terraform.io/internals/debugging or using shell tools to direct the stdout but this will most certainly remove all the output.
Hi,
may help setting env variable TF_LOG=ERROR, but this needs to be tested
Thanks Denis. Alas, the TF_LOG=ERROR terragrunt apply doesn't suppress the Initializing... logs. At least not on
terraform 1.2.8
terragrunt 0.38.4
Having the same issue as mentioned above!!
Using the TF_IN_AUTOMATION environment variable removes the init messages and still shows the important information at least. So TF_IN_AUTOMATION=1 terragrunt run-all apply is much less verbose.
Thanks @deverton - TF_IN_AUTOMATION=1 removed all the provider installation and initialisation noise, while retaining the terraform information 🙇🏼
I have the below snippet in all my terragrunt projects since it makes it much friendlier to use. I do wonder if it should be the default
terraform {
extra_arguments "quiet" {
commands = [
"init",
"apply",
"refresh",
"plan",
"output"
]
env_vars = {
TF_IN_AUTOMATION = "1"
}
}
}