Skip to content

Instantly share code, notes, and snippets.

@calum-github
Created May 20, 2021 05:29
Show Gist options
  • Save calum-github/92e0bfbadb0e8e58cbc20a20c808940b to your computer and use it in GitHub Desktop.
Save calum-github/92e0bfbadb0e8e58cbc20a20c808940b 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-access-from-iap"
project = var.project_id
network = "default"
direction = "INGRESS"
allow {
protocol = "tcp"
ports = ["22", "3389", "5901"]
}
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