When running tflint --recursive --call-module-type=all with a file directory that contains nested local modules (that is local modules that call other remote/local modules), tflint says Error: "module1" module is not found. Did you run "terraform init"? It seems to expect that I go into each of my local modules and run terraform init. That seems totally unnecessary since it should be able to figure things out by looking at my root .terraform/modules folder created by running terraform init in the root.
│ Failed to run in modules/module7; exit status 1
Failed to load configurations; modules/module7/main.tf:23,1-33: "module8" module is not found. Did you run "terraform init"?; :
Error: "module8" module is not found. Did you run "terraform init"?
on modules/module7/main.tf line 23, in module "module8":
23: module "module8" {
│ Failed to run in modules/module3; exit status 1
Failed to load configurations; modules/module3/main.tf:14,1-16: "module9" module is not found. Did you run "terraform init"?; , and 1 other diagnostic(s):
Error: "module9" module is not found. Did you run "terraform init"?
on modules/module3/main.tf line 14, in module "module9":
14: module "module9" {
Error: "module10" module is not found. Did you run "terraform init"?
on modules/module3/main.tf line 20, in module "module10":
20: module "module10" {
Summary
When running
tflint --recursive --call-module-type=all
with a file directory that contains nested local modules (that is local modules that call other remote/local modules), tflint saysError: "module1" module is not found. Did you run "terraform init"?
It seems to expect that I go into each of my local modules and runterraform init
. That seems totally unnecessary since it should be able to figure things out by looking at my root .terraform/modules folder created by running terraform init in the root.Command
tflint --recursive --call-module-type=all
Terraform Configuration
TFLint Configuration
Output
TFLint Version
0.51.2
Terraform Version
1.5.7
Operating System