[{"data":1,"prerenderedAt":68},["ShallowReactive",2],{"pattern-dynamodb-lambda":3},{"id":4,"title":5,"architectureURL":6,"cleanup":7,"contributors":12,"deploy":14,"description":17,"extension":18,"framework":19,"gitHub":20,"highlight":6,"introBox":30,"language":36,"level":37,"meta":38,"patternArch":39,"resources":52,"s3URL":6,"services":61,"stem":62,"testing":63,"videoId":35,"__hash__":67},"patterns\u002Fpatterns\u002Fdynamodb-lambda.json","Amazon DynamoDB to AWS Lambda",null,{"headline":8,"text":9},"Cleanup",[10,11],"1. Delete the stack: \u003Ccode>sam delete --stack-name STACK_NAME\u003C\u002Fcode>.","2. Confirm the stack has been deleted: \u003Ccode>aws cloudformation list-stacks --query \"StackSummaries[?contains(StackName,'STACK_NAME')].StackStatus\"\u003C\u002Fcode>",[13],"content\u002Fcontributors\u002Fjames-beswick.json",{"text":15},[16],"sam deploy --guided","Invoke a Lambda function from changes to a DynamoDB table","json","AWS SAM",{"template":21,"payloads":26},{"projectFolder":22,"repoURL":23,"templateURL":24,"templateFile":25},"dynamodb-lambda","https:\u002F\u002Fgithub.com\u002Faws-samples\u002Fserverless-patterns\u002Ftree\u002Fmain\u002Fdynamodb-lambda","serverless-patterns\u002Fdynamodb-lambda","template.yaml",[27],{"headline":28,"payloadURL":29},"Sample Lambda payload","lambda-dynamodb\u002Fevents\u002FinputFile.txt",{"headline":31,"text":32,"test":35},"How it works",[33,34],"The SAM template deploys a Lambda function, a DynamoDB table, and the minimum IAM resources required to run the application.","When items are written or updated in the DynamoDB table, the changes are sent to a stream. This pattern configures a Lambda function to poll this stream. The function is invoked with a payload containing the contents of the table item that changed.","","Node.js","200",{},{"icon1":40,"icon2":45,"line1":49},{"x":41,"y":42,"service":43,"label":44},20,50,"dynamodb","Amazon DynamoDB",{"x":46,"y":42,"service":47,"label":48},80,"lambda","AWS Lambda",{"from":50,"to":51,"label":35},"icon1","icon2",{"headline":53,"bullets":54},"Additional resources",[55,58],{"text":56,"link":57},"AWS Docs: DynamoDB Streams and AWS Lambda Triggers","https:\u002F\u002Fdocs.aws.amazon.com\u002Famazondynamodb\u002Flatest\u002Fdeveloperguide\u002FStreams.Lambda.html",{"text":59,"link":60},"Creating a scalable serverless import process for Amazon DynamoDB","https:\u002F\u002Faws.amazon.com\u002Fblogs\u002Fcompute\u002Fcreating-a-scalable-serverless-import-process-for-amazon-dynamodb\u002F",{"from":43,"to":47},"patterns\u002Fdynamodb-lambda",{"headline":64,"text":65},"Testing",[66],"After deployment, add an item to the DynamoDB table. Go to the CloudWatch Logs for the deployed Lambda function. You will see the event is logged out containing the item data.","QufmP3ee5mVfujeVnydXn3J6o3dlXLFgu-NA2Ngh8sU",1778927707237]