【发布时间】:2021-02-05 23:18:46
【问题描述】:
有没有其他方法可以直接使用 terraform 启用这些规则,而无需在 GCP 中创建单独的防火墙规则,然后将标签附加到计算引擎
目前我正在这样做
resource "google_compute_firewall" "allow_http" {
name = "allow-http-rule"
network = "default"
allow {
ports = ["80"]
protocol = "tcp"
}
target_tags = ["allow-http"]
priority = 1000
}
然后在
中使用这个标签 resource "google_compute_instance" "app" {
...
tags = ["allow-http"]
}
【问题讨论】:
标签: google-cloud-platform terraform google-compute-engine terraform-provider-gcp