C#C
C#7mo ago
Ykarus

✅ Redis Cloud in AWS Lambda

Hello,

Im having some troubles connecting to my Redis cache, hosted on Redis Cloud.
In my setup code, I create a connection object as such:

services.AddSingleton<IConnectionMultiplexer>(_ => ConnectionMultiplexer.Connect(
   new ConfigurationOptions{
     EndPoints = { {emailVerificationCacheEndpoint, 19041} },
     User ="default",
     Password = emailVerificationCachePassword,
     AbortOnConnectFail = false,
     ConnectTimeout = 5000,
     KeepAlive = 180,
  }));


When I run my test code locally, through a docker container, everything works nicely.
However, when I run it on an AWS Lambda, through the same Docker container, I get a connection timeout error.
"errorType": "RedisConnectionException",
"errorMessage": "The message timed out in the backlog attempting to send because no connection became available (5000ms) - Last Connection Exception: It was not possible to connect to the redis server(s) "redis-..."


Why could that be? How could I even go about debugging this?
Was this page helpful?