However, the problem is that ElastiCache clusters can only be accessed by the services that are present in the same Virtual Private Cloud – VPC as ElastiCache.
So here is a quick example explaining how to set up a serverless function and ElastiCache cluster under a VPC.
1 – Setting up a VPC
- Login to the AWS Console, and open https://console.aws.amazon.com/vpc/
- Choose Start VPC Wizard
- From navigation, list choose VPC with Public and Private subnets
- Keep the default options, and then choose to Create VPC