Failed to read module directory.

huangapple go评论101阅读模式
英文:

Failed to read module directory

问题

I have a folder structure in the below format

  1. demo
  2. proj
  3. terraform
  4. myfile.tf

The modules are present in the below path

  1. demo
  2. modules
  3. terraform
  4. myconfigfiles
  5. vmcreation

How do I call the modules in terraform. The path of the source is not working. I tried this but it doesn't work

  1. source = "../modules/terraform/myconfigfiles/vmcreation"

I am getting this error during terraform init

  1. Error: Unreadable module directory
  2. Unable to evaluate directory symlink: CreateFile ..\modules: The system cannot find the file specified.

Error: Failed to read module directory

Module directory does not exist or cannot be read.

英文:

I have a folder structure in the below format

  1. demo
  2. proj
  3. terraform
  4. myfile.tf

The modules are present in the below path

  1. demo
  2. modules
  3. terraform
  4. myconfigfiles
  5. vmcreation

How do I call the modules in terraform. The path of the source is not working. I tried this but it doesn't work

  1. source = "../modules/terraform/myconfigfiles/vmcreation"

I am getting this error during terraform init

  1. Error: Unreadable module directory
  2. Unable to evaluate directory symlink: CreateFile ..\modules: The system
  3. cannot find the file specified.
  4. Error: Failed to read module directory
  5. Module directory does not exist or cannot be read.
  6. </details>
  7. # 答案1
  8. **得分**: 1
  9. 翻译内容:
  10. 相对路径在根模块配置和声明的模块之间需要另一个 `..` 前缀:
  11. source = "../../modules/terraform/myconfigfiles/vmcreation"
  12. <details>
  13. <summary>英文:</summary>
  14. The relative pathing between the root module config and the declared module requires another `..` prefix:
  15. source = &quot;../../modules/terraform/myconfigfiles/vmcreation&quot;
  16. </details>

huangapple
  • 本文由 发表于 2023年5月25日 20:54:56
  • 转载请务必保留本文链接:https://go.coder-hub.com/76332493.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定