Terraform 模块目录不可读。

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

Terraform Unreadable module directory

问题

我有一个Terraform配置,如下所示:

Terraform 模块目录不可读。

尝试在main.tf中使用服务帐户如下:

################# 通用设置 #################################
provider "google" {
  project = var.project_id
  region  = var.project_region
}

module "service_account" {
  source = "./service_account"
}

但我遇到以下错误:

C:\Users\\Documents\terraform\dashboards-infrastructure\test>terraform init
初始化模块...
- serivce_account in
╷
│ 错误: 无法读取模块目录
│
│ 无法评估目录符号链接:CreateFile service_account: 系统找不到指定的文件。
╵

╷
│ 错误: 无法读取模块目录
│
│ 模块目录 不存在或无法读取。
╵

╷
│ 错误: 无法读取模块目录
│
│ 无法评估目录符号链接:CreateFile service_account: 系统找不到指定的文件。
╵

╷
│ 错误: 无法读取模块目录
│
│ 模块目录 不存在或无法读取。

为什么Terraform无法看到我的服务帐户模块?

英文:

I have a terraform configuration as:

Terraform 模块目录不可读。

trying to use the service account in main.tf as

################# General Settings #################################
provider "google" {
  project = var.project_id
  region  = var.project_region
}

module "serivce_account" {
  source = "./service_account"
  
}

but im getting the following erros

C:\Users\\Documents\terraform\dashboards-infrastructure\test>terraform init
Initializing modules...
- serivce_account in
╷
│ Error: Unreadable module directory
│
│ Unable to evaluate directory symlink: CreateFile service_account: The system cannot find the file specified.
╵

╷
│ Error: Failed to read module directory
│
│ Module directory  does not exist or cannot be read.
╵

╷
│ Error: Unreadable module directory
│
│ Unable to evaluate directory symlink: CreateFile service_account: The system cannot find the file specified.
╵

╷
│ Error: Failed to read module directory
│
│ Module directory  does not exist or cannot be read.

why can't terraform see my service account module??

答案1

得分: 1

应该是 service_acount,而不是 service_account。您在文件夹名称中犯了一个错误。

英文:

It should be service_acount, not service_account. You have mistake in folder name.

huangapple
  • 本文由 发表于 2023年3月3日 17:53:30
  • 转载请务必保留本文链接:https://go.coder-hub.com/75625539.html
匿名

发表评论

匿名网友

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

确定