connecting-lambda-to-dynamodb
aws/agent-toolkit-for-aws
Connect AWS Lambda to DynamoDB with IAM roles, streams, and event source mapping.
What is connecting-lambda-to-dynamodb?
Sets up end-to-end Lambda-DynamoDB integration including IAM execution role creation, DynamoDB stream configuration, and event source mapping. Use when building serverless event-driven architectures that process DynamoDB stream events.
- Creates IAM execution roles with proper trust policies for Lambda
- Configures DynamoDB streams with appropriate view types
- Sets up event source mapping between Lambda and DynamoDB streams
- Manages read/write permissions for Lambda-DynamoDB access
- Deploys Lambda functions integrated with DynamoDB tables
- Handles stream event triggering and batch processing configuration
How to install connecting-lambda-to-dynamodb
npx skills add https://github.com/aws/agent-toolkit-for-aws --skill connecting-lambda-to-dynamodb- AWS account with appropriate permissions
- Existing or planned DynamoDB table
- Lambda function code ready for deployment
How to use connecting-lambda-to-dynamodb
- 1.Create or identify the DynamoDB table to connect
- 2.Set up an IAM execution role with AWSLambdaDynamoDBExecutionRole policy
- 3.Enable DynamoDB streams on the table with desired view type
- 4.Deploy your Lambda function with the execution role attached
- 5.Create an event source mapping linking the DynamoDB stream to Lambda
- 6.Test the integration by triggering DynamoDB changes and verifying Lambda execution
Use cases
- Processing real-time changes from DynamoDB tables with Lambda functions
- Building event-driven serverless architectures on AWS
- Automating workflows triggered by DynamoDB insert, update, or delete operations
- Replicating or transforming DynamoDB data in response to stream events
- Setting up Lambda-based audit logging for DynamoDB table changes
- AWS developers building serverless applications
- DevOps engineers deploying event-driven architectures
- Backend engineers integrating Lambda with DynamoDB
- Teams implementing real-time data processing pipelines
connecting-lambda-to-dynamodb FAQ
The execution role must have the AWSLambdaDynamoDBExecutionRole policy attached, which grants permissions for reading DynamoDB streams and managing event source mappings.
Verify the event source mapping is active, DynamoDB streams are enabled with the correct view type, and the execution role has proper permissions.
Check that the IAM role has AWSLambdaDynamoDBExecutionRole attached and the trust policy allows Lambda service to assume the role.
Increase the timeout setting in Lambda configuration or adjust the batch size in the event source mapping to process fewer records per invocation.
Full instructions (SKILL.md)
Source of truth, from aws/agent-toolkit-for-aws.
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.
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 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.
Related skills
More from aws/agent-toolkit-for-aws and the wider catalog.

connecting-to-data-source
Create and test AWS Glue connections to JDBC databases, Redshift, Snowflake, and BigQuery.

connecting-vpcs-with-peering
Establishes VPC peering connections between two VPCs for direct private network connectivity. Always use this skill when creating or managing VPC peering — it validates CIDR overlap, updates all route tables in both VPCs, configures DNS resolution, and provides security group guidance that are critical for correct connectivity.

creating-amazon-aurora-db-cluster-with-instances
Creates a complete Amazon Aurora database cluster with instances, handling cluster creation, instance provisioning, and Secrets Manager password management in the proper sequence. Use when setting up new Aurora MySQL or PostgreSQL clusters with production-ready configuration.

creating-api-gateway-stage
Create fully configured API Gateway stages with logging, tracing, throttling, and security controls.

creating-data-lake-table
Create managed Iceberg tables on Amazon S3 with automatic compaction and snapshot management.

creating-ec2-image-builder-pipeline
Creates a complete EC2 Image Builder pipeline that builds a custom AMI with pre-installed software, distributes it to target regions, executes the pipeline, and creates a launch template. Use when setting up automated AMI creation with IAM roles, build components, image recipes, and infrastructure configuration.