How do I easily enable Private Google Access for all subnets in a GCP VPC?
The instructions for enabling Private Google Access for a single subnet can be found in: https://cloud.google.com/vpc/docs/configure-private-google-access#config-pga
How do I easily enable Private Google Access for all subnets in a GCP VPC?
The instructions for enabling Private Google Access for a single subnet can be found in: https://cloud.google.com/vpc/docs/configure-private-google-access#config-pga
Use bash to list all subnets then pipe them into the update command:
gcloud compute networks subnets list --filter=<your_vpc> --format="get(REGION)" | awk -F/ '{print $NF}' | xargs -I {} gcloud compute networks subnets update <your_vpc> --region={} --enable-private-ip-google-access