[{"data":1,"prerenderedAt":69},["ShallowReactive",2],{"pattern-dynamodb-lambda-cdk":3},{"id":4,"title":5,"architectureURL":6,"cleanup":7,"contributors":13,"deploy":15,"description":18,"extension":19,"framework":20,"gitHub":21,"highlight":6,"introBox":31,"language":37,"level":38,"meta":39,"patternArch":40,"resources":53,"s3URL":6,"services":62,"stem":63,"testing":64,"videoId":36,"__hash__":68},"patterns\u002Fpatterns\u002Fdynamodb-lambda-cdk.json","Amazon DynamoDB to AWS Lambda",null,{"headline":8,"text":9},"Cleanup",[10,11,12],"1. Delete the stack: \u003Ccode>npx cdk destroy\u003C\u002Fcode>.","2. Confirm the stack has been deleted: \u003Ccode>aws cloudformation list-stacks --query \"StackSummaries[?contains(StackName,'STACK_NAME')].StackStatus\"\u003C\u002Fcode>.","3. You see a message confirming DELETE_COMPLETE.",[14],"content\u002Fcontributors\u002Frohan-mehta.json",{"text":16},[17],"cdk deploy","Invoke a Lambda function from changes to a DynamoDB table","json","AWS CDK",{"template":22,"payloads":27},{"projectFolder":23,"repoURL":24,"templateURL":25,"templateFile":26},"dynamodb-lambda-cdk","https:\u002F\u002Fgithub.com\u002Faws-samples\u002Fserverless-patterns\u002Ftree\u002Fmain\u002Fdynamodb-lambda-cdk","serverless-patterns\u002Fdynamodb-lambda-cdk","src\u002Flib\u002Fdynamo-to-lambda-cdk-stack.ts",[28],{"headline":29,"payloadURL":30},"Sample Lambda payload","lambda-dynamodb\u002Fevents\u002FinputFile.txt",{"headline":32,"text":33,"test":36},"How it works",[34,35],"The CDK stack 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":41,"icon2":46,"line1":50},{"x":42,"y":43,"service":44,"label":45},20,50,"dynamodb","Amazon DynamoDB",{"x":47,"y":43,"service":48,"label":49},80,"lambda","AWS Lambda",{"from":51,"to":52,"label":36},"icon1","icon2",{"headline":54,"bullets":55},"Additional resources",[56,59],{"text":57,"link":58},"AWS Docs: DynamoDB Streams and AWS Lambda Triggers","https:\u002F\u002Fdocs.aws.amazon.com\u002Famazondynamodb\u002Flatest\u002Fdeveloperguide\u002FStreams.Lambda.html",{"text":60,"link":61},"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":44,"to":48},"patterns\u002Fdynamodb-lambda-cdk",{"headline":65,"text":66},"Testing",[67],"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.","gC5_J2QogHgyTlrt50wEYa_u5LfKq6Qeh9oXsENDl_Y",1778846884119]