跑在我的根目錄Terraform一個terraform output
我得到:無法找到模塊根目錄。沒有什麼可以輸出
The module root could not be found. There is nothing to output.
我有以下文件:
iam.tf
resource "aws_iam_user" "a_user" {
name = "a_user"
}
output.tf
數據「aws_caller_identity」「current」{}
output "account_id" {
value = "${data.aws_caller_identity.current.account_id}"
}
這https://www.terraform.io/docs/modules/index.html說:
Root module That is the current working directory when you run terraform apply or get, holding the Terraform configuration files. It is itself a valid module.
任何想法,爲什麼錯誤信息,以及如何解決?