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개 답변
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
전문가
답변함 한 달 전
profile picture
전문가
검토됨 25일 전
profile pictureAWS
전문가
검토됨 한 달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인