msfidelis / Serverless Architecture Boilerplate
Licence: mit
๐ฆ โก๏ธ ๐ Boilerplate to organize and deploy big projects using AWS API Gateway and AWS Lambda with Serverless Framework
Stars: โญ 269
Programming Languages
javascript
184084 projects - #8 most used programming language
python
139335 projects - #7 most used programming language
Projects that are alternatives of or similar to Serverless Architecture Boilerplate
Ng Toolkit
โญ๏ธ Angular tool-box! Start your PWA in two steps! Add Serverless support for existing projects and much more
Stars: โญ 1,116 (+314.87%)
Mutual labels: aws, serverless, aws-lambda, boilerplate
Terraform Aws Lambda
Terraform module, which takes care of a lot of AWS Lambda/serverless tasks (build dependencies, packages, updates, deployments) in countless combinations
Stars: โญ 190 (-29.37%)
Mutual labels: aws, serverless, aws-lambda
Aws Lambda Typescript
This sample uses the Serverless Application Framework to implement an AWS Lambda function in TypeScript, deploy it via CloudFormation, publish it through API Gateway to a custom domain registered on Route53, and document it with Swagger.
Stars: โญ 228 (-15.24%)
Mutual labels: aws, serverless, aws-lambda
Rust Crowbar
Wrapper to simplify writing AWS Lambda functions in Rust (using the Python execution environment)
Stars: โญ 198 (-26.39%)
Mutual labels: aws, serverless, aws-lambda
Aws Lambda Haskell Runtime
โกHaskell runtime for AWS Lambda
Stars: โญ 223 (-17.1%)
Mutual labels: aws, serverless, aws-lambda
Serverless Chrome
๐ Run headless Chrome/Chromium on AWS Lambda
Stars: โญ 2,625 (+875.84%)
Mutual labels: aws, serverless, aws-lambda
Aws Lambda Power Tuning
AWS Lambda Power Tuning is an open-source tool that can help you visualize and fine-tune the memory/power configuration of Lambda functions. It runs in your own AWS account - powered by AWS Step Functions - and it supports three optimization strategies: cost, speed, and balanced.
Stars: โญ 3,040 (+1030.11%)
Mutual labels: aws, serverless, aws-lambda
Serverlessish
Run the same Docker images in AWS Lambda and AWS ECS
Stars: โญ 177 (-34.2%)
Mutual labels: aws, serverless, aws-lambda
Serverless Haskell
Deploying Haskell applications to AWS Lambda with Serverless
Stars: โญ 204 (-24.16%)
Mutual labels: aws, serverless, aws-lambda
Retinal
๐ Retinal is a Serverless AWS Lambda service for resizing images on-demand or event-triggered
Stars: โญ 208 (-22.68%)
Mutual labels: aws, serverless, aws-lambda
Serverlessbydesign
A visual approach to serverless development. Think. Build. Repeat.
Stars: โญ 254 (-5.58%)
Mutual labels: aws, serverless, aws-lambda
Components
The Serverless Framework's new infrastructure provisioning technology โ Build, compose, & deploy serverless apps in seconds...
Stars: โญ 2,259 (+739.78%)
Mutual labels: aws, serverless, aws-lambda
Middy
๐ต The stylish Node.js middleware engine for AWS Lambda
Stars: โญ 2,592 (+863.57%)
Mutual labels: aws, serverless, aws-lambda
Algnhsa
AWS Lambda Go net/http server adapter
Stars: โญ 226 (-15.99%)
Mutual labels: aws, serverless, aws-lambda
Chrome Aws Lambda
Chromium Binary for AWS Lambda and Google Cloud Functions
Stars: โญ 2,502 (+830.11%)
Mutual labels: aws, serverless, aws-lambda
Aws Cdk Changelogs Demo
This is a demo application that uses modern serverless architecture to crawl changelogs from open source projects, parse them, and provide an API and website for viewing them.
Stars: โญ 197 (-26.77%)
Mutual labels: aws, serverless, aws-lambda
Laconia
Create well-crafted serverless applications, effortlessly
Stars: โญ 260 (-3.35%)
Mutual labels: aws, serverless, aws-lambda
Cartoonify
Deploy and scale serverless machine learning app - in 4 steps.
Stars: โญ 157 (-41.64%)
Mutual labels: aws, serverless, aws-lambda
Serverless Aws Alias
Alias support for Serverless 1.x
Stars: โญ 171 (-36.43%)
Mutual labels: aws, serverless, aws-lambda
Dialetus Service
API to Informal dictionary for the idiomatic expressions that each Brazilian region It has
Stars: โญ 202 (-24.91%)
Mutual labels: aws, serverless, aws-lambda
Serverless Architecture Boilerplate
CI / CD Pipeline
Need a Codepipeline Structure to deploy your Serverless Project with Quality? See this repo!
Serverless Archictecture Boilerplate with Go?
Looking for boilerplates to organize big projects using AWS Lambda with Go? See this repo
Structure
.
โโโ modules (modules folder)
โ โโโ books (module / context)
โ โโโ endpoints (API endpoints)
โ โ โโโ create.js
โ โ โโโ delete.js
โ โ โโโ read.js
โ โ โโโ update.js
โ โโโ functions (workers / background functions)
โ โโโ worker
โ โโโ handler.js
โโโ package.json
โโโ serverless.yml (serverless config)
โโโ handlers (functions config)
โ โโโ books-endpoints.yml (endpoints config)
โ โโโ books-workers.yml (workers config)
โโโ shared (shared components)
โ โโโ lib (shared libraries)
โ โโโ dynamo.js
โ โโโ kinesis.js
โ โโโ lambda.js
โ โโโ parsers.js
โ โโโ sqs.js
โ โโโ uuid.js
โโโ test (tests folder)
โโโ unit (unit tests folder)
โโโ modules (unit tests for modules)
โ โโโ books
โโโ shared (unit tests for shared components)
โโโ lib (unit tests for libraries)
โโโ dynamo.test.js
โโโ kinesis.test.js
โโโ parsers.test.js
โโโ sqs.test.js
โโโ uuid.test.js
Functions
HTTP Trigger Function (API Gateway)
functions:
# API Endpoints
books-register:
handler: modules/books/endpoints/create.create #Path to function
memorySize: 128 # Lambda Memory Limit
timeout: 60 # Lambda Timeout
events:
- http: # HTTP Trigger
path: services/books # API Endpoint
method: post # HTTP Method
Cloudwatch Events Functions (Cron)
# Background Function
books-consumer:
handler: modules/books/functions/worker/handler.worker #Path to function
events:
- schedule: #Cloudwatch Event Trigger
rate: cron(* * * * * *) # Cron Syntax
enabled: true # Trigger Enabled
Development environment
This boilerplate uses serverless-local
plugin and some containers and plugins to emulate the AWS Resources
docker-compose up
The applications will start on http://localhost:3000
Dev Plugins
This boilerplate contains following plugins for local development:
- serverless-offline - For run API Gateway local and manage plugins
- serverless-offline-scheduler - CloudWatch Schedule Adapter
- serverless-offline-sqs-esmq - SQS Adapter
- serverless-dynamodb-local - DynamoDB Adapter
- serverless-plugin-split-stacks - Split Cloudformation Templates
Production environment
Deploy full services
serverless deploy -v
Deploy a function
serverless deploy function -f books-consumer
Get function logs
serverless books-consumer -f bananinha -t
Clean All
serverless remove
Testing
Create Book
curl -X POST \
-H "Content-Type: application/json" \
-d '{"title": "American Gods", "author": "Neil Gaiman", "price": 10.00 }' \
https://yur25zhqo0.execute-api.us-east-1.amazonaws.com/production/services/books -i
List Books
curl -X GET \
https://yur25zhqo0.execute-api.us-east-1.amazonaws.com/production/services/books
Detail Book
curl -X GET \
https://yur25zhqo0.execute-api.us-east-1.amazonaws.com/production/services/books/456c9e8f-6c50-d656-dc69-dc828c42af65
Delete Book
curl -X DELETE \
https://yur25zhqo0.execute-api.us-east-1.amazonaws.com/production/services/books/456c9e8f-6c50-d656-dc69-dc828c42af65 -i
Update Book
curl -X PUT \
-d '{"title": "updated modafoca"}' -H "Content-type: application/json" \
https://eusrv4mci5.execute-api.us-east-1.amazonaws.com/production/services/books/bbafdb0c-ee6e-fca0-f224-ed534f5b7766 -i
Custom and Environment Variables
Custom Items
Creating and Using custom variables to build dynamic name
custom:
region: ${self:provider.region}
stage: ${opt:stage, self:provider.stage}
prefix: ${self:custom.stage}-${self:service}
process: ${self:custom.prefix}-process
config: ${self:custom.prefix}-config
dynamo-books: ${self:custom.prefix}-BooksCatalog
sns-logs: ${self:custom.prefix}-trigger-logs
sqs-logs: ${self:custom.prefix}-messages-logs
Environment Variables
Building URL Resources using CloudFormation parameters and Custom Variables
environment: # Global Environment variables
DYNAMO_TABLE_BOOKS: ${self:custom.dynamo-books} # Reference to Custom Env
SQS_QUEUE_URL: 'https://sqs.${self:provider.region}.amazonaws.com/#{AWS::AccountId}/${self:custom.sqs-logs}'
REGION: ${self:custom.region}
Manage AWS Cloudformation with Serverless
IAM Roles
iamRoleStatements: # Permissions for all of your functions can be set here
- Effect: Allow
Action: # Gives permission to DynamoDB tables in a specific region
- dynamodb:DescribeTable
- dynamodb:Query
- dynamodb:Scan
- dynamodb:GetItem
- dynamodb:PutItem
- dynamodb:UpdateItem
- dynamodb:DeleteItem
Resource: "arn:aws:dynamodb:us-east-1:*:*"
- Effect: Allow
Action: # Gives permission to Lambda execution
- lambda:InvokeFunction
- lambda:InvokeAsync
Resource: "*"
Docs
Manage Infrastructure Components -# Infrastrucure - Cloud Formation
resources: # CloudFormation template syntax
Resources:
#DynamoDB Books Table
BooksCatalog:
Type: AWS::DynamoDB::Table # CloudFormation Pseudo Parameter Example
Properties:
TableName: ${self:custom.dynamo-books}
AttributeDefinitions:
- AttributeName: hashkey
AttributeType: S
KeySchema:
- AttributeName: hashkey
KeyType: HASH
ProvisionedThroughput:
ReadCapacityUnits: 2
WriteCapacityUnits: 1
# SQS Queue to Update DynamoDB
BooksQueueExample:
Type: AWS::SQS::Queue
Properties:
QueueName: ${self:custom.sqs-logs}
MessageRetentionPeriod: 1209600
VisibilityTimeout: 60
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].