Search code examples
amazon-web-servicescachingredisaws-lambdaamazon-elasticache

How to get secure access from AWS Lambda to Redis? Is VPC required?


I need to cache some data in Redis and get access to it from AWS Lambda. How can I get secure access from AWS Lambda to Redis (AWS Elastic cache)?

Is VPC required? Because I know that VPC increase 1) AWS Lambdas cold starts 2) increase bills (network usage).


Solution

  • Yes, you will need a VPC to connect to Redis.

    AWS allows using lambda functions to connect to Elasticache. Here is a link how it works - Tutorial: Configuring a Lambda Function to Access Amazon ElastiCache in an Amazon VPC

    Also, I agree with VPC increasing cold starts, you can probably work around that by doing warmups and sharing context across Lambda invocations. More details can be found here.