- Newest
- Most votes
- Most comments
- The security group on the VPC endpoint just needs 443 Inbound from the Lambda SG or CIDR Range. I usually allow VPC Cidr range here
- The Lambda security group can be left as 0.0.0.0/0 ANY Outbound or you could limit it ifyou wish
- On your RDS security group allow Inbound on 3306 from the Lambda Security group
- Last option, If you have a NAT gateway on the VPC you can just let lambda use SSM parameter store over the public internet too.
It just comes down to knowledge and experience with any kind of techonology I am afraid.
All general AWS service endpoints both on the public internet and as VPC interface endpoints only require HTTPS (tcp/443) inbound. In your case, you should have one security group for the Lambda function and another security group for your VPC endpoints for AWS services.
In the outbound/egress rules of the Lambda function's security group, permit TCP to port 443 towards the security group ID of the AWS service endpoints, unless all outbound traffic to 0.0.0.0/0 is already permitted.
In the inbound/ingress rules of the AWS service endpoint security group, permit TCP to port 443 from the security group ID of the Lambda function.
As an alternative to having a static password for authenticating to your database, you could also use IAM authentication with the Lambda function's temporary IAM credentials: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.IAMDBAuth.html. You'll still need an endpoint, in this case for the RDS service in your region, but no static password to safeguard would be needed by your Lambda function.
Relevant content
asked 3 years ago
