-
Notifications
You must be signed in to change notification settings - Fork 131
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
Support multiple / relative directories for explicit Terraform binary path #112
Comments
Yes, please !! ... I have a monorepo with a run for development and other run for production and it would be great to be able to have a way to declare a list of discovery paths, thank you !! |
One concern I initially had about relative directories was that users wouldn't at first sight know what is the path relative to. However these concerns were recently basically addressed by turning CLI flags into LSP config options in #588 - so we have a path that relative paths can be appended to (project root). However before implementing this I'd really like to understand the use case for relative paths here because I'm not sure that treating project/workspace dir as root for relative paths is folks actually want/need. @csaltos @bigbrozer Do you folks mind explaining your workflow/setup in more detail? Specifically why do you (want to) use a different Terraform binary per environment and how do you manage your Terraform installations, relatedly where on your filesystem would you install these Terraform binaries? Have either of you tried using version management tool, such as these?
Generally speaking I would assume that maintaining some form of text/config file with a version is more sustainable than expecting anyone to install Are there other reasons beyond versioning where relative paths would help? |
Meanwhile, we have now a terraform binary installed globally on developers workstation (always latest) and we have switched to a Python virtual environment where we install the terraform binary and version (eg. in (EDIT: The terraform binary installed system-wide is here to tests / prototype some stuffs using the latest release locally. The one inside the project virtual environment is here to ensure we have all the same version validated for this project.) But, I have a doubt that the language server is still using the one provided globally (system-wide) instead of the one from the project virtual environment ( |
Thank you for your messages. The setup we currently use at my company is as follows:
So, here is the feature we would like to have: When we open the Terraform code we would like to have a way to set where is the starting folder, in this way we can set the production folder when we need production and the testing folder when we need it for testing servers. A nice to have feature would be to have several Terraform starting folders at the same time. Once again thank you for all your work and support. Since we are using Terraform and Terraform LS our lives become a lot more easy, productive, and happy. |
@bigbrozer That makes sense. I think the venv workflow is very similar to the one provided/supported by direnv and most likely the other tools where the tool hooks into your shell and executes something to change the relevant environment upon I believe the best way we can support all these different tools and use cases would be (optionally?) loading shell environment, similar to how VS Code does it when it opens the builtin terminal. With that said I'm tempted to say that supporting explicit/static paths to TF binary would not serve these workflows very well as one would have to keep updating the list of paths constantly. I'm inclined to close this issue in favour of #69 and #305 and/or even merge these two issues into one by describing more general-purpose mechanism as above.
Do you mind elaborating on this? Specifically what do you mean by "common definitions"? Would that be a locally shared module such as module "network" {
source = "../network"
subnets = ["10.10.0.0/24", "10.10.1.0/24", "10.10.2.0/24"]
}
I'm struggling to understand why would you need a different path to Terraform binary for testing or production, if the version is the same?
Do you mind explaining the idea of a "starting folder" and how do you expect this to work in practice? Thanks. |
Marking this issue as stale due to inactivity over the last 30 days. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 30 days it will automatically be closed. Maintainers can also remove the stale label. Thank you for understanding. |
Closing this issue due to its staleness. If the issue was automatically closed and you feel it should be reopened, we encourage creating a new one linking back to this one for added context. Thank you! |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Related to #109, it would be useful to specify a relative path from the configuration directory to a Terraform binary, or to support a list of discovery paths.
The text was updated successfully, but these errors were encountered: