/*
 * Terraform security (firewall) resources for GCP.
 */

# Allow traffic from the VPN subnets.
resource "google_compute_firewall" "gcp-allow-vpn" {
  name    = "${data.google_compute_network.main.name}-gcp-allow-vpn"
  network = data.google_compute_network.main.name

  allow {
    protocol = "tcp"
    ports    = ["0-65535"]
  }

  allow {
    protocol = "udp"
    ports    = ["0-65535"]
  }

  allow {
    protocol = "icmp"
  }

  source_ranges = [
    data.aws_vpc.main.cidr_block,
  ]
}

