-
Notifications
You must be signed in to change notification settings - Fork 361
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
Failed to load modules from outside of the module's directory #1508
Comments
#1315 ( |
Thank you for the comment, but I'm wondering if the However, the current directory is not necessarily important for module loading, as there is now room for improving the module loader to TFLint's use case. I think the use case where I think extending the module loader to allow modules to be loaded without depending on the current directory would be a good solution to this issue. |
Sure, we can discuss further on that issue. Terraform did this for the sake of simplicity, because having various commands/code paths need to consider the working directory led to inconsistency/bugs: Previously, Assuming the original example were actually working, presumably the full script would be: terraform -chdir=./work init
tflint --module ./work Setting partial workarounds aside (#1502), if you want to use module inspection, you have to run |
Good point. As mentioned in #1355 (comment), remote module inspection is a challenge in implementing recursive inspection. I agree that recursive inspection should not be provided when conforming to Terraform semantics. However, in reality, there are many use cases for inspecting multiple modules, and I now believe that deliberately "distorting" the design for that purpose is not a bad option. Terragrunt is a wrapper designed to solve this design limitation of Terraform, and its design is worth looking at. On the other hand, a design that accepts a directory as an argument may not be good as it is inconsistent with Terraform's CLI design. Apart from recursive inspection, given the use case of running |
Introduction
Enabling module inspection and inspecting from outside the module's directory will cause the module to fail to load.
See also #1435
Expected Behavior
It loads successfully with no errors.
Actual behavior
It failed to load.
Step to Reproduce
Additional Context
The text was updated successfully, but these errors were encountered: