A cloud engineer needs to enable Private Google Access on an existing subnetwork named `app-backend-subnet` located in the `us-east4` region. This is required so that Compute Engine instances without external IP addresses residing in this subnet can access Google Cloud APIs and services. Which `gcloud` command should the engineer run to modify the subnetwork settings correctly?
- gcloud compute networks subnets update app-backend-subnet --region=us-east4 --enable-private-ip-google-accessAnswer
- Bgcloud compute networks update app-backend-subnet --enable-private-ip-google-access
- Cgcloud compute instances update --all --region=us-east4 --enable-private-google-access
- Dgcloud compute firewall-rules create allow-google-apis --direction=EGRESS --action=ALLOW --rules=all --destination-ranges=0.0.0.0/0
Answer
The command 'gcloud compute networks subnets update app-backend-subnet --region=us-east4 --enable-private-ip-google-access' correctly enables Private Google Access for instances in the specified subnetwork.
Private Google Access allows Compute Engine VMs with internal IP addresses only to reach Google APIs and services. It is enabled on a per-subnet basis using 'gcloud compute networks subnets update <SUBNET_NAME> --region=<REGION> --enable-private-ip-google-access'.
Step-by-Step Solution
Key Concept
Subnet-level configuration for Private Google Access
Estimated Time:1m 30s