Skip to content

Retrieving Output for Failed Executions of Terraform #1120

@hyp0th3rmi4

Description

@hyp0th3rmi4

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    awaiting responseWaiting for a response or more data from issue reporterquestion

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions