-
Notifications
You must be signed in to change notification settings - Fork 8
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
Terraform Debug Logging During GitHub Actions #6
Comments
In my opinion, we should keep things simple. These error logs are only useful for debugging purposes, and I don't think we want to see tons of information about every step terraform is taking on every pull request. When something is going wrong, we can dig in and debug, but keeping the log verbose at all times will pollute the output. But, of course, this is only my opinion. As an option, we may think of persisting logs in some files, but then we have a question of where to keep these files and for how long. More exotic options are to enable logs conditionally in the workflow or even to think of logstash :) |
@vitaliy-golomoziy Starting Terraform plan https://github.com/mage-os/terraform/actions/runs/3324201789 |
Even though I now documented how to run Terraform locally, it is pretty much a PITA if you have not done it before. Especially, because you need lots of permissions, which you usually do not have. However, executing the actions locally is currently the only way to enable debug logging. The logs from GitHub Actions are deleted after some time anyway, so a verbose output is not that bad. And IF you look at these logs, you probably want to have detailed information. I currently still do not see a real disadvantage here 🤔 But agreed, we probably do not want |
@sprankhub Starting Terraform plan https://github.com/mage-os/terraform/actions/runs/3324322452 |
That's fine. But |
@vitaliy-golomoziy Starting Terraform plan https://github.com/mage-os/terraform/actions/runs/3324348075 |
And regarding running terraform locally, setting all vars in a command line is another option, perhaps more intuitive in the sense that we can provide a handy command where people just substitute the right values so that nothing important is forgotten. |
@vitaliy-golomoziy Starting Terraform plan https://github.com/mage-os/terraform/actions/runs/3324419075 |
We should consider using one of the following Terraform log levels during the GitHub Actions by default:
TRACE
DEBUG
INFO
WARN
ERROR
This is as easy as adding an environment variable
TF_LOG
to the respective value, see https://developer.hashicorp.com/terraform/internals/debugging.The advantage would be that we have detailed information about issues, which may occur, without executing the actions locally.
Would appreciate your input, @bucha, @vitaliy-golomoziy if you think it makes sense and which log level we should use.
The text was updated successfully, but these errors were encountered: