1 Answer
- Newest
- Most votes
- Most comments
2
When a Lambda function runs in a default VPC, it has access to the internet but no access to private resources in your VPC. When the function is attached to your VPC, it has access to the private resources, but it looses the access to the internet. To regain that access, you need to add a VPC endpoint for the AWS services you want to access or a NAT gateway to access the rest of the internet of AWS services that do not support VPC endpoints.
All the client('rds')
calls are trying to access the RDS service public endpoint. As such you need to create an RDS VPC endpoint.
An alternative would be to configure an environment variable that contains the connection string so that you do not need to find it every time.
Relevant content
- asked 2 months ago
- asked 2 months ago
- asked a year ago
- asked 3 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 5 days ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 17 days ago