从给定的 .tfvars 文件加载变量值对许多参数有错误
Load variable values from the given .tfvars file got an error to many arguments
我 运行 terraform plan commnad apllo.tfvars 文件
terraform plan -var-file=apllo.tfvars
│ 错误:命令行参数过多
│ 要为计划指定工作目录,请使用全局 -chdir 标志。
我的variable.tf
variable "user" {
type = string
}
# number variable
variable "age" {
type = number
}
apllo.tfvars
user = "AWSUSER"
age = 222
output.tf
output "name" {
value = "hello ${var.user}"
}
output "age" {
value = "age ${var.age}"
}
如果您将 Powershell 用于 运行 Terraform,请尝试使用单引号或双引号指定 .tfvar
文件,例如:
terraform plan -var-file="apollo.tfvar"
我 运行 terraform plan commnad apllo.tfvars 文件
terraform plan -var-file=apllo.tfvars
│ 错误:命令行参数过多
│ 要为计划指定工作目录,请使用全局 -chdir 标志。
我的variable.tf
variable "user" {
type = string
}
# number variable
variable "age" {
type = number
}
apllo.tfvars
user = "AWSUSER"
age = 222
output.tf
output "name" {
value = "hello ${var.user}"
}
output "age" {
value = "age ${var.age}"
}
如果您将 Powershell 用于 运行 Terraform,请尝试使用单引号或双引号指定 .tfvar
文件,例如:
terraform plan -var-file="apollo.tfvar"