Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Cloud IAP Terraform firewall rule for GKE
resource "google_compute_firewall" "allow_nodes_from_cloud_iap" {
name = "allow-gke-nodes-ssh-from-cloud-iap"
description = "Allow Cloud IAP to communicate with the the GKE nodes."
network = var.network
allow {
protocol = "tcp"
ports = ["22"]
}
# https://cloud.google.com/iap/docs/using-tcp-forwarding#create-firewall-rule
source_ranges = ["35.235.240.0/20"]
target_tags = ["k8s-node"]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.