I've have to move a AWS Lambda function into a VPC because we have a RDS proxy running in there. The problem is that after I've put the Lambda into the VPC it always times out with the error Error Type: Runtime.Unknown
.
I've setup a service endpoint for AWS Lambda for a single subnet in a single AZ. And, I've placed the function in the same.
Because, I don't get any further information it's quite hard to debug as the underlying technology of AWS Lambda is somehow a black box.
I found the solution to my problem. I'm fetching a secret on the top level on my code and did have a service endpoint for it setup.
It seems that AWS Lambda is throwing the Runtime.Unknown
error in case something went wrong on the root level during initialization.
Example:
thisThrowsAnError();
export function yourActualHandler() {
// ...
}