【发布时间】:2016-12-03 08:31:58
【问题描述】:
所以我有一个在 Google Cloud Platform 中创建实例的 terraform 脚本,我希望能够让我的 terraform 脚本也将我的 ssh 密钥添加到我创建的实例中,以便我可以通过 ssh 配置它们。这是我当前的 terraform 脚本。
#PROVIDER INFO
provider "google" {
credentials = "${file("account.json")}"
project = "myProject"
region = "us-central1"
}
#MAKING CONSUL SERVERS
resource "google_compute_instance" "default" {
count = 3
name = "a-consul${count.index}"
machine_type = "n1-standard-1"
zone = "us-central1-a"
disk {
image = "ubuntu-1404-trusty-v20160627"
}
# Local SSD disk
disk {
type = "local-ssd"
scratch = true
}
network_interface {
network = "myNetwork"
access_config {}
}
}
我必须添加什么才能让我的 terraform 脚本添加我的 ssh 密钥 /Users/myUsername/.ssh/id_rsa.pub?
【问题讨论】:
标签: ssh google-cloud-platform terraform