A set of serverless functions using elasticache (redis) within VPC
In order to install and run this example you need an AWS accounts credentials configured with your system. To get started with AWS account configuration, please follow this link
- Clone aws-node-elasticache-vpc and install npm packages
git clone [email protected]:ankkho/aws-node-elasticache-vpc.git
cd aws-node-elasticache-vpc
npm install
export REGION='your-desired-aws-region' eg: 'ap-south-1'
NOTE
Before you run
sls deploy
. Comment line number 17 and from 28-34. Else you'll get an error, since serverless try to fetch (elasticache and vpc) resources which are not currently present.
Once deployment is done uncomment those lines and run
sls deploy
once again.
Deploy using sls deploy
sls deploy
NAT Gateway is included in CF template, but it's not included in AWS Free Tier. You will be charged for using NAT Gateway.
Instead of using NAT Gateway you can use NAT Instance. A NAT Instance allows you to use ec2 instance with NAT image provided by AWS. Check out docs.
functions -- contains all business logic required for a function
handler.js -- lambda handler
lib -- acts as middleware. You can perform following types of operations: schema validation, check users role (if any) etc..