I am trying to connect to CloudSQL on GCP using pycopg2
In order to do this I use as host:
'my-project-dev-a24525:europe-west1:sql-dev-432521ec-master'
as given in "Instance connection name"
conn = psycopg2.connect(host='my-project-dev-a24525:europe-west1:sql-dev-432521ec-master',
database="postgres", user="admin", password="password")
However this results in:
could not translate host name "my-project-dev-a24525:europe-west1:sql-dev-432521ec-master" to address: Temporary failure in name resolution
If I connect via the public ip address as in
conn = psycopg2.connect(host='xx.xxx.xx.xxx', database="postgres", user="admin", password="password")
the connection is fine.
Where can I find the proper hostname in GCP?