-
Notifications
You must be signed in to change notification settings - Fork 9.8k
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
Allow capturing and passing module source as a variable #33793
Comments
Thanks for this feature request! This issue looks fairly close to #25587 -- do you think this is a use case of that issue, or an alternate implementation? If you are viewing this issue and would like to indicate your interest, please use the 👍 reaction on the issue description to upvote this issue. We also welcome additional use case descriptions. Thanks again! |
This is exactly in relation to that issue, but this is an alternative approach that is actually doable, in contrast to the approach that people want at #25587 and similar issues (there are severe architectural issues that have been blockers for like 10 years now and there is no solution in sight). If we had #25587 implemented - we would not need this, but if we don't have #25587 this is much more practical. I suspect the only way to actually implement #25587 is to do what I suggest here, but it is not clear just yet. |
Adding my voice here. We use Terraform Cloud extensively across multiple teams and have shared modules in github repositories. Version tracking is almost impossible except manually.. and it is not just the base code but all previous Terraform Cloud workspaces that were deployed have to be version-pinned per module. Terraform cloud also does not allow a pre-init script, and the pre_plan key does not work for this. There's no clear mechanism between github and Terraform Cloud where scripts can be added to replace these versions before terraform runs. Any mechanism that allows a module source to be dynamically specified in terraform code will be welcome. A mechanism that can substitute variables (or environment variables) in the git path or ref will be particularly helpful. |
Terraform Version
Use Cases
Can be a solution for people who want variable support in module sources.
Attempted Solutions
Variables in modules sources - was rejected because modules need to be installed as dependencies before they can be used. This makes sense.
Proposal
Allow doing this:
In the module
qq
Outside of the module:
The version of
qwe
is locked and specified in the outside module.References
The text was updated successfully, but these errors were encountered: