banner

KuchBhiLearning - A free website to learn and code

This is a good learning site. This contains details of cloud computing, AWS, AWS-CDK, AWS-SDK codes and examples including S3, Redis, lambda, api-gateway, cloudfront, cloudformation.

AWS Lambda REDIS connection timeout

AWS Lambda REDIS connection timeout

 Redis elasticache is widely used for storing the cache, and AWS is providing Redis.

Now the question is we have built a lambda and written the code for REDIS CRUD operation.

But lambda is not able to connect or we are getting timeout error.

In these cases there are multiple reason that could possibly the reason behind the issue.

In this article we are listing the possible reasons, which is worth to try.

 Check if lambda is in same VPC as Redis

Lambda and Redis needs to be in same VPC network. Connection timeout can occur if they are not in same VPC.

Redis Quit

Sometimes if we did not close/quit the Redis then also this can occur.

But we can do one small test where if we can connect through ec2.

if you have EC2 access, install redis-cli and try to connect Redis. If this get connected your Lambda Redis will also get connected. 

You can also use Redis Commander npm package in ec2 and setup the Redis.


No comments:

Post a Comment

If you have any doubts, Please let me know

Copyright 2022, KuchBhiLearning - A free website to learn and code. All rights Reserved.
| Designed by Yaseen Shariff