title: Why Connection timed error in redshift connection?
body: <p>I want to connect aws redshift with aws lambda.
  But this gives me error that connection timed out</p>
  
  <pre><code>            Class.forName("com.amazon.redshift.jdbc42.Driver");
              System.out.println("\n\nconnecting to database...\n\n");
  
              connStringBuilder = "jdbc:redshift:iam://%s?AccessKeyID=%s&amp;SecretAccessKey=%s&amp;DbUser=%s&amp;SessionToken=%s";
              connString = String.format(connStringBuilder, redshiftClusterURL, accessKeyId, secret, dbUser, token);
  
              System.out.println("connString is " + connString);
              conn = DriverManager.getConnection(connString);
  </code></pre>