What is this integration?
Google Cloud Platform (GCP) provides fully managed cloud services including relational databases (Cloud SQL), NoSQL document databases (Firestore), and serverless data warehouses (BigQuery).What Monk manages
- Cloud SQL instances, databases, and users
- Firestore databases with PITR and backup support
- BigQuery datasets and table snapshots
- Memorystore for Redis instances with export/import support
- Cloud Storage buckets
- Cloud Storage HMAC keys for S3-compatible access
- Service accounts and IAM bindings
- API enablement via Service Usage
What the Agent can do and how to use it
- Database Creation: Provision Cloud SQL, Firestore, BigQuery, and Memorystore for Redis
- Backup & Recovery: Automated backups, on-demand snapshots, export/import, and restore operations
- Scaling: Modify instance tiers, storage, and enable high availability
- Security: Configure authorized networks, SSL, and IAM permissions
- Monitoring: Access instance status and connection information
- Ensure GCP provider is added:
monk cluster provider add -p gcp - monk update <namespace>/<name>
Required IAM Permissions
The principal whose credentials are configured viamonk cluster provider add -p gcp (a service account or user) needs IAM roles on the target project covering the entities you intend to manage.
Quick start (broad roles)
Grants enough permission to manage every entity in this package:roles/editor— create/update/delete most resourcesroles/resourcemanager.projectIamAdmin— required becauseroles/editorcannot modify IAM (used bygcp/service-account,gcp/project-iam-binding,gcp/resource-iam-binding)roles/serviceusage.serviceUsageAdmin— enable APIs viagcp/service-usage
Least-privilege roles
Grant only the roles for the entities your stack uses:| Entity area | Role |
|---|---|
API enablement (gcp/service-usage) | roles/serviceusage.serviceUsageAdmin |
Cloud SQL (cloud-sql-instance, cloud-sql-database, cloud-sql-user) | roles/cloudsql.admin |
Firestore (firestore-database) | roles/datastore.owner |
BigQuery (bigquery-dataset) | roles/bigquery.admin |
Memorystore Redis (memorystore-redis) | roles/redis.admin |
Cloud Storage (cloud-storage, cloud-storage-hmac-keys) | roles/storage.admin |
Pub/Sub (pubsub-topic, pubsub-subscription) | roles/pubsub.admin |
Cloud Run (cloud-run-service, cloud-run-job) | roles/run.admin |
Cloud DNS (cloud-dns-zone, cloud-dns-record-set) | roles/dns.admin |
Artifact Registry (artifact-registry-repository) | roles/artifactregistry.admin |
Cloud CDN / load balancing (cloud-cdn-backend-bucket, cloud-cdn-backend-service) | roles/compute.loadBalancerAdmin |
Cloud Tasks (cloud-tasks-queue) | roles/cloudtasks.admin |
Cloud Armor (cloud-armor-security-policy) | roles/compute.securityAdmin |
Service accounts (gcp/service-account, service-account-key) | roles/iam.serviceAccountAdmin, roles/iam.serviceAccountKeyAdmin |
Project IAM bindings (project-iam-binding, resource-iam-binding) | roles/resourcemanager.projectIamAdmin |
IAP (iap-settings, iap-access-policy, iap-oauth-client) | roles/iap.admin |
Identity Platform (identity-platform-*) | roles/identityplatform.admin |
Cost estimation (get-cost-estimate, costs actions) | roles/monitoring.viewer |
src/gcp/README.md.
Auth
- Uses GCP provider credentials configured via
monk cluster provider add -p gcp - GCP credentials are automatically injected into the GCP client
Getting Started
- Ensure GCP provider is added:
- Define a Cloud SQL instance (save as gcp-stack.yaml):
- Create/update:
S3-Compatible Cloud Storage Access (HMAC)
Create HMAC keys to access Cloud Storage using S3-compatible clients. Make surestorage.googleapis.com is enabled via gcp/service-usage, and
use a service account from gcp/service-account:
https://storage.googleapis.com as the S3 endpoint and the secrets
gcs-hmac-access-key / gcs-hmac-secret-key as credentials.
Cloud SQL Backup & Restore Actions
| Action | Description |
|---|---|
get-backup-info | View backup configuration and PITR status |
create-backup | Create an on-demand backup |
list-backups | List available backups (automated and on-demand) |
describe-backup | Get detailed information about a specific backup |
delete-backup | Delete a backup |
restore | Restore from backup (overwrites instance) |
get-restore-status | Check status of restore operation |
Firestore Backup & Restore Actions
| Action | Description |
|---|---|
get-backup-info | View PITR status and configuration |
export-documents | Export database to Cloud Storage |
import-documents | Import from Cloud Storage export |
list-backups | List scheduled backups in a location |
describe-backup | Get backup details |
delete-backup | Delete a scheduled backup |
restore | Restore to a new database from backup |
get-restore-status | Check restore operation progress |
export-documents for full database backups.
BigQuery Backup & Restore Actions
| Action | Description |
|---|---|
get-backup-info | View time travel settings and storage model |
create-snapshot | Create a table snapshot |
list-snapshots | List tables/snapshots in dataset |
describe-snapshot | Get table/snapshot details |
delete-snapshot | Delete a snapshot table |
restore | Create new table from snapshot |
Restore Behavior Summary
| Database | Restore Target | Warning |
|---|---|---|
| Cloud SQL | Same instance | ⚠️ OVERWRITES existing instance |
| Firestore | New database | ✅ Safe - creates new database |
| BigQuery | New table | ✅ Safe - creates new table (clone) |

