Eugene
Eugene

Reputation: 1125

Lambda timeout accessing redshift

I am trying to connect to Redshift cluster via python lambda function. I've checked the following for the lambda:

For the redshift cluster, it is in the same VPC as lambda and not publicly accessible. So in the lambda environment, I had used the redshift private IP.

However, when I try running the lambda, it timeout after the x seconds still.

Upvotes: 0

Views: 852

Answers (1)

John Rotenstein
John Rotenstein

Reputation: 269091

The security configuration should be:

  • The AWS Lambda function should be connected to the same VPC as the Amazon Redshift cluster
  • A Security Group on the AWS Lambda function (Lambda-SG) that has the default "Allow All" rules for Outbound connections
  • A Security Group on the Redshift database (Redshift-SG) that permits Inbound connections on port 5439 from Lambda-SG

That is, the Redshift-SG should specifically reference the Lambda-SG (by sg- ID) in the Inbound rule. This will permit the Lambda function to communicate with the Redshift database.

Upvotes: 1

Related Questions