0

I'm trying to fetch data from the internet via aws rds and aws lambda, but I get an error when trying to do so:

"errorMessage": "HTTPSConnectionPool(host='news.google.com', port=443): Max retries exceeded with url: /news/headlines?hl=tr&gl=TR&ned=tr_tr (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 110] Connection timed out',))"

Please help me. What may be the problem?

valiano
  • 16,433
  • 7
  • 64
  • 79

2 Answers2

2

Is your Lambda function in a VPC without a NAT gateway? Looks like it doesn't have an outbound internet connection since it doesn't have an IP address.

Try removing the Lambda from the VPC if you don't need to access VPC private resources.

Otherwise, it also looks like you need to access RDS from within the Lambda, so in that case, you should add a NAT gateway to your VPC.

Some useful resources:

Irvin Lim
  • 2,393
  • 17
  • 20
1

One thing to be aware of when you have a connection timeout issue is it's probably caused by the security layer of the resource you are trying to access dropping the network packets.

On top of what Irvin has answered, if you want to access private resources within the VPC. Check the inbound and outbound rules. Make sure your resource is accessible with the correct inbound rule setup and has the same security group configured.