Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Accessing Redshift from Lambda - Avoiding the 0.0.0.0/0 Security Group

I am trying to access a Redshift database from a Lambda function. When I add 0.0.0.0/0 to the security group connections in the Redshift interface (as suggested by this article), I am able to connect successfully. From a security perspective, however, I don't feel comfortable using 0.0.0.0/0.

Is there a way to only allow Lambda to access Redshift without opening it up to the public internet?

I have tried adding the AWS IP ranges, however, this didn't work (as it only allows a limited number of security group connections).

like image 450
p_mcp Avatar asked Feb 07 '23 04:02

p_mcp


1 Answers

Enable VPC access for your Lambda function, and open the Redshift Security Group to the SG assigned to the Lambda function, just like you would open it to an EC2 server.

like image 165
Mark B Avatar answered Apr 28 '23 04:04

Mark B