-
Notifications
You must be signed in to change notification settings - Fork 117
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
Open the API #279
Comments
Thanks for the well-written feature request and your patience while we get the subcommands implemented. Our aim with terraform-exec is to have support for all Terraform subcommands which make sense in this API. The library is intended to be opinionated about how you use those subcommands and flags. If tfexec had implemented all subcommands you want to use, would you still want this feature? |
@kmoe Probably not. At least I can't think of a use-case beyond extending or changing the API. IMO it wouldn't hurt and it would allow for free use? But assuming everything is implemented there are of course less reasons. |
supporting arbitrary arguments would enable some options having to code every possible options as an example, I need to add the |
Hey 👋🏼
I wanted to ask for your thoughts on the "re-usability" of this tool.
I know that the maintainers/HashiCorp cannot implement everything that people want and it seems like adding commands is a long undertaking right now (from looking at the PRs). I understand that this tool may not be of highest priority etc., and people have something else to do.
Having said all of the above, would it be possible to e.g. open the API of the tool a little bit, so people can implement custom commands more easily downstream?
I am specifically looking at this which would already give me the ability to run arbitrary commands:
https://github.com/hashicorp/terraform-exec/blob/main/tfexec/cmd.go#L173-L196
For example, I want to add a
state pull
and astate push
command for my purposes (I understand the potential complications of editing Terraform state), but I can't re-use this now and I am already usingterraform-exec
in an internal tool for state recovery 🙈 . So I'd generally like to continue to use it for the convenience that's already there. Due to the methods not being public, it leads to copy/paste on my end.I am copying parts of
buildTerraformCmd
for some re-use, but that doesn't seem ideal:This leads to all of kinds of other code that I need to take parts from:
runTerraformCmdJSON
runTerraformCmd
/runTerraformCmdJSON
Any thoughts on allowing for this use?
The text was updated successfully, but these errors were encountered: