Skip to content

Instantly share code, notes, and snippets.

@calum-github
Created May 20, 2021 04:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save calum-github/30260bdcd43f3bc1d64c59c882e1646f to your computer and use it in GitHub Desktop.
Save calum-github/30260bdcd43f3bc1d64c59c882e1646f to your computer and use it in GitHub Desktop.
## Allow incoming access to our instance via
## port 22, from the IAP servers
resource "google_compute_firewall" "inbound-ip-ssh" {
name = "allow-incoming-ssh-from-iap"
project = var.project_id
network = "default"
direction = "INGRESS"
allow {
protocol = "tcp"
ports = ["22"]
}
source_ranges = [
"35.235.240.0/20"
]
target_service_accounts = ["<project-id>-compute@developer.gserviceaccount.com"]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment