A while back, a client asked me “how can I share business logic between services in a Node.js monorepo?”. So here it is! Encapsulate the shared business logic into modules, and put them in a separate folder. In the Lambda handler functions, reference the shared modules using relative paths. Use webpack to resolve and bundle them into the deployment package. If you use the Serverless framework, then check out the plugin. For example: serverless-webpack .You can do this with a simple script like the following. Deploy every service on every commit To see how everything fits together, check out . It has CI/CD set up already through and you can see a recent deployment of all the services in the monorepo . this demo repo drone.io here But wait! How do I choose between having a monorepo vs a repo per service? Don’t worry, I’ve got you covered for that too ;-) You can read about my thoughts on the two approaches . here Hi, my name is . I’m an and the author of . I have run production workload at scale in AWS for nearly 10 years and I have been an architect or principal engineer with a variety of industries ranging from banking, e-commerce, sports streaming to mobile gaming. I currently work as an independent consultant focused on AWS and serverless. Yan Cui AWS Serverless Hero Production-Ready Serverless You can contact me via , and . Email Twitter LinkedIn Check out my new course, . Complete Guide to AWS Step Functions In this course, we’ll cover everything you need to know to use AWS Step Functions service effectively. Including basic concepts, HTTP and event triggers, activities, design patterns and best practices. Get your copy . here Come learn about operational for AWS Lambda: CI/CD, testing & debugging functions locally, logging, monitoring, distributed tracing, canary deployments, config management, authentication & authorization, VPC, security, error handling, and more. BEST PRACTICES You can also get off the face price with the code . 40% ytcui Get your copy . here Originally published at https://theburningmonk.com on June 29, 2019.