[{"data":1,"prerenderedAt":68},["ShallowReactive",2],{"pattern-lambda-dynamodb-cdk":3},{"id":4,"title":5,"architectureURL":6,"cleanup":7,"contributors":13,"deploy":15,"description":19,"extension":20,"framework":21,"gitHub":22,"highlight":6,"introBox":31,"language":35,"level":36,"meta":37,"patternArch":38,"resources":51,"s3URL":6,"services":60,"stem":61,"testing":62,"videoId":30,"__hash__":67},"patterns\u002Fpatterns\u002Flambda-dynamodb-cdk.json","AWS Lambda to Amazon DynamoDB",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\u002Fglenn-chia-jin-wee.json",{"text":16},[17,18],"npm i","npx cdk deploy","Persist an item to a DynamoDB table from a Lambda function","json","AWS CDK",{"template":23,"payloads":28},{"projectFolder":24,"repoURL":25,"templateURL":26,"templateFile":27},"lambda-dynamodb-cdk","https:\u002F\u002Fgithub.com\u002Faws-samples\u002Fserverless-patterns\u002Ftree\u002Fmain\u002Flambda-dynamodb-cdk","serverless-patterns\u002Flambda-dynamodb-cdk","cdk\u002Flib\u002Fcdk-stack.ts",[29],{"headline":30,"payloadURL":30},"",{"headline":32,"text":33,"test":30},"How it works",[34],"This project contains a sample AWS Cloud Development Kit (AWS CDK) template for deploying a Lambda function that makes puts to a DynamoDB table.","TypeScript","200",{},{"icon1":39,"icon2":44,"line1":48},{"x":40,"y":41,"service":42,"label":43},20,50,"lambda","AWS Lambda",{"x":45,"y":41,"service":46,"label":47},80,"dynamodb","Amazon DynamoDB",{"from":49,"to":50,"label":30},"icon1","icon2",{"headline":52,"bullets":53},"Additional resources",[54,57],{"text":55,"link":56},"AWS Docs: Writing Data to a Table","https:\u002F\u002Fdocs.aws.amazon.com\u002Famazondynamodb\u002Flatest\u002Fdeveloperguide\u002FSQLtoNoSQL.WriteData.html",{"text":58,"link":59},"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":42,"to":46},"patterns\u002Flambda-dynamodb-cdk",{"headline":63,"text":64},"Testing",[65,66],"Run the following Lambda CLI invoke command to invoke the function. Note, you must edit the {LambdFunctionArn} placeholder with the ARN of the deployed Lambda function. This is provided in the stack outputs.","\u003Ccode>aws lambda invoke --function-name {LambdFunctionArn} --invocation-type Event --payload '{ \"Metadata\": \"Hello\" }' response.json --cli-binary-format raw-in-base64-out\u003C\u002Fcode>","JBFubMDAJDmtvvAeVTVnnLn7vMl_YxkNumVOra4lTQk",1778927709331]