Skip to content
Skillpedia
APIs & servers (backend)48k · #3084

gcp-cloud-sql

Makes your agent create and manage cloud databases. Configures security and backups. Useful for storing and accessing important information.

What it does

This feature creates and manages fully managed relational databases on Google Cloud. It handles tasks like high availability, backups, and security for you.

When to use it

  • ✓When you need a database for your application without worrying about the infrastructure.
  • ✓When migrating an existing database to the cloud.
  • ✓For applications that require secure transactions and SQL queries.

Example of what to ask your AI

“Create a PostgreSQL database for my web application, with automatic backups and high availability.”

Want more? Open the sections below.

How to use

The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.

Skill link

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/gcp-cloud-sql/SKILL.md

Ready-to-paste message

Use this skill to help me: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/gcp-cloud-sql/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
How it works

You tell Google Cloud what type of database you need (PostgreSQL, MySQL, etc.), its size, and security settings. Google Cloud takes care of the rest, ensuring it's always available and secure.

Installation

Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.

In the terminal (Claude Code, Codex, Cursor), in your project folder:

npx skills add sickn33/agentic-awesome-skills --skill gcp-cloud-sql

Or download just the file:

curl -L https://raw.githubusercontent.com/sickn33/agentic-awesome-skills/main/plugins/agentic-awesome-skills-claude/skills/gcp-cloud-sql/SKILL.md -o SKILL.md
Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

GCP Cloud SQL

Deploy and manage fully managed relational databases (PostgreSQL, MySQL, SQL Server) on Google Cloud.

When to Use

  • Running production relational databases without managing replication, patching, or backups
  • Migrating on-premises PostgreSQL or MySQL workloads to a managed service
  • Applications requiring ACID transactions, relational schemas, and SQL query support
  • Workloads that need automated high availability with regional failover

Prerequisites

  • Google Cloud SDK (gcloud) installed and authenticated
  • Cloud SQL Admin API and Service Networking API enabled
  • IAM role roles/cloudsql.admin for full management
gcloud services enable sqladmin.googleapis.com servicenetworking.googleapis.com

Instance Tiers Reference

Tier vCPUs Memory Use Case
db-f1-micro Shared 0.6 GB Dev/test only
db-g1-small Shared 1.7 GB Low-traffic staging
db-custom-2-8192 2 8 GB Small production
db-custom-4-16384 4 16 GB Medium production
db-custom-8-32768 8 32 GB High-traffic production

Create a PostgreSQL Instance

gcloud sql instances create prod-db \
  --database-version=POSTGRES_16 \
  --tier=db-custom-4-16384 \
  --region=us-central1 \
  --availability-type=REGIONAL \
  --storage-type=SSD --storage-size=100GB --storage-auto-increase \
  --backup-start-time=02:00 --enable-point-in-time-recovery \
  --retained-backups-count=14 \
  --maintenance-window-day=SUN --maintenance-window-hour=4 \
  --database-flags=max_connections=200,log_min_duration_statement=1000 \
  --root-password=$(openssl rand -base64 24) \
  --labels=env=production,team=backend

gcloud sql databases create myapp --instance=prod-db --charset=UTF8
gcloud sql users create appuser --instance=prod-db \
  --password=$(openssl rand -base64 24)

Create a MySQL Instance

gcloud sql instances create mysql-prod \
  --database-version=MYSQL_8_0 \
  --tier=db-custom-4-16384 --region=us-central1 \
  --availability-type=REGIONAL \
  --storage-type=SSD --storage-size=100GB --storage-auto-increase \
  --backup-start-time=02:00 --enable-bin-log --retained-backups-count=14 \
  --database-flags=slow_query_log=on,long_query_time=2,max_connections=500 \
  --root-password=$(openssl rand -base64 24)

Private IP Configuration

# Allocate IP range and create private connection
gcloud compute addresses create google-managed-services \
  --global --purpose=VPC_PEERING --prefix-length=16 --network=my-vpc

gcloud services vpc-peerings connect \
  --service=servicenetworking.googleapis.com \
  --ranges=google-managed-services --network=my-vpc

# Create instance with private IP only
gcloud sql instances create private-db \
  --database-version=POSTGRES_16 --tier=db-custom-2-8192 \
  --region=us-central1 \
  --network=projects/${PROJECT_ID}/global/networks/my-vpc \
  --no-assign-ip --availability-type=REGIONAL \
  --storage-type=SSD --storage-size=50GB --storage-auto-increase

Read Replicas

# Same-region replica
gcloud sql instances create prod-db-replica-1 \
  --master-instance-name=prod-db --tier=db-custom-4-16384 \
  --region=us-central1 --availability-type=ZONAL

# Cross-region replica for DR
gcloud sql instances create prod-db-replica-eu \
  --master-instance-name=prod-db --tier=db-custom-4-16384 \
  --region=europe-west1 --availability-type=ZONAL

# Promote a replica to standalone (disaster recovery)
gcloud sql instances promote-replica prod-db-replica-eu

Backups and Restore

gcloud sql backups create --instance=prod-db --description="pre-migration"
gcloud sql backups list --instance=prod-db

# Point-in-time recovery
gcloud sql instances clone prod-db prod-db-pitr \
  --point-in-time="2026-03-23T10:00:00Z"

# Export / import
gcloud sql export sql prod-db gs://my-bucket/export.sql.gz --database=myapp
gcloud sql import sql prod-db gs://my-bucket/export.sql.gz --database=myapp

Cloud SQL Auth Proxy

curl -o cloud-sql-proxy \
  https://storage.googleapis.com/cloud-sql-connectors/cloud-sql-proxy/v2.11.0/cloud-sql-proxy.linux.amd64
chmod +x cloud-sql-proxy

./cloud-sql-proxy ${PROJECT_ID}:us-central1:prod-db --port=5432 --auto-iam-authn

# Unix socket (for Kubernetes sidecar pattern)
./cloud-sql-proxy ${PROJECT_ID}:us-central1:prod-db --unix-socket=/tmp/cloudsql
psql "host=/tmp/cloudsql/${PROJECT_ID}:us-central1:prod-db user=appuser dbname=myapp"

…

FAQ

What are relational databases?

These are databases that organize data into tables with rows and columns, like a spreadsheet, and allow complex queries using SQL.

What does 'fully managed' mean?

It means Google Cloud handles all the maintenance, updates, backups, and security of the database, so you don't have to worry about it.

Can I choose the database type?

Yes, you can choose between PostgreSQL, MySQL, and SQL Server.

Details

Original description by the author

Provision Cloud SQL and Spanner databases. Configure high availability, backups, and security. Use when deploying managed databases on GCP.

repo: sickn33/agentic-awesome-skills

Popularity

GitHub stars
48k
Ranking position
#3084
License
MIT
Updated
10/15/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills