-
Notifications
You must be signed in to change notification settings - Fork 630
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
provider: Enable request/response logging #212
Conversation
Big 💯 from me on this one. I've actually got a combination of something similar to this that I've hacked into the provider when building a dev version. 😛 My only question here is whether we should attempt to scrub some known sensitive data (such as the API key credential) that will show up in the output. Maybe replace everything except the first and last 4 characters of the key with asterisks? It will end up looking like Thoughts? |
Co-Authored-By: radeksimko <[email protected]>
@jacobbednarz I understand your concerns, but as I mentioned above the debug log is only available to those who are capable of enabling the debug mode, which are in all (?) cases the same people who provide these (sensitive) credentials through configs or ENV variables in the first place. We generally expect users to treat debug logs with at least the same care as state files: https://www.terraform.io/docs/state/sensitive-data.html We had some early discussions about scrubbing sensitive data internally (also in the context of state) and might introduce a solution for that at some point in the future. |
That said I guess we could explicitly mention this expectation in https://www.terraform.io/docs/internals/debugging.html |
Totally agree with your points and if it's something that has already been considered and we're happy proceeding, 👍 with me. |
Thanks again for this @radeksimko! 🤘 |
This makes debugging for developers & users of this provider easier by exposing all requests & responses in the log (when >
DEBUG
severity is set).I didn't have chance to explore the
api_client_logging
option on the provider, but it became a common convention in other major providers to just respect logging level of Terraform (typically controlled viaTF_LOG
) and leverage the global logging settings, which also allows us to respectTF_LOG_PATH
and send all these useful logs somewhere safe, instead of flooding stderr.Keeping providers aligned may help users going forward and reduce confusion as we can document debugging/troubleshooting guides in one place for all providers and just point people there.
Whether you decide to keep that option in the provider block or deprecate it is ultimately up to you though. I don't want you to feel like I'm pressing you into deprecating it. 😉
Example: