-1

I have an Aws Lambda function which is in VPC, and also an Aws Redis Elasticache which is also in same VPC. I would like to put data to this cache by using Jedis Java client in my Aws Lambda Function, code is like below,

Jedis jedis = new Jedis("cache_url",6379);
jedis.set("testkey", "testvalue");

However, when i try to call this code block, i got an exception connect timeout

My Aws Lambda function is triggered by an Aws IOT Rule very frequently. What can cause this error?, or How can i use Jedis at my Aws Lambda function appropriately.

Arda Güçlü
  • 728
  • 2
  • 6
  • 27

1 Answers1

1

The Connection Timeout would typically mean that the Lambda is not able to talk to you Elasticache. Check the security group on the Elasticache and make sure that it has Inbound rule to allow TCP connections on 6379.

Yogesh_D
  • 17,656
  • 10
  • 41
  • 55