I had everything working very nicely with a CloudFormation template that created an API Gateway with proxy integrations to Lambda functions, which in turn manipulated various DynamoDB tables.
Lately, though, I've started to experience the shortcomings of DynamoDB and it's read/write workers. So, I thought, I will enable DynamoDB DAX to speed things up with its caching.
I had no problems getting the CloudFormation template setup to build the DAX cluster.
But when I tried to connect to DAX from Lambda functions I get errors such as NoRouteException: not able to resolve address
. Searching around, it turns out that since DAX is in a VPC, Lambda functions of course cannot access. The Lambda functions must also be in the VPC.
But if I put the Lambda functions in the VPC, then API Gateway cannot presumably access the Lambda functions via proxy integration.
So, how to orchestrate API Gateway -> Lambda -> DAX within the VPC?
It seems loopy that DAX cannot easily be used by the common API Gateway -> Lambda pattern. The VPC requirement is a real killer, and it really means that DAX is mostly only useful for EC2 instances, vs API -> Lambda.
Any ideas?