Mohammed Marjan
Mohammed Marjan

Reputation: 301

How To Connect AWS Lambda to DAX?

I am using AWS API gateway, Lambda services, and DynamoDB for my application. I wish to use DynamoDB Accelerator(DAX) to increase the performance. The documents are telling to create a DAX cluster, and a VPC and add both DAX cluster and lambda to VPC. Its all a bit confusing. Can anyone please give a detailed information on the steps to be followed?

Upvotes: 2

Views: 4185

Answers (1)

John Rotenstein
John Rotenstein

Reputation: 269971

DynamoDB Accelerator (DAX) is used as a caching layer 'in front' of DynamoDB.

Since DAX is launched inside an Amazon VPC, the steps would be:

  • Create an Amazon VPC, or use an existing VPC
  • Launch a DAX cluster in the VPC (preferably a private subnet, for improved security)

Applications can then access DynamoDB via DAX to take advantage of caching:

Overview of DAX

Instead of having an application access DAX, you appear to want to use it from an AWS Lambda function. In this case, your AWS Lambda function should be configured to connect to the same VPC (preferably connected to a private subnet).

The Lambda function will then be able to access the DAX cluster within the VPC. DAX itself will then connect to DynamoDB. (If the DAX cluster is in a private subnet, this will require either a NAT Gateway or a VPC Endpoint to be able to access DynamoDB from the VPC.)

Upvotes: 3

Related Questions