

? Enter a name for the project (amplify-layer) The selection & output should look something like this. In the project directory initialize Amplify by running amplify initįor this example, accept all of the default values.

Next change directory into the newly created project cd amplify-layer Open your Terminal and create a project directory by running the following command. If you have an existing Amplify project, you can skip to the next section. If you haven’t configured the Amplify CLI yet, follow this guide on our documentation page.įirst, create your project directory.Open terminal and run npm install -g to update to the latest Amplify CLI.A Lambda function that uses this layer to access Moment.js to generate a timestamp as a response.A Lambda layer that packages the Moment.js library (a time utility library).Add a Lambda layer to a Lambda function.Use Amplify CLI to set up a new Lambda layer with a node module.Faster deployments! Iterating on your Lambda function will be significantly faster because it can be independently updated from the layer which usually contains the bulk of large static content!Īmplify CLI provides a guided creation, update and deployment process for Lambda layer designed for NodeJS, and Python.A developer’s dream – no more messy code duplication! Re-use your code! Your Lambda functions can leverage these layers to reuse shared code & assets across functions.Lambda layer provides a few major benefits for your full stack serverless codebase: A layer is a ZIP archive that contains libraries, a custom runtime, or other dependencies. Today, we are announcing the general availability of Lambda layer support in Amplify CLI. The Amplify CLI helps developers to create backend resources through a guided workflow. In this guide you will learn how to create, deploy and leverage Lambda layers & the Amplify CLI to reuse code & assets across serverless functions.ĪWS Amplify enables mobile & web developers to build full stack serverless apps. This post was written by Rene Brandel, Senior Product Manager, AWS
