我正在使用谷歌虚拟机提供商terraform。我想将现有的静态IP分配给虚拟机。如何将静态IP映射到terraform google计算引擎实例?
代码:
resource "google_compute_instance" "test2" {
name = "dns-proxy-nfs"
machine_type = "n1-standard-1"
zone = "${var.region}"
disk {
image = "centos-7-v20170719"
}
metadata {
ssh-keys = "myuser:${file("~/.ssh/id_rsa.pub")}"
}
network_interface {
network = "default"
access_config {
address = "130.251.4.123"
}
}
}
但它与错误而失败:
google_compute_instance.test2: network_interface.0.access_config.0: invalid or unknown key: address
我该如何解决这个问题?