I have a lambda application that needs to access Elasticache with Memcached engine.
I have configured my elasticache correctly, and can even access it from Elastic beanstalk. I have connected to my node via telnet for testing as well.
To access elasticache from Lambda, I have done the following:
- Configured my cache, and confirmed connecting, setting and getting cached items from my node
- Setup my function to run off of the same VPC as my cluster
- Assigned my function the subnet used by my cache (Subnet group), and resides in the same VPC.
- Assigned my function the Security group that opens port 11211
- My function Role has the following policies attached (AWSLambdaFUllAccess, AWSLambdaBasicExecutionRole and AWSLambdaVPCAccessExecutionRole).
Is there something else I need to be doing?
I get the following in the logs
Error Enyim.Caching.MemcachedClient: Create PooledSocket
Error Enyim.Caching.MemcachedClient: Could not init pool.
Debug Enyim.Caching.MemcachedClient: Mark as dead was requested for
Unspecified/mynodeurl.cache.amazonaws.com:11211
Debug Enyim.Caching.MemcachedClient: FailurePolicy.ShouldFail(): True
Warning Enyim.Caching.MemcachedClient: Marking node
Unspecified/mynodeurl.cache.amazonaws.com:11211 as dead
Debug Enyim.Caching.MemcachedClient: Node
Unspecified/mynodeurl.cache.amazonaws.com:11211 is dead.
Debug Enyim.Caching.MemcachedClient: Starting the recovery timer.
Debug Enyim.Caching.MemcachedClient: Timer started.
Information Enyim.Caching.MemcachedClient: MemcachedInitPool-cost: 43.048ms
Debug Enyim.Caching.MemcachedClient: Acquiring stream from pool.
Unspecified/mynodeurl.cache.amazonaws.com:11211
Debug Enyim.Caching.MemcachedClient: Pool is dead or disposed, returning null
Unspecified/mynodeurl.cache.amazonaws.com:11211
EnyimMemcached Started.
Thanks