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 Risposta
2
Risposta accettata

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
ESPERTO
con risposta un mese fa
profile picture
ESPERTO
verificato 24 giorni fa
profile pictureAWS
ESPERTO
verificato un mese fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande