-
-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
set TF_IN_AUTOMATION env var for terraform commands #516
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We deliberately didn't do this because it drops all color formatting. IMO the CI flags are a bit dated because all modern CI systems work with full terminal support (e.g. ansi color)
If we do this, we should do it only when output is not needed by the end user. |
@osterman I think you have misunderstood this flag, the color formatting still happens, it just drops the verbose instructions.
In both cases below, color output is displayed, the only difference is the verbose instructions, which the docs also indicate:
$ TF_IN_AUTOMATION=true atmos terraform plan terraform-no-error -s test-test-test Initializing the backend... Initializing provider plugins... Terraform has been successfully initialized! Changes to Outputs:
You can apply this plan to save these new output values to the Terraform state, without changing any real infrastructure. $ atmos terraform plan terraform-no-error -s test-test-test Initializing the backend... Initializing provider plugins... Terraform has been successfully initialized! You may now begin working with Terraform. Try running "terraform plan" to see If you ever set or change modules or backend configuration for Terraform, Changes to Outputs:
You can apply this plan to save these new output values to the Terraform state, without changing any real infrastructure. |
what
Set the
TF_IN_AUTOMATION
env varwhy
If set, Terraform adjusts its output to avoid suggesting specific commands to run next. This can make the output more consistent and less confusing in workflows where users don't directly execute Terraform commands, like in CI systems or other wrapping applications such as atmos.
references
https://developer.hashicorp.com/terraform/cli/config/environment-variables#tf_in_automation