GCP Associate Cloud Engineer Practice Question 47: IAP Tunnel SSH No External IP
Google Cloud Associate Cloud Engineer · Test 5 · question 7 of 10
Administrators need SSH access to VMs that have no external IP addresses. The security team does not want to run and patch a bastion host, and does not want to open port 22 to the internet.
What should you do?
Show answer and explanation
Answer:
Identity-Aware Proxy (IAP) TCP forwarding tunnels SSH to VMs that have only internal addresses. You allow ingress from IAP's range, 35.235.240.0/20, on port 22, grant roles/iap.tunnelResourceAccessor to the administrators, and run gcloud compute ssh VM --tunnel-through-iap. Access is controlled by IAM and there is no bastion or public IP.
Option A exposes each VM directly to the internet. Option C is the bastion that the team wants to avoid maintaining. Option D is wrong because Private Google Access only lets VMs call Google APIs; it does not provide inbound SSH.
Reference: Using IAP for TCP forwarding