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?
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.