title: How to access Redshift from a Lambda from a VPC in a different account
body: <p>I have read most of the Stackoverflow questions and heaps of docs on the internet but for some reason can't get lambda to connect to Redshift when Redshift is in a different VPC and different AWS account.</p>
  
  <p>I have two subnets associated with the VPC and an internet gateway and NAT gateway are attached to the VPC. This is the VPC that the Lambda function is associated with. I added the NAT elastic ip to the security group of Redshift security group. The NAT is in the route table pointing to Redshift Elastic ip.</p>
  
  <p>I following methods do work:</p>
  
  <ul>
  <li>taking lambda out of the VPC and opening Redshift to public (0.0.0.0) which is not ideal</li>
  <li>closing Redshift to the public and making the query from an EC2 instance in the VPC where the Lambda function is (put EC2 ip in Redshift security group)</li>
  </ul>
  
  <p>Any idea how to get lambda to use the elastic ip of the NAT or something along those lines? Does the NAT in the route table need to point to elastic ip of Redshift or to a CIDR block or something similar? What am I missing?</p>