adk-deploy-guide
Deployment infrastructure guide for ADK agents, prioritizing Terraform-based production setups.
Install
mkdir -p .claude/skills/adk-deploy-guide && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/19142" && unzip -o skill.zip -d .claude/skills/adk-deploy-guide && rm skill.zipInstalls to .claude/skills/adk-deploy-guide
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
MUST READ before deploying any ADK agent to Google Cloud — covers Cloud Run, Agent Engine, Vertex AI, event-driven agents, and ADK CI/CD pipelines. Use when deploying ADK agents to production, not for agent code patterns (use google-adk) or project scaffolding.Key capabilities
- →Deploy ADK agents to Google Cloud Run
- →Deploy ADK agents to Google Agent Engine
- →Configure secrets using Google Secret Manager
- →Set up CI/CD pipelines for ADK agents
- →Scaffold Terraform for GCP infrastructure
- →Verify deployment health check endpoints
How it works
The skill guides through deploying ADK agents to Google Cloud, either via Cloud Run or Agent Engine, by using Terraform for infrastructure, Secret Manager for credentials, and setting up CI/CD pipelines.
Inputs & outputs
When to use adk-deploy-guide
- →Deploying ADK agents
- →Planning GCP infrastructure
- →Configuring CI/CD pipelines
About this skill
ADK Deployment Guide
Scaffolded project? Use
makecommands — they wrap Terraform, Docker, and deployment.No scaffold? See Quick Deploy below. For production infrastructure, see the
/scaffold-adkcommand or load thearchitecture-designskill for infrastructure planning.
Iron Law
NEVER create GCP resources manually via gcloud for production. Define all infrastructure in Terraform.
Exception: quick experimentation only — console or gcloud for throwaway resources is fine.
Reference Files
| File | Contents |
|---|---|
reference/agent-engine.md | AdkApp pattern, deploy.py CLI, session/artifact services, CI/CD differences |
reference/cloud-run.md | Dockerfile, session types, scaling defaults, networking, ingress, IAP |
reference/event-driven.md | Pub/Sub, Eventarc, BigQuery Remote Function trigger patterns |
reference/terraform-patterns.md | Custom resources, IAM bindings, state management, importing resources |
For agent code patterns and testing strategies, see google-adk skill. For evaluations and observability, see adk-eval-guide and adk-observability-guide skills.
Deployment Target Decision Matrix
| Criteria | Agent Engine | Cloud Run |
|---|---|---|
| Deployment | Source-based, no Docker | Dockerfile + container image |
| Scaling | Managed auto-scaling | Fully configurable (min/max instances) |
| Session state | Native VertexAiSessionService | In-memory (dev), Cloud SQL, or Agent Engine backend |
| Event-driven | Not supported | Pub/Sub, Eventarc, BigQuery Remote Function via /invoke |
| Cost model | vCPU-hours + memory-hours (not billed when idle) | Per-instance-second + min instance costs |
| Setup complexity | Lower — managed, purpose-built for agents | Medium — Dockerfile, Terraform, networking |
| Best for | Minimal ops, managed infrastructure | Event-driven workloads, full infrastructure control |
Ask the user which target fits their needs before proceeding.
Quick Deploy (ADK CLI)
No Makefile, Terraform, or Dockerfile required.
# Cloud Run
adk deploy cloud_run --project=PROJECT --region=REGION path/to/agent/
# Agent Engine
adk deploy agent_engine --project=PROJECT --region=REGION path/to/agent/
Both support --with_ui to deploy the ADK dev UI. Cloud Run accepts extra gcloud flags after --.
Process
- Gather requirements — target (Agent Engine vs Cloud Run), project ID, region, secrets needed
- Choose target — use the decision matrix above; ask if unclear
- Scaffold or write Terraform — run
/scaffold-adkor manually writedeployment/terraform/ - Configure secrets — use Secret Manager, not env vars, for API keys and credentials
- Deploy —
make deploy(scaffolded) oradk deploy <target>(CLI) - Verify — health check endpoint, test with curl or testing notebook, run load tests
Secret Manager
# Create
echo -n "YOUR_API_KEY" | gcloud secrets create MY_SECRET_NAME --data-file=-
# Update
echo -n "NEW_KEY" | gcloud secrets versions add MY_SECRET_NAME --data-file=-
# Agent Engine: pass at deploy time
make deploy SECRETS="API_KEY=my-api-key,DB_PASS=db-password:2"
Grant secretmanager.secretAccessor to app_sa (Cloud Run) or service-PROJECT_NUMBER@gcp-sa-aiplatform-re.iam.gserviceaccount.com (Agent Engine).
Documentation Sources
| Source | URL | Purpose |
|---|---|---|
| ADK Deployment | https://google.github.io/adk-docs/deploy/ | Official deployment docs |
| Cloud Run | https://google.github.io/adk-docs/deploy/cloud-run/index.md | Cloud Run specifics |
| Agent Engine | https://google.github.io/adk-docs/deploy/agent-engine/index.md | Agent Engine specifics |
Production Deployment — CI/CD Pipeline
Best for: Production applications, teams requiring staging → production promotion.
Prerequisites:
- Project must NOT be in a gitignored folder
- User must provide staging and production GCP project IDs
- GitHub repository name and owner
Steps:
-
If prototype, first add Terraform/CI-CD files using the Agent Starter Pack CLI:
uvx agent-starter-pack enhance . --cicd-runner github_actions -y -s -
Ensure you're logged in to GitHub CLI:
gh auth login # (skip if already authenticated) -
Run setup-cicd:
uvx agent-starter-pack setup-cicd \ --staging-project YOUR_STAGING_PROJECT \ --prod-project YOUR_PROD_PROJECT \ --repository-name YOUR_REPO_NAME \ --repository-owner YOUR_GITHUB_USERNAME \ --auto-approve \ --create-repository -
Push code to trigger deployments
Key setup-cicd Flags
| Flag | Description |
|---|---|
--staging-project | GCP project ID for staging environment |
--prod-project | GCP project ID for production environment |
--repository-name / --repository-owner | GitHub repository name and owner |
--auto-approve | Skip Terraform plan confirmation prompts |
--create-repository | Create the GitHub repo if it doesn't exist |
--cicd-project | Separate GCP project for CI/CD infrastructure. Defaults to prod project |
--local-state | Store Terraform state locally instead of in GCS |
Choosing a CI/CD Runner
| Runner | Pros | Cons |
|---|---|---|
| github_actions (Default) | No PAT needed, uses gh auth, WIF-based, fully automated | Requires GitHub CLI authentication |
| google_cloud_build | Native GCP integration | Requires interactive browser authorization (or PAT + app installation ID for programmatic mode) |
How Authentication Works (WIF)
Both runners use Workload Identity Federation (WIF) — GitHub/Cloud Build OIDC tokens are trusted by a GCP Workload Identity Pool, which grants cicd_runner_sa impersonation. No long-lived service account keys needed. Terraform in setup-cicd creates the pool, provider, and SA bindings automatically. If auth fails, re-run terraform apply in the CI/CD Terraform directory.
CI/CD Pipeline Stages
The pipeline has three stages:
- CI (PR checks) — Triggered on pull request. Runs unit and integration tests.
- Staging CD — Triggered on merge to
main. Builds container, deploys to staging, runs load tests.Path filter: Staging CD uses
paths: ['app/**']— it only triggers when files underapp/change. If nothing happens after the first push aftersetup-cicd, this is why. - Production CD — Triggered after successful staging deploy. May require manual approval before deploying to production.
Approving: Go to GitHub Actions → the production workflow run → click "Review deployments" → approve the pending
productionenvironment. This is GitHub's environment protection rules.
IMPORTANT: setup-cicd creates infrastructure but doesn't deploy automatically. Push code to trigger the pipeline:
git add . && git commit -m "Initial agent implementation"
git push origin main
To approve production deployment:
# GitHub Actions: Approve via repository Actions tab (environment protection rules)
# Cloud Build: Find pending build and approve
gcloud builds list --project=PROD_PROJECT --region=REGION --filter="status=PENDING"
gcloud builds approve BUILD_ID --project=PROD_PROJECT
Service Account Architecture
Scaffolded projects use two service accounts:
app_sa(per environment) — Runtime identity for the deployed agent. Roles defined indeployment/terraform/iam.tf.cicd_runner_sa(CI/CD project) — CI/CD pipeline identity (GitHub Actions / Cloud Build). Needs permissions in both staging and prod projects.
Troubleshooting
| Issue | Solution |
|---|---|
| Agent Engine deploy timeout | Check if engine was created; manually populate deployment_metadata.json |
| 403 on deploy | cicd_runner_sa missing deployment role or SA impersonation in target project |
| 403 testing Cloud Run | Add Authorization: Bearer $(gcloud auth print-identity-token) header |
| Secret access denied | Verify secretAccessor granted to app_sa, not default compute SA |
| Cold starts slow | Set min_instance_count > 0 in Cloud Run Terraform config |
| Resource already exists | Use terraform import — see reference/terraform-patterns.md |
When not to use it
- →When creating GCP resources manually via gcloud for production
- →When the task involves agent code patterns or project scaffolding
- →When the task is for evaluations and observability
Prerequisites
Limitations
- →It does not cover agent code patterns or testing strategies
- →It does not cover evaluations and observability
- →It requires Terraform for production infrastructure
How it compares
This skill provides a structured, Terraform-based approach to deploying ADK agents to GCP with CI/CD, contrasting with manual gcloud deployments.
Compared to similar skills
adk-deploy-guide side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| adk-deploy-guide (this skill) | 0 | 2mo | Review | Advanced |
| terraform-module-library | 7 | 4mo | No flags | Advanced |
| azure-image-builder | 0 | 5mo | Review | Intermediate |
| senior-devops | 7 | 7mo | Review | Advanced |
Try saying
Example prompts that trigger this skill in your AI assistant.
You might also like
terraform-module-library
wshobson
Build reusable Terraform modules for AWS, Azure, and GCP infrastructure following infrastructure-as-code best practices. Use when creating infrastructure modules, standardizing cloud provisioning, or implementing reusable IaC components.
azure-image-builder
hashicorp
Build Azure managed images and Azure Compute Gallery images with Packer. Use when creating custom images for Azure VMs.
senior-devops
davila7
Comprehensive DevOps skill for CI/CD, infrastructure automation, containerization, and cloud platforms (AWS, GCP, Azure). Includes pipeline setup, infrastructure as code, deployment automation, and monitoring. Use when setting up pipelines, deploying applications, managing infrastructure, implementing monitoring, or optimizing deployment processes.
deployment-engineer
sickn33
Expert deployment engineer specializing in modern CI/CD pipelines, GitOps workflows, and advanced deployment automation. Masters GitHub Actions, ArgoCD/Flux, progressive delivery, container security, and platform engineering. Handles zero-downtime deployments, security scanning, and developer experience optimization. Use PROACTIVELY for CI/CD design, GitOps implementation, or deployment automation.
devops
mrgoonie
Deploy to Cloudflare (Workers, R2, D1), Docker, GCP (Cloud Run, GKE), Kubernetes (kubectl, Helm). Use for serverless, containers, CI/CD, GitOps, security audit.
genkit-infra-expert
jeremylongshore
Execute use when deploying Genkit applications to production with Terraform. Trigger with phrases like "deploy genkit terraform", "provision genkit infrastructure", "firebase functions terraform", "cloud run deployment", or "genkit production infrastructure". Provisions Firebase Functions, Cloud Run services, GKE clusters, monitoring dashboards, and CI/CD for AI workflows.