[{"data":1,"prerenderedAt":60},["ShallowReactive",2],{"pattern-docdb-lambda-nodejs-sam":3},{"id":4,"title":5,"architectureURL":6,"cleanup":7,"contributors":10,"deploy":12,"description":15,"extension":16,"framework":17,"gitHub":18,"highlight":6,"introBox":24,"language":30,"level":31,"meta":32,"patternArch":33,"resources":47,"s3URL":6,"services":6,"stem":55,"testing":56,"videoId":6,"__hash__":59},"patterns\u002Fpatterns\u002Fdocdb-lambda-nodejs-sam.json","Amazon DocumentDB to AWS Lambda Event Source Mapping",null,{"text":8},[9],"\u003Ccode>sam delete\u003C\u002Fcode>",[11],"content\u002Fcontributors\u002Fnikit-penkar.json",{"text":13},[14],"sam deploy --guided","Configure an AWS Lambda function to process events in an Amazon DocumentDB (with MongoDB compatibility) change stream","json","AWS SAM",{"template":19},{"repoURL":20,"templateURL":21,"projectFolder":22,"templateFile":23},"https:\u002F\u002Fgithub.com\u002Faws-samples\u002Fserverless-patterns\u002Ftree\u002Fmain\u002Fdocdb-lambda-nodejs-sam","serverless-patterns\u002Fdocdb-lambda-nodejs-sam","docdb-lambda-nodejs-sam","template.yaml",{"headline":25,"text":26},"How it works",[27,28,29],"This pattern creates an Amazon DocumentDB Cluster along with an AWS Lambda Function in the supplied VPC configurations. An Event Source Mapping (ESM) is created that will help Lambda to process the events from a Change Stream in DocumentDB.","In this tutorial, we will be creating a database 'docdbdemo' and a collection 'products'. We will be tracking changes to this 'products' collection and activate Change Streams here.","Whenever a record in the 'products' collection updates, the Lambda will receive an event and invoke the Lambda function. This function will print the event received from ESM in its CloudWatch logs.","Node.js","200",{},{"icon1":34,"icon2":39,"line1":43},{"x":35,"y":36,"service":37,"label":38},20,50,"documentdb","Amazon DocumentDB",{"x":40,"y":36,"service":41,"label":42},80,"lambda","AWS Lambda",{"from":44,"to":45,"label":46},"icon1","icon2","change stream",{"bullets":48},[49,52],{"text":50,"link":51},"Using Lambda with Amazon DocumentDB","https:\u002F\u002Fdocs.aws.amazon.com\u002Flambda\u002Flatest\u002Fdg\u002Fwith-documentdb.html",{"text":53,"link":54},"AWS Tutorial for using AWS Lambda with Amazon DocumentDB Streams","https:\u002F\u002Fdocs.aws.amazon.com\u002Flambda\u002Flatest\u002Fdg\u002Fwith-documentdb-tutorial.html","patterns\u002Fdocdb-lambda-nodejs-sam",{"text":57},[58],"See the GitHub repo for detailed testing instructions.","SJkrgUslUixviugcLuW_44YRlizdknvRK4VUFEsTeWk",1779273334686]