tl  tr
  Home | Tutorials | Articles | Videos | Products | Tools | Search
Interviews | Open Source | Tag Cloud | Follow Us | Bookmark | Contact   
 Generative AI > Google Gemini API > ADK with VPC and Private Endpoints

ADK with VPC and Private Endpoints

Author: Venkata Sudhakar

Running ADK agents inside a Virtual Private Cloud (VPC) eliminates public internet exposure for internal business workloads. ShopMax India processes payroll and inventory reconciliation using agents that must only reach internal databases and never be accessible from the public internet. VPC-confined agents communicate with Cloud Run, BigQuery, and Pub/Sub through Private Service Connect (PSC) endpoints.

The deployment uses Cloud Run with ingress set to internal-only, a Serverless VPC Access connector to route outbound traffic through the VPC, and Private Service Connect endpoints for Google APIs. No public IP is assigned to the Cloud Run service � all traffic flows within the private network boundary.

The below example shows the deployment configuration and a minimal ADK agent designed for internal VPC operation with private BigQuery access.


It gives the following output,

Created connector [shopmax-connector] in [asia-south1].

Deploying container to Cloud Run service [shopmax-internal-agent]...
Service [shopmax-internal-agent] deployed.
URL: https://shopmax-internal-agent-xxxx-el.a.run.app  (internal only)

Created [google-apis-psc] address: 10.10.0.5
Created forwarding rule [google-apis-psc-rule].

It gives the following output,

Based on current warehouse data, 4 items need restocking this week:
  SKU-1042  Samsung TV 55"    � 12 units remaining
  SKU-2218  Laptop Charger    � 23 units remaining
  SKU-3301  USB-C Hub 7-port  �  8 units remaining
  SKU-4105  HDMI Cable 2m     � 41 units remaining
Recommend raising purchase orders for SKU-1042 and SKU-3301 immediately.

After deployment, verify there is no public reachability by running a curl from outside the VPC � you should receive a 403 or connection refused. Enable VPC Flow Logs on the shopmax-private-subnet to audit all traffic to and from the agent, and use Cloud Armor security policies on the internal load balancer for an additional layer of request filtering.


 
  


  
bl  br