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!

preguntada hace un mes362 visualizaciones
1 Respuesta
2
Respuesta aceptada

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
EXPERTO
respondido hace un mes
profile picture
EXPERTO
revisado hace 24 días
profile pictureAWS
EXPERTO
revisado hace un mes

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas