title: Config for using psycopg2 to access to Cloud SQL instance
body: <p>I am using a PostgreSQL in Cloud SQL along with <code>psycopg2</code> library to connect to database from my python code. The current one that I have is associated with a VPC network in which my google compute engines also in that VPC. So, in this case, my config to connect to this cloud sql instance can use private ip and my config look like this:</p>
  
  <pre><code>config['db-cloudsql'] = {
     "host" : "10.x.x.x" # cloud sql private ip address
     "user" : "postgres"
     "password" :"xxxxx"
     "database" : "postgres" 
  }
  </code></pre>
  
  <p>But now I have another vm instance from another VPC network that need to access to this cloud sql instance. I know that I can access to the cloud sql instance using public ip. (by adding my vm to authorised network) But this vm need to access to the cloud sql instance very often. So I am not sure that the cost from accessing with public ip will be higher compared with accessing with private ip (cannot find any related document about this). I tried peering 2 vpc networks for accessing with private ip but just found that I cannot use this method to connect to sql with private ip <a href="https://cloud.google.com/sql/docs/mysql/private-ip#network_requirements" rel="nofollow noreferrer">from this document</a> </p>
  
  <p>I have found from the document that I can use <code>instance connection name</code> as a host for my config so it should be something like:</p>
  
  <pre><code>config['db-cloudsql'] = {
     "host" : "project-name:asia-southeast1:mydbname" #instance connection name
     "user" : "postgres"
     "password" :"xxxxx"
     "database" : "postgres" 
  }
  </code></pre>
  
  <p>I haven't try this method yet, it might not working but if it somehow works, how will it differ from using public ip addess in term of cost? </p>
  
  <p>Thank you</p>