Google cloud platform 通过Terraform提供没有外部IP的GCP VM实例
试图通过terraform在GCP中创建一个外部IP为None的VMGoogle cloud platform 通过Terraform提供没有外部IP的GCP VM实例,google-cloud-platform,terraform-provider-gcp,Google Cloud Platform,Terraform Provider Gcp,试图通过terraform在GCP中创建一个外部IP为None的VM network_interface { network = "projects/other-project-name/global/networks/network-name" subnetwork = "projects/other-project-name/regions/us-central1/subnetworks/subnet-name" access_config
network_interface {
network = "projects/other-project-name/global/networks/network-name"
subnetwork = "projects/other-project-name/regions/us-central1/subnetworks/subnet-name"
access_config {
nat_ip = "None"
}
}
但是nat_ip=“None”
对于该字段是无效的值。如果我做了nat_ip=”“
,它会自动分配外部ip。以下是他们的文档:要通过terraform在GCP中创建一个虚拟机,而无需外部IP,您只需省略
网络接口
块中的访问配置
部分即可。所以你应该:
network_interface {
network = "projects/other-project-name/global/networks/network-name"
subnetwork = "projects/other-project-name/regions/us-central1/subnetworks/subnet-name"
}