# connecting-lambda-to-dynamodb

Wires a Lambda function to a DynamoDB table with an IAM execution role, read and write permissions, and stream event processing.

Skill by Amazon Web Services. Category: Data and backend.

## Install

Project (for this project only):

```sh
npx skills add aws/agent-toolkit-for-aws --skill connecting-lambda-to-dynamodb
```

Works with: Claude Code, Codex CLI, Cursor, Antigravity, Copilot CLI, opencode.

Global (for every project on this machine):

```sh
npx skills add aws/agent-toolkit-for-aws --skill connecting-lambda-to-dynamodb -g
```

Works with: Claude Code, Codex CLI, Cursor, Antigravity, Copilot CLI, opencode.

## Tags

- Runs on your computer: It runs as a program on your machine, with your access.

## Security audits

- Gen Agent Trust Hub: Pass
- Socket: Pass
- Snyk: Pass

Installs: 5907. Installs counted by skills.sh. [Open on skills.sh](https://www.skills.sh/aws/agent-toolkit-for-aws/connecting-lambda-to-dynamodb)

## Source

[Open the source](https://github.com/aws/agent-toolkit-for-aws/tree/HEAD/skills/specialized-skills/serverless-skills/connecting-lambda-to-dynamodb). Checked 2026-10-10. This summary may contain AI-generated text, so it can be wrong. Check the source before you rely on it.

## SKILL.md

````markdown
---
name: connecting-lambda-to-dynamodb
description: Connects an AWS Lambda function to DynamoDB with IAM roles, stream event source mapping, and read/write permissions. Use when setting up Lambda-DynamoDB integration, processing DynamoDB stream events, or deploying serverless event-driven architectures.
version: 1
---
# Connecting Lambda to DynamoDB

## Overview

Domain expertise for connecting AWS Lambda functions to DynamoDB tables, including
IAM execution role creation, function deployment, DynamoDB stream configuration,
and event source mapping setup.

## Connect a Lambda function to DynamoDB

To set up end-to-end Lambda-DynamoDB integration with IAM roles, streams, and
event source mapping, follow the procedure exactly.
See [Lambda-DynamoDB connection procedure](references/lambda-dynamodb-connection.md).

## Troubleshooting

### Lambda function not triggering
Verify the event source mapping is active, DynamoDB streams are enabled with the
correct view type, and the execution role has proper permissions. See the full
[procedure](references/lambda-dynamodb-connection.md) for details.

### Permission denied errors
Check the IAM role has `AWSLambdaDynamoDBExecutionRole` attached and the trust
policy allows Lambda to assume it.

### Function timeout issues
Increase the timeout setting or adjust the batch size in the event source mapping.
````

- Previous: [aws-sdk-swift-usage](https://syn4pse.dev/terminal/aws-sdk-swift-usage.md)
- Next: [troubleshooting-application-failures](https://syn4pse.dev/terminal/troubleshooting-application-failures.md)
- [Terminal](https://syn4pse.dev/terminal.md)
- [Suggest a change](mailto:terminal@syn4pse.dev?subject=Terminal%20suggestion)
