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 Antwort
2
Akzeptierte Antwort

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
EXPERTE
beantwortet vor einem Monat
profile picture
EXPERTE
überprüft vor 24 Tagen
profile pictureAWS
EXPERTE
überprüft vor einem Monat

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen