Skip to main content

Q&A

What does SQL Proxy provide?

a secure way to access Cloud SQL instances without having to allowlist IP addresses or configure SSL.
Secure connections (automatic traffic encryption and SSL certification encryption) and easier connection management (automatic authentication)

App engine and other flexible environments have "built-in" proxy implementation, so you don't have to.

image.png

to download the proxy:

wget https://dl.google.com/cloudsql/cloud_sql_proxy.linux.amd64 -O cloud_sql_proxy

export GOOGLE_PROJECT=$(gcloud config get-value project)
MYSQL_DB_NAME=$(terraform output -json | jq -r '.instance_name.value')
MYSQL_CONN_NAME="${GOOGLE_PROJECT}:REGION:${MYSQL_DB_NAME}"

./cloud_sql_proxy -instances=${MYSQL_CONN_NAME}=tcp:3306