地形数据.Google_compute_network不工作



这是我试图执行的代码块…起程拓殖1.0

data "google_compute_network" "my-network" {
name = "udemytestdel"
}
resource "google_compute_firewall" "firewall" {
name    = "gritfy-firewall-externalssh"
network = data.google_compute_network.my-network.name
allow {
protocol = "tcp"
ports    = ["22"]
}
source_ranges = ["0.0.0.0/0"] # Not So Secure. Limit the Source Range
target_tags   = ["externalssh"]
}

我一直得到这个

│ Error: Missing required argument
│
│   with google_compute_firewall.firewall,
│   on vm.tf line 16, in resource "google_compute_firewall" "firewall":
│   16:   network = data.google_compute_network.my-network.name
│
│ The argument "network" is required, but no definition was found.```

尝试添加项目名称。

data "google_compute_network" "my-network" {
name = "udemytestdel"
project = "yourprojectname"

相关内容

  • 没有找到相关文章