title: Cannot get AWS Data Pipeline connected to Redshift
body: <p>I have a query I'd like to run regularly in Redshift.  I've set up an AWS Data Pipeline for it.</p>
  
  <p>My problem is that I cannot figure out how to access Redshift.  I keep getting "Unable to establish connection" errors.  I have an Ec2Resource and I've tried including a subnet from our cluster's VPC and using the Security Group Id that Redshift uses, while also adding that sg-id to the inbound part of the rules.  No luck.</p>
  
  <p>Does anyone have a from-scratch way to set up a data pipeline to run against Redshift?</p>
  
  <p><strong>How I currently have my pipeline set up</strong></p>
  
  <ul>
  <li>RedshiftDatabase
  
  <ul>
  <li>Connection String: <code>jdbc:redshift://[host]:[port]/[database]</code></li>
  <li>Username, Password</li>
  </ul></li>
  <li>Ec2Resource
  
  <ul>
  <li>Resource Role: DataPipelineDefaultResourceRole</li>
  <li>Role: DataPipelineDefaultRole</li>
  <li>Terminate after: 20 minutes</li>
  </ul></li>
  <li>SqlActivity
  
  <ul>
  <li>Database: [database] (from Connection String)</li>
  <li>Runs on: Ec2Resource</li>
  <li>Script: SQL query</li>
  </ul></li>
  </ul>
  
  <p><strong>Error message</strong></p>
  
  <blockquote>
    <p>Unable to establish connection to jdbc:postgresql://[host]:[port]/[database] Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.</p>
  </blockquote>