我正在尝试使用下面所示的方法将文件配置到google_compute_instance_template
...
provisioner "file" {
source = file("${path.module}/../scripts/infrastructure/circleci/docker-compose.production.yml")
destination = "/tmp/docker_compose_file"
connection {
host = google_compute_instance_template.media_apps_template.self_link.public_ip
agent = false
type = "ssh"
user = "ubuntu"
private_key = "${file("./creds/media_apps")}"
}
}
....
父google_compute_instance_template
看起来像这样
resource "google_compute_instance_template" "media_apps_template" {
}
得到的错误是Can't access attributes on a primitive-typed value (string).
如何配置主机部分
try this
connection {
type = "ssh"
user = "ubuntu"
private_key = file("./creds/media_apps.pem")
host = google_compute_instance_template.self_link.public_ip