如何设置到google_compute_instance_template的自连接以提供文件



我正在尝试使用下面所示的方法将文件配置到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

相关内容

  • 没有找到相关文章

最新更新