There are 2 ways to connect to a Cloud SQL database: directly, or via a connector. [2 types of connectors][n] are supported: standalone ([Cloud SQL Auth Proxy][b]), and in-process ([Cloud SQL Language Connector][a], available for [Java, Python, Go, and Node.js][c]).
There are also [2 ways to authenticate][d] to a database:
- The PostgreSQL's built-in authentication (password).
- IAM database authentication. In this case you need an IAM service account and a [matching PostgreSQL user][e].
But before you can do that, you need to give yourself access to the database ([authorize the connection][f]):