Deploy a Bastion Host via IAP and OS Login
mainThis module provisions a Google Compute Engine (GCE) bastion host designed for secure access to internal VMs using IAP Tunneling and OS Login.
It automates the following:
- Creation of a dedicated service account for the bastion.
- Provisioning of a GCE instance.
- Creation of a firewall rule to allow TCP:22 SSH access from IAP ranges.
- IAM bindings for IAP and OS Login for specified members.
module "iap_bastion" {
source = "terraform-google-modules/bastion-host/google"
project = var.project
zone = var.zone
network = google_compute_network.net.self_link
subnet = google_compute_subnetwork.net.self_link
members = [
"group:devs@example.com",
"user:me@example.com",
]
}