DynamoDB 101 — Connect to DynamoDB in Lambda function

Connecting to DynamoDB from Lambda is even easier than you can think of.

Firstly, you need to create an execution role which later you can attach to the lambda function. To do so:

  1. Login IAM, select Roles under Access management in the left sidebar, click on the Create role button.
  2. In the Select type of trusted entity section, select AWS service and select Lambda in the Choose a use case section.