Google Cloud (GCP) Provider
Agent Cloud supports deploying to three Google Cloud services depending on your project type. This guide covers the setup and what each deployment target provides.
Prerequisites
Section titled “Prerequisites”Install Google Cloud SDK
Section titled “Install Google Cloud SDK”# macOSbrew install --cask google-cloud-sdk
# Linux (Debian/Ubuntu)echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" \ | sudo tee /etc/apt/sources.list.d/google-cloud-sdk.listsudo apt-get update && sudo apt-get install google-cloud-cli
# Or use the installer scriptcurl https://sdk.cloud.google.com | bashexec -l $SHELLAuthenticate and Configure
Section titled “Authenticate and Configure”# Log in to your Google accountgcloud auth login
# Set your projectgcloud config set project YOUR_PROJECT_ID
# Set a default regiongcloud config set run/region us-central1Enable Required APIs
Section titled “Enable Required APIs”Agent Cloud deployments need these APIs enabled in your GCP project:
# For Cloud Rungcloud services enable run.googleapis.comgcloud services enable cloudbuild.googleapis.comgcloud services enable containerregistry.googleapis.com
# For Cloud Functionsgcloud services enable cloudfunctions.googleapis.com
# For Firebase Hostinggcloud services enable firebase.googleapis.comVerify Setup
Section titled “Verify Setup”# Check gcloud versiongcloud --version
# Verify authenticationgcloud auth print-access-token
# Check your projectgcloud config get-value projectOr use Agent Cloud:
cloud-agent status --cloud gcpRequired Roles
Section titled “Required Roles”Your Google account or service account needs these IAM roles:
For Cloud Run Deployments
Section titled “For Cloud Run Deployments”roles/run.admin— manage Cloud Run servicesroles/cloudbuild.builds.builder— build container imagesroles/storage.admin— push images to Container Registryroles/iam.serviceAccountUser— act as the runtime service account
For Cloud Functions Deployments
Section titled “For Cloud Functions Deployments”roles/cloudfunctions.admin— manage Cloud Functionsroles/storage.admin— upload function source code
For Firebase Hosting Deployments
Section titled “For Firebase Hosting Deployments”roles/firebase.admin— manage Firebase resourcesroles/storage.admin— upload static assets
To grant roles:
# Replace with your project ID and emailgcloud projects add-iam-policy-binding YOUR_PROJECT_ID \ --member="user:you@example.com" \ --role="roles/run.admin"Deployment Targets
Section titled “Deployment Targets”Cloud Run (APIs and Web Apps)
Section titled “Cloud Run (APIs and Web Apps)”Used for: Express, NestJS, FastAPI, Next.js, and any containerized application.
Agent Cloud will:
- Submit a Cloud Build to build a container image from your source
- Push the image to Google Container Registry (gcr.io)
- Deploy the container to Cloud Run with the specified port
- Configure the service to allow unauthenticated HTTP access
What you get:
- A fully managed container running behind a Google-managed HTTPS URL
- Automatic scaling from zero to many instances
- Per-request billing (generous free tier: 2M requests/month)
- Built-in HTTPS with a
*.run.appdomain
Estimated cost: $0-25/month depending on traffic (free tier covers many small apps).
Cloud Functions (Serverless Functions)
Section titled “Cloud Functions (Serverless Functions)”Used for: Lightweight APIs, webhooks, event handlers, and background tasks.
Agent Cloud will:
- Package your function source code
- Deploy to Cloud Functions with HTTP trigger
- Configure runtime, memory, and timeout
What you get:
- Pay-per-invocation pricing (free tier: 2M invocations/month)
- Automatic scaling
- Integrated with other GCP services (Pub/Sub, Storage events, etc.)
Estimated cost: $0-10/month for low-traffic functions.
Firebase Hosting (Static Sites)
Section titled “Firebase Hosting (Static Sites)”Used for: HTML/CSS/JS sites, React SPAs, Astro, Gatsby, and other static builds.
Agent Cloud will:
- Initialize Firebase configuration in your project
- Build your static assets (if a build command is detected)
- Deploy the output directory to Firebase Hosting
What you get:
- Global CDN-backed static hosting
- Free SSL certificates
- Custom domain support
- Preview URLs for each deployment
Estimated cost: $0/month for most static sites (free tier: 10GB hosting, 360MB/day transfer).
How Agent Cloud Chooses
Section titled “How Agent Cloud Chooses”| Project Type | Primary Service | Fallback |
|---|---|---|
| API (Node.js, Python, Go) | Cloud Run | Cloud Functions |
| Web App (Next.js, React SSR) | Cloud Run | App Engine |
| Static Site (HTML, SPA) | Firebase Hosting | Cloud Storage |
| Container (Dockerfile) | Cloud Run | — |
Cleanup
Section titled “Cleanup”cloud-agent cleanup --cloud gcpThis deletes Cloud Run services, Cloud Functions, Firebase Hosting sites, and associated container images.
Troubleshooting
Section titled “Troubleshooting”“PERMISSION_DENIED” — Your account lacks the required IAM roles. Check the roles section above and make sure the relevant APIs are enabled.
“Cloud Build API has not been enabled” — Run gcloud services enable cloudbuild.googleapis.com in your project.
“The current account does not have access to project” — Run gcloud config set project YOUR_PROJECT_ID and make sure you have access.
“Container failed to start” — Your application must listen on the port specified by the PORT environment variable (Cloud Run sets this automatically, default 8080). Make sure your app reads process.env.PORT.