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

Terrascan not able to read modules within a subdirectory #600

Closed
jlunaq opened this issue Mar 9, 2021 · 4 comments · Fixed by #641
Closed

Terrascan not able to read modules within a subdirectory #600

jlunaq opened this issue Mar 9, 2021 · 4 comments · Fixed by #641
Labels

Comments

@jlunaq
Copy link

jlunaq commented Mar 9, 2021

terrascan v1.3.3
MacOS Catalina 10.15.7

Hey there ,

I'm currently working with terraform modules hosted on github, I found that terrascan is able to read the modules when they are in the root directory.
However I found an issue with a module which is in a subdirectory, like this:

source = "[email protected]:company/module.git//modules/base?ref=v2.0.0"

In this particular case is where I'm getting this error

<nil>: Failed to read module directory; Module directory /Users/jluna/my-project/[email protected]:company/module.git/modules/roles does not exist or cannot be read.

Thanks in advance

  • Jorge
@jlunaq
Copy link
Author

jlunaq commented Mar 17, 2021

Hello, any update

@devang-gaur
Copy link
Contributor

@jlunaq is that module (inside the subdirectory) being consumed by the root directory module ?

@jlunaq
Copy link
Author

jlunaq commented Mar 18, 2021

Yep, sorry I forgot to mention that.

From the root module I am consuming the other module like this.

module "project_owner_role" {
  source = "../roles"

  ...
}

Note that I'm using a relative path ../roles not sure how this could be affecting the way terrascan reads the modules

@djsly
Copy link

djsly commented Mar 18, 2021

I'm having the same issues I think where the root module is consuming child module from remote sources

✖ terrascan scan
2021-03-18T13:03:39.934-0400    error   commons/load-dir.go:121 failed to build unified config. errors:
<nil>: Failed to read module directory; Module directory /Users/sylvain_boily/git/gitlab/core-tech/infra/deployments/sandboxes/azure-sly-eastus/https:/<hostname>/artifactory/xinfra-tf/release/azure-xinfra/azure-xinfra-v0.13.2-RC4.tar.gz/https:/<hostname>/artifactory/xinfra-tf-local/release/tf-kubernetes-artifactory-frontend/tf-kubernetes-artifactory-frontend-v2.6.2.tar.gz/backend-endpoints does not exist or cannot be read.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants