Tutorial: Configuring a Lambda function to access amazon ElastiCache in an Amazon VPC - Amazon ElastiCache

Tutorial: Configuring a Lambda function to access amazon ElastiCache in an Amazon VPC

In this tutorial, you do the following:

  • Create an Amazon ElastiCache cache in your default Amazon Virtual Private Cloud (Amazon VPC) in the us-east-1 region.

  • Create a Lambda function to access the ElastiCache cache. When you create the Lambda function, you provide subnet IDs in your Amazon VPC and a VPC security group to allow the Lambda function to access resources in your VPC. For illustration in this tutorial, the Lambda function generates a UUID, writes it to the cache, and retrieves it from the cache.

  • Invoke the Lambda function manually and verify that it accessed the ElastiCache cache in your VPC.

Important

The tutorial uses the default Amazon VPC in the us-east-1 region in your account. For more information about Amazon VPC, see How to Get Started with Amazon VPC in the Amazon VPC User Guide.

Get Started

Step 1: Create an ElastiCache cache