Terraform模块引发错误“文字未终止”

时间:2019-04-18 07:06:56

标签: amazon-web-services terraform

当我应用Terraform计划时,它显示错误加载配置:错误解析“位置” 2:21:文字未终止

模板文件

provider "aws" {
  region = "${var.region}"
}

resource "aws_instance" "modDem" {
  ami           = "${var.ami`enter code here`i}"
  instance_type = "{var.instance}"

  tags {
    Name = "Demo"
  }
}

变量文件

variable "amii" {
  default = "ami-22b9a343"
}

variable "instance" {
  default = "t2.micro"
}

variable "region" {
  default = "us-west-2"
}

模块文件:

module "Tr" {
  source = "../modules'
}

1 个答案:

答案 0 :(得分:0)

模块文件中的source字段未正确终止。它看起来应该像这样: 模块文件:

module "Tr" {
  source = "../modules"
}