This example describes how to use the Serverless Framework to create a microservices architecture with AWS Lambda Layers.
The original Medium Article is made with Zoi by Markus Wagner and is soon gonna be published at Medium.com
- Node.JS 10
- Serverless
See steps in article, or checkout Branch step_1, step_2 and step_3 too see the changes, or follow following instructions:
- Install node.js 10 and Serverless
- Configure AWS Account in AWS CLI
- Replace Account ID from AWS Account in outputs.json, Tutorial for getting the ID.
- Run
serverless deploy -v -stage dev
in the root folder of this project, this will deploy the dependency layer. - Change the current directory to
business-logic\
and runserverless deploy -v -stage dev
to deploy the hello World Lambda with the dependencies injected from the layer. - Checkout Lambda created by serverless in the AWS Console
IMPORTANT: dependencies-layer must be in a different folder than the business-logic, and then installed as devDependency in to the dependencieslayer and not in the business-logic. All Dependencies that are shared should be installed in to the dependencies-layer.