Lambda access to Redshift - connection time out

0

I have created a lambda function using redshift_connector to read data from S3 bucket in another AWS account, and write data into Redshift account (Lambda is in the same account with my Redshift cluster). Redshift is in a private subnet and is not publicly accessible.

The Python code works in the local environment. But it has error "('connection time out', TimeoutError(110, 'Connection timed out'))" when I run it in the Lambda.

I configured the VPC to be in the same VPC as Redshift, and selected two private subnets in Lambda VPC setting. I also granted the AWSLambdaVPCAccessExecutionRole and AmazonRedshiftDataFullAccess to the role used by Lambda but I still have the same issue. Is there anything else that need to be configured? Thanks in advance for the help!

已提問 1 個月前檢視次數 363 次
1 個回答
2
已接受的答案

If your Lambda and Redshift are in the same VPC, you should check:

  • that the security group associated with your Redshift cluster allows inbound traffic from the Lambda function. You can do this by allowing inbound traffic on the port Redshift is using (default is 5439) from the security group associated with your Lambda function.
  • the network access control lists (ACLs) for the subnets to ensure they are not blocking traffic between your Lambda function and the Redshift cluster. Network ACLs can be configured to allow or deny traffic based on IP address, port, and protocol.

Key sources:

profile picture
專家
已回答 1 個月前
profile picture
專家
已審閱 24 天前
profile pictureAWS
專家
已審閱 1 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南