Connect Lambda to Redshift in Different Availability Zones

允我心安 提交于 2019-11-29 16:50:23

I was stuck in a similar situation. Adding the NAT gateway's elastic ip to the inbound rule of Redshift's security group for port 5439 fixed it for me.

Steps:

  • Check lambda's private subnet using a NAT gateway (subnet-abc)
  • Go to VPC console > subnets > subnet-abc > route-table
  • In Route-table routes, you can find the NAT gateway used (nat-abcdefg)
  • Go to VPC console > NAT Gateways > nat-abcdefg. Get the elastic-ip used by this NAT gateway. (xx.yy.zz.pqr)
  • Add an inbound rule for this elastic-ip in redshift's security group (port = 5439 CIDR xx.yy.zz.pqr/32)

Volla! Lambda connects to redshift.

Though, before doing this, lambda should be configured in the same VPC as redshift and using the appropriate private subnet (configured to use NAT gateway) as OP suggested.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!