So I have a python handler like this:
redisClinet = redis.StrictRedis(host = environ['REDIS_ENDPOINT'], port=6379, db=0)
def handler(event, context):
// some logic
lastEvent = redisClinet.get('lastEvent')
// rest of the logic
I have:
- lambda vpc properly setup to be on the same vpc as Elasticache cluster, the security group allows everyting inbound/outbound
- lambda execution role has access to all actions of all resources, including vpc, elasticache, etc.
When I run the function locally on my own machine, it properly exits quickly because Elasticache obviously refuses ip address of my machine, but the problem is that I can't even see the error message when I run it on lambda to see what's going on.
The Actual Question: So aside from the reason my lambda fails to connect to redis, how to get lambda properly log the error and quit on an error instead of waiting for 60 seconds and timing out?