I need help connecting into a Postgres SQL via Cloud-SQL-Proxy.
Here is what I have:
-
I created SQL instance, and created a DB and a user on the instance itself. I added the user and DB from the web console.
-
I am able to log into the DB using Cloud SQL Studio, but I need to access the DB from my local. So, I tried Cloud-SQL-Proxy.
-
I initiate the proxy with “./cloud-sql-proxy --port 5225 CONNECTION-NAME”. It’s start fine. But when I tried to connect to it with the username and password that work on Cloud SQL Studio, I am getting this error: failed to connect to instance: failed to get instance: Refresh error: failed to get instance metadata (connection name = “stg-icognition:us-central1:psql-icog-stg”): googleapi: Error 403: boss::NOT_AUTHORIZED: Not authorized to access resource. Possibly missing permission cloudsql.instances.get on resource instances/psql-icog-stg., forbidden
I am assuming that I am missing something in the configuration, but I couldn’t find difference between my set-up in the docs - https://cloud.google.com/sql/docs/postgres/connect-auth-proxy.