hashicorp / terraform-config-inspect

A helper library for shallow inspection of Terraform configurations
Mozilla Public License 2.0
376 stars 76 forks source link

Module directory main.tf does not exist or cannot be read. #66

Open RidaAyed opened 2 years ago

RidaAyed commented 2 years ago

I can't read the main.tf

e.g. Expected is returned value, though got: $ ~/go/bin/terraform-config-inspect --json | grep FarmProjects > null

Testing with grep works: $ grep FarmProjects main.tf -A 2 -B 2

resource "aws_dynamodb_table" "projects_table" {
  name = "FarmProjects"
  billing_mode = "PAY_PER_REQUEST"
  hash_key = "ProjectId"

After all it seems main.tf isn't processed at all: ~/go/bin/terraform-config-inspect --json main.tf

{
  "path": "main.tf",
  "variables": {},
  "outputs": {},
  "required_providers": {},
  "managed_resources": {},
  "data_resources": {},
  "module_calls": {},
  "diagnostics": [
    {
      "severity": "error",
      "summary": "Failed to read module directory",
      "detail": "Module directory main.tf does not exist or cannot be read."
    }
  ]
}
adyavanapalli commented 3 months ago

@RidaAyed Did you ever figure out the issue? I'm seeing the same thing.