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:
- Login IAM, select Roles under Access management in the left sidebar, click on the Create role button.
- In the Select type of trusted entity section, select AWS service and select Lambda in the Choose a use case section.