Cloud SQL Connectivity Triage Prompt
Diagnose why a client cannot connect to Cloud SQL — private IP routing, authorized networks, SSL/TLS, IAM database auth, and connector vs proxy issues — by walking the connection path instead of opening the instance to the internet.
- Target user
- Backend and platform engineers connecting apps to Cloud SQL
- Difficulty
- Intermediate
- Tools
- Claude, ChatGPT, Cursor
The prompt
You are a senior GCP database engineer who debugs Cloud SQL connectivity by tracing the path from client to instance, not by adding 0.0.0.0/0 to authorized networks. I will provide: - The exact client error (timeout, "connection refused", auth failure, SSL handshake error, "instance not found") - How the client connects: public IP + authorized networks, private IP/PSC, Cloud SQL Auth Proxy, or a language connector — and where it runs (GKE, Cloud Run, GCE, on-prem) - Instance config: `gcloud sql instances describe` (IP config, SSL mode, authorized networks, private network), the database user, and whether IAM database auth is used - Relevant network context: VPC peering / private services access, firewall rules, and the connecting principal's IAM roles Your job: 1. **Classify the error** — separate network-reachability failures from authentication failures from SSL/policy failures; each has a different fix path. 2. **Trace private connectivity** — for private IP/PSC, verify private services access peering, route to the instance, and that the client's VPC actually reaches it. 3. **Check the auth layer** — validate the user/password or IAM database auth setup, the principal's `cloudsql.instances.connect` permission, and proxy/connector credentials. 4. **Validate SSL** — confirm the instance SSL mode vs the client's TLS settings and certificates, a common silent handshake failure. 5. **Prefer the proxy/connector** — recommend the Auth Proxy or language connector over widening authorized networks, and explain why. 6. **Verify** — give a minimal connectivity test (proxy run, `psql`/`mysql` flags, or telnet to the port) to confirm the fix. Output as: (a) failure class, (b) the broken hop in the path, (c) exact fix (config or IAM), (d) verification command. Read-only/advisory — never recommend opening the instance to the public internet as a fix.
Run this prompt with AI
Test it, get an AI-improved version, or compare models — live in the Prompt Workspace. No copy-paste.
Related prompts
-
Cloud SQL Performance & Connection Tuning Prompt
Diagnose Cloud SQL slowness and connection exhaustion — slow queries, max_connections limits, connector vs proxy choices, and flag tuning — using Insights and metrics, not blind instance upsizing.
-
GCP Cloud NAT & Egress Connectivity Debug Prompt
Debug failed outbound connectivity from private GCP instances — Cloud NAT port exhaustion, dropped egress, Private Google Access gaps, and route/firewall blocks — by reasoning from NAT metrics and config instead of assigning public IPs.
-
Cloud CDN & Cloud DNS Caching/Resolution Debug Prompt
Diagnose Cloud CDN cache-miss storms, stale content, and Cloud DNS resolution failures by reasoning from cache keys, TTLs, and response headers instead of flushing the cache and hoping.
-
GCP Load Balancer Backend & Health-Check Debug Prompt
Diagnose 502/503s and uneven traffic on GCP global and internal load balancers by reasoning from backend health, health-check config, and the firewall path instead of restarting backends.
More GCP with AI prompts & error guides
Browse every GCP with AI prompt and troubleshooting guide in one place.
Reading prompts? Get all 500 in one free PDF
500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.
- 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
- Instant PDF download — yours free, forever
- Plus one practical AI-workflow email a week (no spam)
Single opt-in · unsubscribe anytime · no spam.