Samples and snippets of application components constructed using AWS SAM, Serverless Application Model.
All samples are authored in JavaScript for the Node.js AWS Lambda runtime.
This is a LEANSTACKS solution.
Each sub-directory contains a sample project illustrating a specific feature or group of features. Some samples build upon concepts from other samples.
If you are new to serverless software engineering or simply looking for a table of contents, the list below is a general guideline for exploring the samples in this repository in a meaningful order.
The rest-hello sample is an introduction to AWS SAM. Deploy a "Hello World" REST API application demonstrating how to handle events from the API Gateway in AWS Lambda.
The rest-dynamodb sample introduces using DynamoDB with AWS SAM. This is a basic example of how to implement REST API endpoints which provide CRUD operations for a simple business domain "Item". Data for the REST resource is persisted in DynamoDB.
This sample application is the introductory example for using DynamoDB. This project contains other DynamoDB samples which build upon this one.
The rest-dynamodb-local sample builds upon the rest-dynamodb
sample. This sample demonstrates how to run the SAM application locally with DynamoDB.
The rest-dynamodb-modular sample illustrates how to implement REST services with a more modular code structure. This sample builds on the rest-dynamodb-local
sample. Many of the samples in this project illustrate a particular Serverless concept and all of the logic is contained within the function handler. While this serves to illustrate the concept of the example, it is not meant to illustrate best practices when creating serverless applications.
The rest-middy sample SAM application introduces the Middy
middleware package. Middy allows you to reduce boilerplate code, moving it into reusable middlewares which you may reuse across your functions. This allows your engineers to focus on the business logic of the function rather than the non-functional code.
The rest-middy-modular sample SAM application builds upon the rest-middy
sample. This sample demonstrates how to organize the source into a more modular structure with the Single Responsibility Principle (SRP) in mind. This sample also demonstrates how to create your own Middy middleware.
LEANSTACKS
LEANSTACKS Serverless [Framework] Samples
AWS Serverless Application Model
AWS SAM Documentation
AWS SAM Examples Repository