Skip to content

Instantly share code, notes, and snippets.

@Callonski
Last active September 7, 2020 00:58
Show Gist options
  • Save Callonski/96946e6d63434115d672a345194478e2 to your computer and use it in GitHub Desktop.
Save Callonski/96946e6d63434115d672a345194478e2 to your computer and use it in GitHub Desktop.
resource "google_compute_firewall" "allow-all-internal" {
name = "allow-all-internal"
network = google_compute_network.my-elastic-network.name
allow {
protocol = "tcp"
}
allow {
protocol = "udp"
}
allow {
protocol = "icmp"
}
source_ranges = ["x.x.x.x/x"] // your subnet IP range
}
resource "google_compute_firewall" "allow-internal-lb" {
name = "allow-internal-lb"
network = google_compute_network.my-elastic-network.name
allow {
protocol = "tcp"
ports = var.ports_to_open
}
source_ranges = ["x.x.x.x/x"] // your subnet IP range
target_tags = var.network_tags
}
resource "google_compute_firewall" "allow-health-check" {
name = "allow-health-check"
network = google_compute_network.my-elastic-network.name
allow {
protocol = "tcp"
ports = var.ports_to_open
}
source_ranges = ["x.x.x.x/x"] // your subnet IP range
target_tags = var.network_tags
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment