-
Notifications
You must be signed in to change notification settings - Fork 50
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
Support option to output stderr regardless of failure #67
Comments
I think it would help me to solve that issue : https://stackoverflow.com/questions/66490152/how-to-debug-terraform-external-providers-with-concurrency-issues Indeed, I can find any bad JSON output in the external programs I run and I'm stuck with no information on the output Terraform takes in count or any error that would make my command to fail from sometimes. |
Hi @skeggse 👋 Thank you for raising this. Terraform Providers have a few ways to raise execution output:
In this scenario, it appears that either of the first two options (log messages or warning diagnostics) are the most viable since raising an error diagnostic would be a drastic behavior change. Personally, I do not think warning diagnostics are a good fit here though because practitioners will not have a good way to exclude this information and see this as a user experience breaking change for programs that have previously worked without this additional output for a long time. This data source has had some recent logging improvements that will be released in the next version (#95). This logging could potentially be further enhanced by including stderr if present. Would adding stderr output (if present) to that trace log suit this feature request? See also hashicorp/terraform#17267 in the Terraform CLI issues for another potential idea here, which cannot be implemented today by providers. |
My primary use-case is for |
If you have more specific asks for handling of this situation outside of logs, feel free to submit a new issue. Thanks! |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Terraform Version
Affected Resource(s)
external
Terraform Configuration Files
Debug Output
Plan
Panic Output
N/a
Expected Behavior
terraform {plan,apply}
should (optionally) print the stderr output even when the exit code from the script is zero.Actual Behavior
terraform {plan,apply}
does not print the stderr output unless the exit code is nonzero.Steps to Reproduce
terraform apply
orterraform plan
Important Factoids
N/a
References
scottwinkler/terraform-provider-shell#27, maybe
The text was updated successfully, but these errors were encountered: