Open stefreak opened 1 year ago
This would be very useful. I think the restructured commands are much more intuitive and will commit to memory much easier. And the idea of a shell where you can run terraform
directly with the relevant environment preset is great. It will make it much easier to do simple things such as terraform output
, working with the Terraform state e.g. terraform state list
, terraform state mv ...
, resource-targeted applies and so-on.
@edvald this seems to be a breaking change. Should we address it in 0.13
?
I added the 0.13
label. Let's decide on this before the official 0.13
release.
Feature Request
A more intuitive terraform plugin CLI
Background / Motivation
autoApply
need to run terraform commands from time to time, for example to inspect or modify the state. Currently they need to remember or look up the terraform version, and rungarden tools terraform.terraform-<terraform-version> -- some terraform command
.garden plugins terraform plan-root/plan-module
before runninggarden tools terraform.terraform-<terraform-version> -- some terraform command
garden --env my-service-prod-eu plugins terraform plan-module -- terraform-module
What should the user be able to do?
I would suggest that we change our CLI, for example in Garden 0.13, to be, where possible, exactly the same as terraform's CLI.
Terraform module-level config examples
How to select a module:
Or, if there is only one terraform module, just:
Provider-level terraform config examples
In case of ambiguity, for example if there is also a module in addition to the provider-level terraform stack, garden could list the possible options to the user:
Help
It would be nice to actually forward the --help flag to the terraform command and list all the available options for the current version.
Shell
In case the user wants to perform a series of task using the terraform executable directly, we could also offer a terraform shell.
Example session:
Why do they want to do this? What problem does it solve?
Terraform users need to interact with terraform directly in some cases. Garden should make this easy, and not harder than it should be.
Experienced terraform users should not need to learn the kinks of yet another CLI. It should feel as familiar as possible to them.
Suggested Implementation(s)
Did not look into the code, but changing the CLI should be doable. There might be quirks in the current way we parse CLI arguments.
How important is this feature for you/your team?
🌵 Not having this feature makes using Garden painful