Skip to content

Instantly share code, notes, and snippets.

@mlabouardy
Created January 5, 2019 11:32
Show Gist options
  • Select an option

  • Save mlabouardy/93456097b83b11eb223c55bc2f670e77 to your computer and use it in GitHub Desktop.

Select an option

Save mlabouardy/93456097b83b11eb223c55bc2f670e77 to your computer and use it in GitHub Desktop.
Allow inbound traffic on port 8080
resource "google_compute_firewall" "swarm" {
name = "swarm-firewall"
network = "${google_compute_network.swarm.name}"
allow {
protocol = "icmp"
}
allow {
protocol = "tcp"
ports = ["22", "2377", "7946", "8080"]
}
allow {
protocol = "udp"
ports = ["7946", "4789"]
}
source_ranges = ["0.0.0.0/0"]
}
resource "google_compute_network" "swarm" {
name = "swarm-network"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment