0
配置terraform以下提供:我已經如何配置憑據文件Terraform
provider "google" {
credentials = "${file("key.json")}"
project = "project-123456"
region = "${var.region}"
}
我能項目名稱移到我打電話terraform計劃時,傳遞和應用的變量。但憑證密鑰文件似乎不可配置。
provider "google" {
credentials = "${var.key}"
project = "${var.project}"
region = "${var.region}"
}
terraform計劃-var關鍵= '$ {文件( 「key.json」)}' -var項目=項目123456
拋出這個錯誤:
- provider.google: credentials are not valid JSON '${file("key.json")}': invalid character '$' looking for beginning of value
我也試過這樣:
provider "google" {
credentials = "${file(${var.key})}"
project = "${var.project}"
region = "${var.region}"
}
terraform計劃-var鍵= key.json -var項目=項目123456
但它拋出這個錯誤:
Error reading config for provider config google: parse error at 1:8: expected expression but found invalid sequence "$"
如何配置憑證文件的供應商?