kyagu
kyagu

Reputation: 193

How to configure vpc for a lambda and dynamodb?

I'm creating a VPC in aws, and plan to add dynamodb and lambda to access to dynamo. If dynamodb is in a private subnet, what else do i need for lambda to connect to the dynamo. If lambda is invoked by API gateway , can lambda and dynamodb be under same private subnet?

Upvotes: 0

Views: 1826

Answers (1)

ronald8192
ronald8192

Reputation: 5403

DynamoDB is not located in your VPC. If you want to access DynamoDB via the private network from Lambda, you can use the DynamoDB VPC Gateway endpoint. A route will be added to your subnet route table, all traffic to DynamoDB will route through AWS internal network.

Things to setup:

  1. Private subnet
  2. DynamoDB VPC endpoint (Gateway type, use interface type (cost $) if you want to connect via private IP)
  3. VPC Lambda
  4. If you want the API Gateway also be private, setup private API Gateway and API Gateway VPC endpoint

Upvotes: 2

Related Questions