A security reviewer opens your Google Cloud architecture diagram and asks three questions. Can someone call the Cloud Run URL directly and skip Cloud Armor? How does a serverless service reach a database with only a private IP? What happens to an order event when the worker fails? If the diagram is a grid of product icons, none of the answers are on it.
A useful GCP architecture diagram shows where things live, how requests travel and the settings that decide security and capacity. This post walks through a typical Google Cloud web app, from the load balancer and Cloud Run to Cloud SQL and Pub/Sub, and the choices behind each part.
Start with the resource hierarchy
Google Cloud resources sit in a tree: an organization, optional folders and projects. IAM roles and organization policies set on a node apply to everything below it (resource hierarchy). Folders nest up to 10 levels deep and play the role of management groups in an Azure landing zone or organizational units in an AWS landing zone.
A common layout is one folder per environment and one project per application and environment, such as shop-prod under production. The project bounds billing, quotas and most IAM grants, and Cloud Run's internal ingress trusts Pub/Sub only from the same project or VPC Service Controls perimeter.
The example, request by request
The example is an online shop in project shop-prod: a three-tier architecture with serverless compute in us-central1.
- The domain points to the anycast IP of a global external Application Load Balancer, which terminates TLS with a Google-managed certificate, applies a Cloud Armor policy and serves cached responses from Cloud CDN.
- The URL map sends
/api/*to theapiservice and everything else toweb, each through a serverless network endpoint group (NEG). webkeeps sessions and a page cache in Memorystore for Valkey.apiuses Cloud SQL for PostgreSQL over a private IP.apipublishes order events to Pub/Sub, which pushes them toworker, a third Cloud Run service that writes invoice PDFs to Cloud Storage.- Credentials live in Secret Manager; logs and metrics go to Cloud Logging and Cloud Monitoring.
At the time of writing (November 2026), a Cloud Run instance takes 80 concurrent requests by default (80 per vCPU via gcloud or Terraform), and a revision scales to 100 instances.
Ingress and service accounts
Every Cloud Run service gets a run.app URL, and ingress defaults to all, so anyone with the URL can skip the load balancer and Cloud Armor. Set ingress on web and api to internal-and-cloud-load-balancing (ingress settings). Requests from the load balancer carry no Google identity, so these services must also be public; Google recommends disabling the Invoker IAM check over granting the invoker role to allUsers. The worker uses ingress internal, which still admits Pub/Sub from the same project, and keeps both the IAM check and its default URL, which Pub/Sub push calls.
By default, Cloud Run runs code as the Compute Engine default service account, which may hold Editor on the project, depending on organization policy. Give each service its own:
| Service account | Roles (resource) |
|---|---|
web-sa |
None; it reaches Memorystore over the VPC |
api-sa |
Pub/Sub Publisher (orders topic), Secret Manager Secret Accessor (its secrets) |
worker-sa |
Storage Object Creator (invoices bucket), Secret Manager Secret Accessor (its secrets) |
push-sa |
Cloud Run Invoker (worker), used by the push subscription |
Environment-variable secrets are read when an instance starts, so pin a version (db-password:3 below).
Serverless networking: Direct VPC egress or a connector
Cloud Run does not run inside your VPC, so to reach the private IPs of Cloud SQL or Memorystore, its outbound traffic must enter a subnet. Google recommends Direct VPC egress over a Serverless VPC Access connector; both are generally available.
| Direct VPC egress | VPC Access connector | |
|---|---|---|
| Cost | Network egress only | Egress plus connector VMs |
| Latency and throughput | Lower latency, higher throughput | Higher latency, lower throughput |
| IP addresses | About two per instance | Fewer |
The subnet must be /26 or larger, Cloud Run uses twice as many addresses as instances, and a revision that scales down keeps its addresses for up to 20 minutes. In a rollout, api capped at 40 instances can hold (40 + 40) × 2 = 160 addresses. At the default 100, one service needs 400, more than a /24's 252 usable, so add up every service on the subnet. New instances can also wait a minute or more before egress works, so add a startup probe that tests a real dependency.
gcloud run deploy api \
--image=us-central1-docker.pkg.dev/shop-prod/app/api:1.42 \
--region=us-central1 \
--service-account=api-sa@shop-prod.iam.gserviceaccount.com \
--ingress=internal-and-cloud-load-balancing \
--no-invoker-iam-check \
--network=shop-vpc --subnet=run-us-central1 \
--vpc-egress=private-ranges-only \
--max-instances=40 \
--set-secrets=DB_PASSWORD=db-password:3
Choosing the data store
SLAs below are monthly uptime in most regions:
| Service | Pick it when | SLA |
|---|---|---|
| Cloud SQL | Standard PostgreSQL, MySQL or SQL Server under 64 TB | With HA: 99.95%, or 99.99% on Enterprise Plus |
| AlloyDB | PostgreSQL with heavy load or analytics on live data | 99.99% with HA |
| Spanner | Relational data beyond one primary, or writes in several regions | 99.99% regional, 99.999% multi-region |
| Firestore | Documents for web and mobile clients with offline sync | 99.99% regional, 99.999% multi-region |
| Bigtable | Terabytes of single-keyed data at low latency | 99.9% to 99.999%, by replication |
Cloud SQL HA keeps a synchronously replicated standby in a second zone, and a failover takes about 60 seconds (high availability). With Cloud Run, watch connections: max_connections defaults to 500 at 15 to 30 GB of memory, and each Cloud Run instance may open up to 100. Cap api at 40 instances with a pool of 10 and it tops out at 400, leaving headroom.
Async work: Pub/Sub or Cloud Tasks
Pub/Sub push needs four details right:
- The worker acknowledges by returning 102, 200, 201, 202 or 204.
- The acknowledgment deadline (10 to 600 seconds, default 10) must exceed processing time, or Pub/Sub redelivers while the first attempt runs.
- A dead-letter topic takes a message after 5 delivery attempts by default; the Pub/Sub service agent needs permission to publish to it.
- Delivery is at least once, so make the worker idempotent; name each PDF after its order ID.
Choose Cloud Tasks when the sender should control delivery: scheduled tasks, rate limits of up to 500 dispatches per second per queue, and deduplication. Pub/Sub fits fan-out to several subscribers. The serverless architecture diagram covers more event patterns.
Regions and high availability
Zone failures are covered: Cloud Run spreads across zones, Memorystore replicas land in other zones and the Cloud SQL standby takes over. SLAs compound, though: 99.95% for Cloud Run times 99.95% for Cloud SQL HA is about 99.90%, or 43 minutes of downtime in a 30-day month (0.1% of 43,200 minutes).
For a region outage, deploy a second region and add its serverless NEG to each backend service. The load balancer then sends users to the closest region, and outlier detection moves traffic away from a failing one. Data is the hard part: a Cloud SQL cross-region replica you promote, or Spanner multi-region. Multi-region failover on AWS and the disaster recovery architecture diagram cover those trade-offs.
AWS to Google Cloud mapping
| AWS | Google Cloud |
|---|---|
| Organizations, OUs, accounts | Organization, folders, projects |
| ALB, CloudFront, AWS WAF | Global external Application Load Balancer, Cloud CDN, Cloud Armor |
| ECS on Fargate, Lambda | Cloud Run services, jobs, worker pools and functions |
| RDS, Aurora | Cloud SQL, AlloyDB |
| ElastiCache | Memorystore |
| SQS, SNS | Cloud Tasks, Pub/Sub |
| CloudWatch | Cloud Logging, Cloud Monitoring |
| VPC (regional) | VPC (global, with regional subnets) |
Mappings are approximate; Google's service comparison lists more. For the AWS side, see subnets and route tables in a VPC for networking and ECS on Fargate for containers.
The Google Cloud web app diagram
Diagram contents
- Project shop-prod (folder: production)
- us-central1
- Users
- Global external Application LB
- web frontend
- api
- worker
- Memorystore for Valkey
- Cloud SQL for PostgreSQL
- Cloud Storage
- Pub/Sub topic
- Secret Manager
- Cloud Logging and Monitoring
- HTTPS
- /*
- /api/*
- sessions, page cache
- SQL over private IP
- publish
- push
- invoice PDFs
How to read it:
- Frames show scope. The outer frame is project shop-prod in the production folder; the blue box is the us-central1 region. Global services sit outside the region.
- Blue edges are the request path: HTTPS to the load balancer, then
/*to the web frontend and/api/*to the api; the note lists Cloud Armor, Cloud CDN and the certificate. - Green edges are data access: Memorystore for sessions, the HA Cloud SQL instance over private IP, and Cloud Storage for invoice PDFs.
- Dashed purple edges are asynchronous. The api publishes, Pub/Sub pushes to the worker, and a dead-letter topic catches messages after five attempts.
- Secret Manager and logging carry notes instead of edges, and the Markdown block lists the key settings.
Drawing Google Cloud architecture diagrams clearly
- Nest the hierarchy: a project frame with its folder in the label, the region inside, global services outside the region. Do not draw Cloud Run inside a subnet; it sends egress there but does not live there.
- Name the product in each label. A box called database invites a question; Cloud SQL for PostgreSQL with HA answers it.
- Put security settings on the page: ingress, private IPs and service accounts.
- Label edges with routes and data, and dash the asynchronous ones.
- Leave out build tooling, per-zone copies of regional services and IAM bindings; keep roles in a table.
Build it in Archboard
- Sign in with Google or GitHub and create a diagram.
- Add a Frame from the Core pack labeled Project shop-prod (folder: production), and inside it a Region from the Cloud pack labeled us-central1.
- Put a Person from the C4 Model pack left of the frame for users. Inside the frame, left of the region, add a Cloud LB from the Cloud pack and a Core Text note for Cloud Armor, Cloud CDN and the certificate.
- In the region, add three Cloud resource nodes from the Cloud pack named web frontend, api and worker, and set their resource type to Cloud Run service.
- Beside them, add a Redis node from the Data pack for Memorystore, then Managed DB and Object Storage from the Cloud pack for Cloud SQL and Cloud Storage.
- Outside the region, add a Topic from the Data pack for Pub/Sub, a Vault from the Security pack for Secret Manager and a Logs node from the DevOps pack, with Core Text notes.
- Draw labeled edges: HTTPS, /, /api/, sessions and page cache, SQL over private IP and invoice PDFs. Make publish and push dashed.
- Add a Markdown block from the Core pack with the key settings.
Archboard does not import from a live Google Cloud account; if the project is in Terraform, the free Terraform to diagram tool gives you an editable first draft. See cloud architecture diagrams for the cloud node types. The example uses 14 diagram nodes, within the Free plan.
FAQ
What should a Google Cloud architecture diagram show? The project and folder, the region, every component on the request path, and the settings that decide security: ingress, private IPs and service accounts. Global services such as Pub/Sub go outside the region box.
Does Cloud Run run inside a VPC? No. It runs on Google-managed infrastructure; Direct VPC egress or a connector sends its outbound traffic into your subnet so it can reach private IPs.
Should I use Direct VPC egress or a Serverless VPC Access connector? Direct VPC egress for most services: Google recommends it, latency is lower and you pay only for egress. A connector uses fewer IP addresses and gives faster cold starts behind Cloud NAT.
How do I stop users from bypassing Cloud Armor? Set Cloud Run ingress to internal-and-cloud-load-balancing so internet traffic must pass the external Application Load Balancer, and disable the default run.app URL where no Google service needs it.
How many connections can Cloud Run open to Cloud SQL? Up to 100 per instance. Keep maximum instances times pool size below max_connections (500 by default at 15 to 30 GB of memory), or use Managed Connection Pooling on Enterprise Plus.