Intent: Move from generic boxes to actual packet paths, IP ownership, subnet allocations, tenant boundaries, and enterprise control points.
Cloud Run services and jobs Shared VPC IPv4 examples
Treat every architecture as a packet walk plus two independent decisions: who can enter, and where outbound packets go.
run.app URL, external Application Load Balancer, internal Application Load Balancer, Private Service Connect (PSC), or a supported service-mesh route.[3]roles/run.invoker is an authorization role; a Google-signed OIDC ID token is a credential; Identity-Aware Proxy (IAP) is an optional user-facing authentication layer in front of a load balancer.[5][4]The terms sound similar, but each belongs to a different part of the packet path.
| Ingress to Cloud Run | Egress from Cloud Run | Google Private Access | Enterprise Controls |
|---|---|---|---|
run.app URL: The default service endpoint. Cloud Run ingress settings determine which network origins can reach it, while IAM can require an authenticated invoker.[3][5] |
Direct VPC egress: Revision instances receive ephemeral addresses from a selected subnet; no connector fleet is in the data path.[1] | PSA: A private services access connection uses VPC Network Peering to a Google producer VPC; Cloud SQL private IP is a common example.[9] | Cloud Run IAM: Authorize callers with roles/run.invoker and a Google-signed ID token whose audience matches the receiving service URL or configured custom audience.[5] |
| External Application Load Balancer + serverless NEG: Public Layer 7 entry with custom domains, managed TLS, Cloud Armor, and optional Cloud CDN. Restrict Cloud Run ingress to prevent clients from bypassing the load balancer via the default URL.[4] | Serverless VPC Access connector: A managed connector fleet used when Direct VPC egress is unsuitable or a connector-specific behavior is required. Direct VPC egress is the recommended default for most new designs.[2] | PGA: A subnet setting, plus compatible DNS, routes, and firewall rules, that lets resources without external IP addresses reach supported Google APIs and services.[8] | IAP / Cloud Armor: IAP can authenticate users at the load-balancer edge; Cloud Armor supplies WAF and edge protection. IAP and Cloud CDN cannot be enabled on the same backend service.[4] |
| Internal Application Load Balancer + serverless NEG: Private Layer 7 entry for VPC and hybrid clients. Serverless NEG backends do not support load-balancer health checks; optional outlier detection is a different mechanism.[4] | Default egress: Internet-bound traffic that is not routed through a VPC uses Google-managed dynamic source addresses; those addresses are not intended for allowlisting.[7] | PSC: A consumer endpoint or published-service pattern for private access across projects, VPCs, organizations, or hybrid networks. Publishing Cloud Run through PSC normally places an internal Application Load Balancer in front of the serverless NEG.[3] | Cloud NAT / explicit proxy: Cloud NAT supplies source NAT and stable external addresses. A proxy, secure web gateway, or network virtual appliance is required when content inspection, DLP, URL policy, or application-aware filtering is needed.[7] |
With Direct VPC egress, Cloud Run allocates ephemeral IPv4 addresses from the selected VPC subnet. Capacity planning therefore affects scaling and deployment headroom.[1]
/28) to accelerate scale-out./26 or larger.+--------------------------------------------------------------+ | HOST PROJECT: TENANT A SUBNET 10.42.16.0/22 | | | | Old revision: addresses retained while instances drain | | New revision: /28 address blocks acquired during scale-out | | | | Firewall policy targets subnet range / supported tags, | | not a specific ephemeral Cloud Run instance address. | +--------------------------------------------------------------+
Operational caveats: Direct VPC egress has regional quotas and documented connection/startup limitations. VPC Flow Logs do not identify the Cloud Run revision by name, and Firewall Rules Logging and Packet Mirroring are not supported for this traffic. Cloud NAT with Direct VPC egress can also add cold-start connection delay, so load-test the exact design.[1]
Service projects own Cloud Run resources; the host project owns the Shared VPC, subnets, routes, and firewall policy.[6]
service-SERVICE_PROJECT_NUMBER@serverless-robot-prod.iam.gserviceaccount.comroles/compute.networkViewer on the host project and roles/compute.networkUser on the selected subnet.[6]
========================== SHARED VPC ========================== | | | Tenant A subnet 10.42.16.0/22 | | ^ subnet-scoped Network User | | | Cloud Run service agent for Tenant A service project | | | | -------- deny cross-tenant traffic by firewall policy -------| | | | Tenant B subnet 10.42.20.0/22 | | ^ subnet-scoped Network User | | | Cloud Run service agent for Tenant B service project | | | =================================================================
When a SaaS provider or security program needs a stable source address, route all Cloud Run egress through the VPC and configure Cloud NAT with a reserved external IP address.[7]
all-traffic. With private-ranges-only, public internet destinations do not traverse the VPC and therefore do not use its NAT or proxy path.[16][7]
+-------------------------+
| CLOUD RUN SERVICE |
| Egress: all-traffic |
+------------+------------+
| ephemeral source from tenant subnet
v
+-------------------------+
| VPC SUBNET / ROUTING |
+------------+------------+
|
+-----+-----------------------------+
| |
v v
Default internet route Route / proxy policy
+ Cloud NAT SNAT to explicit proxy or SWG
| |
v v
SaaS sees reserved DLP, URL filtering,
NAT IP: 198.51.100.25 TLS inspection if designed
PSA, PGA, and PSC are not interchangeable. They solve different private-connectivity problems after Cloud Run has entered the VPC.
private.googleapis.com or restricted.googleapis.com VIPs.[8]+-----------------------+
| CLOUD RUN SERVICE |
+-----------+-----------+
| Direct VPC egress into 10.42.16.0/22
v
+-----------+-----------------------------------------------+
| SHARED VPC |
| |
| PSA peering ------------------> Cloud SQL 10.91.0.3:5432 |
| PGA DNS/VIP ------------------> supported Google APIs |
| PSC endpoint/service path ----> privately exposed service|
+-----------------------------------------------------------+
VPC Service Controls adds a service perimeter around supported Google Cloud services to reduce data-exfiltration risk. For Cloud Run, both the default run.app URL and custom domains are subject to perimeter enforcement.[11]
*.googleapis.com and *.run.app to use restricted.googleapis.com where required.199.36.153.4/30 with a firewall rule that has higher precedence than the deny-all egress rule. In Google Cloud, a smaller numeric priority has higher precedence; the documented deny rule uses a priority numerically greater than 1000.==================== VPC-SC SERVICE PERIMETER ==================== | | | Admin / CI outside perimeter | | | approved perimeter ingress policy | | v | | Cloud Run service: internal ingress | | | all egress through tenant subnet with PGA | | +--> allow 199.36.153.4/30 tcp:443 (higher precedence) | | +--> deny other egress (lower precedence) | | | ====================================================================
Direct VPC egress does not create an inbound private IP for a Cloud Run service. On-premises clients need a supported private ingress path such as an internal Application Load Balancer, a PSC endpoint with private DNS, or a Cloud Run service published through PSC.[1][3]
+------------------------+ Cloud VPN / Interconnect +----------------------------------+
| ON-PREMISES |-------------------------------------->| GOOGLE CLOUD VPC |
| Client 172.20.14.12 | | |
| DNS: orders.int... | | Internal Application LB |
+------------------------+ | VIP 10.42.8.20 |
| | |
| v |
| Serverless NEG |
| | |
| v |
| Cloud Run orders-api |
| Ingress: internal + LB |
+----------------------------------+
0.0.0.0 for the remote IP; retain load-balancer and network logs when client attribution matters.[4][3]
Choose the simplest pattern that satisfies identity, naming, routing, observability, and policy requirements.
roles/run.invoker on the target and sends a Google-signed ID token. The token audience is normally the receiving service's run.app URL or a configured custom audience. A custom domain is not automatically a valid audience.[5]Status: Cloud Service Mesh integration for Cloud Run is a Pre-GA Preview feature as of the documentation reviewed for this deck. Treat support boundaries and architecture as subject to change.[12]
+------------------------------------------------------------+
| CLOUD SERVICE MESH CONTROL PLANE |
| Routing policy | traffic splitting | telemetry | security |
+-----------------------------+------------------------------+
| managed configuration
+----------------+----------------+
| |
v v
+----------------------------+ +----------------------------+
| Cloud Run caller | | Cloud Run target |
| managed data plane as |----->| or supported GKE service |
| documented for the pattern | | IAM remains authoritative |
+----------------------------+ +----------------------------+
| Anti-Pattern | The Safer Design Move |
|---|---|
| Direct VPC diagram shows a connector in the data path | Show the selected subnet directly attached to the Cloud Run revision. Put connectors on a compatibility or alternatives slide.[1][2] |
| Internal ingress is drawn through the egress attachment | Use an internal Application Load Balancer, PSC endpoint, or published PSC service for private inbound access.[3] |
| Cloud NAT is drawn as a routed inspection appliance | Represent Cloud NAT as source NAT on the internet egress path. Add an explicit proxy, SWG, or NVA for inspection and DLP.[7] |
| Serverless NEG has a conventional health check | State that serverless NEG backends do not support health checks; use supported outlier detection only where appropriate.[4] |
| PSA is treated as authentication | Explain the producer VPC, allocated range, peering route, database port, Cloud SQL connector choice, IAM, and database authentication separately.[9][10] |
| Whole-VPC Network User grants for every tenant | Delegate the Cloud Run service agent to a dedicated subnet and enforce cross-tenant boundaries with firewall policy and routes.[6] |
| Cloud Service Mesh integration is presented as generally available and symmetric | Label it Preview and document the exact Cloud Run-to-Cloud Run, Cloud Run-to-GKE, or GKE-to-Cloud Run support conditions.[12][13][14] |
Every flow has a caller, route, source identity, source IP at each hop, target, and control point. Proxies and NAT can change the address observed downstream.
203.0.113.10 → edge/CDN → external Application Load Balancer → serverless NEG → Cloud Run. Validate forwarded-client headers only from trusted proxies, and restrict Cloud Run ingress to prevent direct endpoint bypass.[4]172.20.14.12 → Cloud VPN/Interconnect → internal Application Load Balancer 10.42.8.20 → serverless NEG → Cloud Run.[3]10.42.16.0/22 → Shared VPC → PSA peering → Cloud SQL private IP 10.91.0.3:5432. Network reachability does not replace Cloud SQL or database authentication.[9][10]10.42.16.0/22 → VPC default internet route with Cloud NAT → SaaS sees reserved test address 198.51.100.25. Insert an explicit proxy or SWG before the internet when inspection is required.[7]Official Google Cloud documentation, accessed 24 July 2026.
all-traffic versus private-ranges-only egress behavior.