1 Answer
- Newest
- Most votes
- Most comments
0
Hello.
I tried connecting to Elasticache Redis Serverless from Lambda in my environment.
As a result, the connection is successful.
I used the following code for confirmation.
import redis
redis_client = redis.RedisCluster(
host='redis.serverless.apne1.cache.amazonaws.com',
ssl=True
)
def lambda_handler(event, context):
print(redis_client.ping())
- I connected Lambda to the same VPC as Elasticache.
- I allowed the security group from Lambda in the security group inbound rule I configured on Elasticache.
2.1. The inbound rule is set to allow port "6379".
So, why not try checking the connection using the above code?
I think I'm beyond that stage. I have the setup you describe, and it works with non-serverless Redis. I can even see traffic on the VPC endpoint that serverless redis adds to our VPC. My current theory is that the outbound connection from our VPC to the actual Redis VPC isn't possible.
The
ssl=true
is the important bit here. The connection we were using didn't enforce TLS, and thus hit the timeout.
Relevant content
- asked 9 months ago
- asked 3 years ago
- asked a year ago
- AWS OFFICIALUpdated 5 months ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 9 months ago
- AWS OFFICIALUpdated a month ago
The root cause for this was that we didn't connect to the serverless redis enforcing TLS/SSL. Without SSL, the connection just times out.