Would it be possible to return the output (string format) when a terraform execution fails?
It seems that the internal method of terratest/terraform already have access to it, but they simply strip it away here:
|
_, err := shell.RunCommandAndGetOutputE(t, cmd) |
Since terraform returns always 1 as error code for validation errors, it would be helpful to access the output stream to verify the cause of the error. At the moment executing a tf plan with errors (variable validation or other error during plan phase) provides an opaque value (=1) that will not enable the caller to verify what is the exact cause of the failure.
Would it be possible to return the output (string format) when a terraform execution fails?
It seems that the internal method of terratest/terraform already have access to it, but they simply strip it away here:
terratest/modules/terraform/cmd.go
Line 105 in 4694196
Since terraform returns always 1 as error code for validation errors, it would be helpful to access the output stream to verify the cause of the error. At the moment executing a
tf planwith errors (variable validation or other error during plan phase) provides an opaque value (=1) that will not enable the caller to verify what is the exact cause of the failure.