infrablocks / ruby_terraform

A simple Ruby wrapper for invoking terraform commands.
MIT License
109 stars 33 forks source link

make apply command return output string #25

Closed tobivogel closed 5 years ago

tobivogel commented 5 years ago

This PR contains two small changes.

tobyclemson commented 5 years ago

Hi Tobi,

Sorry it has taken so long to get back to you. I'm not sure I fully understand what you want the apply command to do. Also, I wonder whether it should apply to all commands rather than specifically apply.

Are you hoping to specifically get the outputs at the end of execution? I think the change as it currently stands would throw away all the other command output which currently shows on stdout so this would be a breaking change.

It might be better to make stdin, stdout and stderr streams configurable for all commands. That way you could potentially tee the output and use it for whatever purpose whilst maintaining the stdout output.

tobyclemson commented 5 years ago

Hey Tobi,

I've pushed your README updates, thanks for those. With the help of another contributor, the standard streams are now all configurable so if you want to get the output from the apply command and use in memory for any reason, you can now do that by passing in something custom for the stdout stream when configuring the library. The README should include enough detail but let me know if not.

I'm going to close this PR for now since as far as I can tell you are able to achieve what you wanted to.

Thanks, Toby

tobivogel commented 5 years ago

Hi Toby,

Sorry for relpying a bit late as well.

To your original question, yes my intention was go get the output from the apply command and use the IP for a smoke test without the need to use the output command too. It's really just for convenience.

Nice that the more generic configuration made it into the codebase. Should be good for my usecase too.

Cheers tobi

On 26 September 2019 00:22:05 GMT+07:00, Tobias Clemson notifications@github.com wrote:

Hey Tobi,

I've pushed your README updates, thanks for those. With the help of another contributor, the standard streams are now all configurable so if you want to get the output from the apply command and use in memory for any reason, you can now do that by passing in something custom for the stdout stream when configuring the library. The README should include enough detail but let me know if not.

I'm going to close this PR for now since as far as I can tell you are able to achieve what you wanted to.

Thanks, Toby

-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/infrablocks/ruby_terraform/pull/25#issuecomment-535124947

-- Sent from my Android device with K-9 Mail. Please excuse my brevity.