Skip to content
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

Recursive module linting fails with module is not found #521

Closed
kayman-mk opened this issue Jul 24, 2023 · 1 comment
Closed

Recursive module linting fails with module is not found #521

kayman-mk opened this issue Jul 24, 2023 · 1 comment

Comments

@kayman-mk
Copy link

Hi,

using #518 as base but adding a module m to m/main.tf. terraform apply works fine and applies all changes, but tflint --recursive --module fails with

tflint --module --recursive
Failed to load configurations; m\main.tf:40,1-11: `m` module is not found. Did you run `terraform init`?; :

Error: `m` module is not found. Did you run `terraform init`?

  on m\main.tf line 40, in module "m":
  40: module "m" {

Layout on filesystem is

main.tf
  m/main.tf
    m/main.tf

It seems that everything is fine if I rename the second submodule to something different than m..

Ruleset version is 0.24.3

@wata727
Copy link
Member

wata727 commented Jul 24, 2023

This is the intended behavior. The --recursive runs tflint --module on every module, so you need to run terraform init on every module (./, ./m, and ./m/m).

@wata727 wata727 closed this as not planned Won't fix, can't repro, duplicate, stale Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants