[{"data":1,"prerenderedAt":71},["ShallowReactive",2],{"pattern-s3-lambda-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":32,"language":38,"level":39,"meta":40,"patternArch":41,"resources":55,"s3URL":6,"services":64,"stem":65,"testing":66,"videoId":37,"__hash__":70},"patterns\u002Fpatterns\u002Fs3-lambda-cdk.json","Amazon S3 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\u002Fmario-fonteles.json",{"text":16},[17,18],"npm install","cdk deploy","Create a Lambda function that resizes images uploaded to S3.","json","AWS CDK",{"template":23,"payloads":28},{"projectFolder":24,"repoURL":25,"templateURL":26,"templateFile":27},"s3-lambda-cdk","https:\u002F\u002Fgithub.com\u002Faws-samples\u002Fserverless-patterns\u002Ftree\u002Fmain\u002Fs3-lambda-cdk","serverless-patterns\u002Fs3-lambda-cdk","src\u002Flib\u002Fs3-to-lambda-cdk-stack.ts",[29],{"headline":30,"payloadURL":31},"Sample Lambda payload","3-lambda-lambda\u002Fevents\u002FinputFile.txt",{"headline":33,"text":34,"test":37},"How it works",[35,36],"This CDK stack deploys a Lambda function, a S3 bucket, and the minimum IAM resources required to run the application.","When items are written in the S3 bucket, the changes are sent to a stream. This pattern configures a Lambda function to poll this stream, and log some information to CloudWatch. The function is invoked with a payload containing the information of the event.","","Node.js","200",{},{"icon1":42,"icon2":47,"line1":51},{"x":43,"y":44,"service":45,"label":46},20,50,"s3","S3",{"x":48,"y":44,"service":49,"label":50},80,"lambda","AWS Lambda",{"from":52,"to":53,"label":54},"icon1","icon2","ObjectCreated:PUT",{"headline":56,"bullets":57},"Additional resources",[58,61],{"text":59,"link":60},"Tutorial: Using AWS Lambda with Amazon S3","https:\u002F\u002Fdocs.aws.amazon.com\u002Flambda\u002Flatest\u002Fdg\u002Fwith-s3-example.html",{"text":62,"link":63},"Blog Series: Building scalable serverless applications with Amazon S3 and AWS Lambda.","https:\u002F\u002Faws.amazon.com\u002Fblogs\u002Fcompute\u002Fbuilding-scalable-serverless-applications-with-amazon-s3-and-aws-lambda\u002F",{"from":45,"to":49},"patterns\u002Fs3-lambda-cdk",{"headline":67,"text":68},"Testing",[69],"See the GitHub repo for detailed testing instructions.","Vr3_utzDXeP5OPboBmTzWZeo6XrAR8-AAaGpkQOFEPw",1779273338643]