CodexBloom - Programming Q&A Platform

AWS Lambda with DynamoDB Stream Not Triggering Due to IAM Policy Issues

šŸ‘€ Views: 16 šŸ’¬ Answers: 1 šŸ“… Created: 2025-06-26
aws lambda dynamodb iam JavaScript

Quick question that's been bugging me - I've been working on this all day and I'm having trouble getting my AWS Lambda function to trigger from a DynamoDB Stream... I've set up everything according to the AWS documentation, but the Lambda function never executes when changes are made in DynamoDB. My DynamoDB table has Streams enabled, and I've verified that the stream is active. However, I suspect it might be an scenario with the IAM permissions. My Lambda execution role is configured like this: ```json { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": ["lambda:InvokeFunction"], "Resource": "arn:aws:lambda:us-west-2:123456789012:function:myLambdaFunction" }, { "Effect": "Allow", "Action": ["dynamodb:DescribeStream", "dynamodb:GetRecords", "dynamodb:GetShardIterator", "dynamodb:ListStreams"], "Resource": "arn:aws:dynamodb:us-west-2:123456789012:table/myDynamoDBTable/stream/*" } ] } ``` I've double-checked that the Lambda's trigger is set to the correct DynamoDB Stream ARN, but I still see no logs indicating that my function is being invoked when I add or modify items in the DynamoDB table. The CloudWatch logs for the Lambda function show no recent invocations. Additionally, I've confirmed that the Lambda function is correctly configured to process the event format for DynamoDB Streams. I tested this by manually invoking it with a sample event, and it worked as expected. I've also tried updating the IAM role permissions to include `dynamodb:*` for debugging, but that didn't change anything. I’m at a loss here; could there be something I'm missing with the configuration or permissions? I'm on Ubuntu 22.04 using the latest version of Javascript. This issue appeared after updating to Javascript 3.9. Thanks for your help in advance! I'm working in a Windows 11 environment. Any help would be greatly appreciated!