Skip to content

Instantly share code, notes, and snippets.

@dantheman213
Created May 12, 2018 00:57
Show Gist options
  • Select an option

  • Save dantheman213/446d7876c5e49916fe74800acbd93396 to your computer and use it in GitHub Desktop.

Select an option

Save dantheman213/446d7876c5e49916fe74800acbd93396 to your computer and use it in GitHub Desktop.
Systemd start-up script for Google Cloud SQL Proxy for Postgres
[Install]
WantedBy=multi-user.target
[Unit]
Description=Google Cloud Compute Engine SQL Proxy
Requires=network.target
After=network.target
[Service]
Type=simple
WorkingDirectory=/cloudsql
ExecStart=/usr/local/bin/cloud_sql_proxy -dir=/cloudsql -instances=my-gcp-project-id:zone-id:cloud-sql-instance-name=tcp:5432 -credential_file=/path/to/cloudsql/credentials.json
Restart=always
StandardOutput=journal
User=root
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment