What is the hostname for a Google Cloud PostgreSQL instance?

Viewed 7224

I'm trying to connect to a PostgreSQL database on Google Cloud using SQLAlchemy. Making a connection to the database requires specifying a database URL of the form: dialect+driver://username:password@host:port/database

I know what the dialect + driver is (postgresql), I know my username and password, and I know the database name. But I don't know how to find the host and port on the Google Cloud console. I've tried using the instance connection name, but that doesn't seem to work. Anyone know where I can find this info on Google Cloud?

3 Answers

Hostname is the Public IP address.

I want to assume you're making use of the Postgres instance private IP address. That can be gotten from Cloud SQL instances dashboard.

Related