I've a Lambda function with VPC that connecting to Cassandra.
I think that because of cold-start or other issue it can't connect to the Cassandra at all, the Lambda have timeout of 10s, I want to add timeout for the Cassandra as well, if the first connection not being made I will kill the script and return that there was an issue.
I'm using cassandra-driver for node js: https://github.com/datastax/nodejs-driver/
Conneciton:
const cassandra = require('cassandra-driver');
const client = new cassandra.Client({ contactPoints: ['127.0.0.1'], keyspace: 'keyspace' });
I can't use the timeout of the nodejs and then check the connection because the Lambda won't finish the code until the timeout will finished, even if everything was okay.