For testing purposes I want to make the GKE API endpoint publicly available.
However, I can't seem to be able to create a firewall rule to allow this.
I receive the error "source_ranges": conflicts with destination_ranges
with the following terraform code to create it.
Any idea why I can't allow internet traffic but filter on destination IP? Thanks.
resource "google_compute_firewall" "gke_api_allow" {
name = "gke-${var.cluster_name}-allow-firewall"
project = var.project_id
network = google_compute_network.gke_cluster_vpc.name
description = "Main firewall that allows traffic to GKE cluster API public endpoint."
priority = 9
direction = "INGRESS"
allow {
ports = [443]
protocol = "tcp"
}
destination_ranges = ["${google_container_cluster.gke_cluster.endpoint}/32"]
source_ranges = ["0.0.0.0/0"]
log_config {
metadata = "INCLUDE_ALL_METADATA"
}
}