title: Postgresql - Error Connection terminated due to connection timeout
body: <p>I have created a google cloud function in google cloud which will connect to my postgresql instance created in Google cloud.</p>
  <p>I am using 'pg' node module.</p>
  <p>I have create a private IP for this.</p>
  <p>I am getting following error:</p>
  <blockquote>
  <p>Error: Connection terminated due to connection timeout at
  Timeout.connectionTimeoutHandle.setTimeout
  (/workspace/node_modules/pg/lib/client.js:106:28) at ontimeout
  (timers.js:436:11) at tryOnTimeout (timers.js:300:5) at listOnTimeout
  (timers.js:263:5) at Timer.processTimers (timers.js:223:10)</p>
  </blockquote>
  <p>when trying to query the database in google cloud.</p>
  <p>This is my configuration which I am using in google cloud function.</p>
  <blockquote>
  <p>{
  &quot;host&quot;: &quot;&quot;,
  &quot;user&quot;: &quot;&quot;,
  &quot;pw&quot;: &quot;&quot;,
  &quot;db&quot;: &quot;&lt;database_name&gt;&quot;,
  &quot;port&quot;: &quot;5432&quot;,
  &quot;table&quot;: &quot;&lt;table_name&quot;,
  &quot;max&quot;: 100,
  &quot;idleTimeoutMillis&quot;: 30000,
  &quot;connectionTimeoutMillis&quot;: 30000 }</p>
  </blockquote>
  <p>Please help me with this</p>