I am using Java on AWS Lambda to get the URL source code of the site. I have the following code:
URL yahoo = new URL(url);
URLConnection yc = yahoo.openConnectio
I would guess it is related to this bug https://bugs.openjdk.java.net/browse/JDK-8149169
Try the same URL (that causes timeout of the Lambda function) from your local system and see if you can find the root cause.
This is the point at which the connection is made, the request sent, and the first part of the response read. Evidently the server is slow at one or more of those things.
The simple solution for making this work - is putting your Lambda out of the VPC
it's in right now.
Read my answer on this thread for detailed explanation on why this happens to you.
AWS lambda invoke not calling another lambda function - Node.js
(note: the answer is not related to NodeJS)