My Lambda function needs to connect to RDS using credentials from AWS Secret Manager. Following things I had done:
- Created Lambda Function and associated with VPC (Eg. VPC 1) and created a separate Security group(Lambda-SG).
- RDS is also in the same VPC and is accessible from the Lambda function
- Created VPC Endpoint for Secret Manager Service so that Lambda function can connect to it.
- The Lambda function is not able to connect to AWS Secret Manager and getting timed out.
Any resolution will be helpful. If I remove the VPC then it is accessible but I need the VPC for connecting to the RDS instance. Cannot use NAT gateway as the cloud environment policy will not allow any Internet connection.