Last active
October 22, 2020 14:52
-
-
Save magickatt/ec214a6a1ae5ba4d59d8c0ee30167f60 to your computer and use it in GitHub Desktop.
Cloud IAP Terraform firewall rule for GKE
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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