Skip to content

Welcome to the LEANSTACKS SAM Samples project. This repository contains samples and snippets of AWS Serverless Application Model code.

License

Notifications You must be signed in to change notification settings

leanstacks/sam-samples

Repository files navigation

SAM Samples

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.

Acknowledgements

This is a LEANSTACKS solution.

What's Inside

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.

rest-hello

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.

rest-dynamodb

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.

rest-dynamodb-local

The rest-dynamodb-local sample builds upon the rest-dynamodb sample. This sample demonstrates how to run the SAM application locally with DynamoDB.

rest-dynamodb-modular

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.

rest-middy

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.

rest-middy-modular

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.

See Also

LEANSTACKS
LEANSTACKS Serverless [Framework] Samples
AWS Serverless Application Model
AWS SAM Documentation
AWS SAM Examples Repository

About

Welcome to the LEANSTACKS SAM Samples project. This repository contains samples and snippets of AWS Serverless Application Model code.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published