surshar / claude-code
Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.
Built by Anthropic · github.com/anthropics
Gateway GCP example: Agent Platform rebrand and README cleanup
| Mexamples/gateway/gcp/README.md |
| Mexamples/gateway/gcp/gateway.yaml.example |
| Mexamples/gateway/gcp/setup.sh |
| Mexamples/gateway/gcp/terraform/main.tf |
| Mexamples/gateway/gcp/terraform/variables.tf |
| @@ -1,18 +1,17 @@ | ||
| 1 | 1 | # Claude Gateway on Google Cloud |
| 2 | 2 | |
| 3 | -Reference deployment artifacts for running Claude Gateway on GCP with Vertex AI | |
| 4 | -as the upstream: Cloud Run or GKE, Cloud SQL for PostgreSQL, Secret Manager, and | |
| 5 | -service-account auth to Vertex AI. | |
| 3 | +Reference deployment artifacts for running Claude Gateway on GCP with Agent | |
| 4 | +Platform (formerly Vertex AI) as the upstream: Cloud Run or GKE, Cloud SQL for | |
| 5 | +PostgreSQL, Secret Manager, and service-account auth to Agent Platform. | |
| 6 | 6 | |
| 7 | 7 | These files are provided as a working example rather than a supported production |
| 8 | 8 | deployment. Adapt them to your own environment. |
| 9 | 9 | |
| 10 | 10 | - **Walkthrough**: https://code.claude.com/docs/en/claude-apps-gateway-on-gcp |
| 11 | -- **Public mirror**: https://github.com/anthropics/claude-code/tree/main/examples/gateway/gcp | |
| 12 | 11 | |
| 13 | 12 | | File | Purpose | |
| 14 | 13 | |---|---| |
| 15 | 14 | | `setup.sh` | Scripts the walkthrough end to end via `gcloud` | |
| 16 | 15 | | `Dockerfile` | Runtime image for the `claude gateway` binary | |
| 17 | -| `gateway.yaml.example` | Gateway config template, GCP-shaped (Vertex upstream, Google Workspace IdP) | | |
| 16 | +| `gateway.yaml.example` | Gateway config template, GCP-shaped (Agent Platform upstream, Google Workspace IdP) | | |
| 18 | 17 | | `terraform/` | Provisions the full architecture (two-pass apply — see `terraform/README.md`) | |
| @@ -1,7 +1,8 @@ | ||
| 1 | 1 | # gateway.yaml.example — Claude Gateway config template, GCP-shaped (walkthrough §6). |
| 2 | 2 | # |
| 3 | -# Google Workspace IdP + Vertex upstream, following the walkthrough at | |
| 4 | -# https://code.claude.com/docs/en/claude-apps-gateway-on-gcp. The active sections | |
| 3 | +# Google Workspace IdP + Agent Platform (formerly Vertex AI) upstream, following | |
| 4 | +# the walkthrough at https://code.claude.com/docs/en/claude-apps-gateway-on-gcp. | |
| 5 | +# The active sections | |
| 5 | 6 | # below are a strict subset of the full configuration reference at |
| 6 | 7 | # https://code.claude.com/docs/en/claude-apps-gateway; optional keys are included |
| 7 | 8 | # commented-out. |
| @@ -88,11 +89,11 @@ | ||
| 88 | 89 | store: |
| 89 | 90 | postgres_url: ${GATEWAY_POSTGRES_URL} # private-IP Cloud SQL; built with ?sslmode=require by setup.sh |
| 90 | 91 | |
| 91 | -# ── Upstreams — Vertex AI ──────────────────────────────────────────────────── | |
| 92 | +# ── Upstreams — Agent Platform ─────────────────────────────────────────────── | |
| 92 | 93 | upstreams: |
| 93 | 94 | - provider: vertex |
| 94 | 95 | region: us-east5 # a region where the Claude models you need are published in Model Garden |
| 95 | - project_id: REPLACE_ME # your GCP project ID for Vertex access | |
| 96 | + project_id: REPLACE_ME # your GCP project ID for Agent Platform access | |
| 96 | 97 | auth: {} # ADC via Cloud Run SA / GKE Workload Identity (preferred — no static keys) |
| 97 | 98 | # base_url: https://us-east5-aiplatform.p.googleapis.com # Private Service Connect endpoint |
| 98 | 99 | # Add more upstreams for failover (tried top→bottom on 5xx/timeout/501): a |
| @@ -29,7 +29,7 @@ | ||
| 29 | 29 | |
| 30 | 30 | # ---- configuration (env-overridable) ---------------------------------------- |
| 31 | 31 | PROJECT_ID="${PROJECT_ID:-$(gcloud config get-value project 2>/dev/null)}" |
| 32 | -REGION="${REGION:-${CLOUDSDK_COMPUTE_REGION:-us-east5}}" # guide §1 uses us-east5 (Vertex model region) | |
| 32 | +REGION="${REGION:-${CLOUDSDK_COMPUTE_REGION:-us-east5}}" # guide §1 uses us-east5 (Agent Platform model region) | |
| 33 | 33 | |
| 34 | 34 | SA_NAME="${SA_NAME:-claude-gateway}" # §2 service account |
| 35 | 35 | SA_EMAIL="${SA_NAME}@${PROJECT_ID}.iam.gserviceaccount.com" |
| @@ -157,7 +157,7 @@ | ||
| 157 | 157 | # and GKE. |
| 158 | 158 | gcloud projects add-iam-policy-binding "${PROJECT_ID}" \ |
| 159 | 159 | --member="serviceAccount:${SA_EMAIL}" \ |
| 160 | - --role="roles/aiplatform.user" --condition=None >/dev/null # Vertex inference (§2) | |
| 160 | + --role="roles/aiplatform.user" --condition=None >/dev/null # Agent Platform inference (§2) | |
| 161 | 161 | |
| 162 | 162 | # ---- 3 Build & push image to Artifact Registry ---------------------------- |
| 163 | 163 | log "Ensuring Artifact Registry repo and image (§3)" |
| @@ -390,7 +390,7 @@ | ||
| 390 | 390 | # Direct VPC egress (--network/--subnet/--vpc-egress) puts the service on the |
| 391 | 391 | # VPC so it reaches the Cloud SQL PRIVATE IP directly — matching the private-IP |
| 392 | 392 | # connection string in the postgres-url secret. private-ranges-only keeps public |
| 393 | -# egress (Vertex, accounts.google.com) off the VPC, so no Cloud NAT is needed. | |
| 393 | +# egress (Agent Platform, accounts.google.com) off the VPC, so no Cloud NAT is needed. | |
| 394 | 394 | # We deliberately do NOT use --add-cloudsql-instances (that's the Auth Proxy / |
| 395 | 395 | # socket path, which would need a different connection string). |
| 396 | 396 | # |
| @@ -50,7 +50,7 @@ | ||
| 50 | 50 | # Run and GKE. |
| 51 | 51 | resource "google_project_iam_member" "vertex" { |
| 52 | 52 | project = var.project_id |
| 53 | - role = "roles/aiplatform.user" # Vertex inference | |
| 53 | + role = "roles/aiplatform.user" # Agent Platform inference | |
| 54 | 54 | member = "serviceAccount:${google_service_account.gateway.email}" |
| 55 | 55 | } |
| 56 | 56 | |
| @@ -310,7 +310,7 @@ | ||
| 310 | 310 | network = google_compute_network.vpc.id |
| 311 | 311 | subnetwork = google_compute_subnetwork.subnet.id |
| 312 | 312 | } |
| 313 | - egress = "PRIVATE_RANGES_ONLY" # public egress (Vertex, accounts.google.com) bypasses the VPC -> no Cloud NAT needed | |
| 313 | + egress = "PRIVATE_RANGES_ONLY" # public egress (Agent Platform, accounts.google.com) bypasses the VPC -> no Cloud NAT needed | |
| 314 | 314 | } |
| 315 | 315 | |
| 316 | 316 | containers { |
| @@ -6,7 +6,7 @@ | ||
| 6 | 6 | } |
| 7 | 7 | |
| 8 | 8 | variable "region" { |
| 9 | - description = "Infra region for Artifact Registry, Cloud SQL, subnet, and Cloud Run. (Vertex region is set separately inside gateway.yaml.)" | |
| 9 | + description = "Infra region for Artifact Registry, Cloud SQL, subnet, and Cloud Run. (Agent Platform region is set separately inside gateway.yaml.)" | |
| 10 | 10 | type = string |
| 11 | 11 | default = "us-east5" |
| 12 | 12 | } |