This tutorial uses @upstash/redis which is designed for serverless runtimes for efficient connection handling. You can use your favorite Redis client, but you may have to deal with connection issues as described here.
Create a Redis database using Upstash Console or
Upstash CLI. Select the same region with your
AWS Lambda to minimize the latency. Copy the UPSTASH_REDIS_REST_URL
and
UPSTASH_REDIS_REST_TOKEN
for the next steps.
We will use Serverless Framework but you can use AWS SAM or others.
Run npx serverless
and select the AWS - Node.js - HTTP API
Install dependencies:
Update handler.js
as below and replace UPSTASH_REDIS_REST_URL
and
UPSTASH_REDIS_REST_TOKEN
:
Deploy your function with npx serverless deploy
The endpoint of the AWS Lambda function will be printed.
https://github.com/upstash/upstash-redis/tree/main/examples/aws-lambda
This tutorial uses @upstash/redis which is designed for serverless runtimes for efficient connection handling. You can use your favorite Redis client, but you may have to deal with connection issues as described here.
Create a Redis database using Upstash Console or
Upstash CLI. Select the same region with your
AWS Lambda to minimize the latency. Copy the UPSTASH_REDIS_REST_URL
and
UPSTASH_REDIS_REST_TOKEN
for the next steps.
We will use Serverless Framework but you can use AWS SAM or others.
Run npx serverless
and select the AWS - Node.js - HTTP API
Install dependencies:
Update handler.js
as below and replace UPSTASH_REDIS_REST_URL
and
UPSTASH_REDIS_REST_TOKEN
:
Deploy your function with npx serverless deploy
The endpoint of the AWS Lambda function will be printed.
https://github.com/upstash/upstash-redis/tree/main/examples/aws-lambda