Java Lambda Function is getting timed out while connecting to Informix DB

Viewed 148

I have a lambda function written in Java. I have written database connection logic in lambda function. My database is Informix DB , which is outside AWS. Whenever, lambda runs and try to connect to DB, it gets time-out every-time. Can we connect to database outside AWS via lambda function?

2 Answers
  1. Check that your Lambda actually can access resources outside the AWS, if it uses VPC.
  2. If you're sure it can access external resources – increase Lambda timeout, which is 15 seconds by default. BTW, Java-based Lambda functions experience cold starts up to a few seconds. Current maximum execution time (timeout) for a Lambda function is 15 minutes.

Issue is Resolved!!

We were using hostname in our DB connection string. We now are using IP address and it is connecting now.

connectionString = jdbc:informix-sqli://<IP Address>/xxx:xxx

Thanks @madhead, @Chris Williams and all others for sharing their ideas! It really helped.

Related