Our Redshift cluster resides in Zone A.
When our Lambda function uses a Zone A subnet, it can connect to Redshift.
When our Lambda function uses a subnet other than Zone A, it times out.
The work around, where we ALLOW connections for Redshift on port 5439 from 0.0.0.0/0, is not desired.
- We have our Lambda functions and Redshift cluster in the same VPC.
- Lambda functions have 4 dedicated subnets (one per zone)
- Redshift has 4 dedicated subnets per zone as well
- Lambda functions have their own security group (SG)
- The Redshift cluster has it's own SG as well.
- Redshift SG ALLOWs port 5439 from Lambda SG and Admin SG
Enhanced VPC Routingis enabledCluster Subnet Groupsinclude all 4 Redshift subnets (one per zone)- No issues when allowing port 5439 from 0.0.0.0/0 on Redshift SG
- Flow logs for REJECT work fine from Zone A to Zone A, but not from other zones to Zone A when we disable 0.0.0.0/0 rule.
- All Lambda subnets use a NAT that exists in Zone A
- All Redshift subnets use an IGW that exists in
- All Network ACLs currently allow all (default)
nslookupfrom an EC2 instance within the VPC, to see what IP address is returned. Also, have you tried activating VPC Flow Logs to analyze the traffic between Lambda and Redshift? - John Rotenstein