Coder Social home page Coder Social logo

serverless / examples Goto Github PK

View Code? Open in Web Editor NEW
11.3K 264.0 4.5K 16.3 MB

Serverless Examples – A collection of boilerplates and examples of serverless architectures built with the Serverless Framework on AWS Lambda, Microsoft Azure, Google Cloud Functions, and more.

Home Page: https://www.serverless.com/examples/

License: Other

JavaScript 30.03% HTML 1.49% Python 11.92% CSS 17.61% Java 3.39% Shell 0.77% Go 13.26% Swift 0.46% TypeScript 9.13% PHP 0.09% Makefile 1.58% Vue 0.43% Ruby 4.04% C# 4.50% Dockerfile 0.28% Rust 0.25% Clojure 0.32% Batchfile 0.08% F# 0.10% Groovy 0.27%
serverless serverless-framework examples

examples's Introduction

WebsiteEmail UpdatesGitterForumMeetupsTwitterFacebookContact Us

Serverless Examples

A collection of ready-to-deploy Serverless Framework services.

Table of Contents

Click to expand

Getting Started

If you are new to serverless, we recommend getting started with by creating an HTTP API Endpoint in NodeJS, Python, Java, or Golang.


Try Serverless Console
Monitor, observe, and trace your serverless architectures. Real-time dev mode provides streaming logs from your AWS Lambda Functions.

Examples

Each example contains a README.md with an explanation about the service and it's use cases.

Have an example? Submit a PR or open an issue. ⚡️

To install any of these you can run:

serverless install -u https://github.com/serverless/examples/tree/v3/folder-name -n my-project
Example Runtime
Aws Dotnet Rest Api With Dynamodb/src/dotnetserverless.lambda
Reading/Writing operations using .NET Core and DynamoDB
dotnet
Aws Ffmpeg Layer nodeJS
Aws Golang Auth Examples
These example shows how to run a Golang lambda with authentication
golang
Aws Golang Dynamo Stream To Elasticsearch
This example deploys a DynamoDB Table, an Elasticsearch Node, and a lambda triggered off of a Dynamo Stream which updates an elasticsearch index with the data from the Dynamo Table
golang
Aws Golang Http Get Post
Example on Making Parameterized Get and Post Request with Golang
golang
Aws Golang Rest Api With Dynamodb
Serverless CRUD service exposing a REST HTTP interface
golang
Aws Golang Simple Http Endpoint
Example demonstrates how to setup a simple HTTP GET endpoint with golang
golang
Aws Golang Stream Kinesis To Elasticsearch
Pull data from AWS Kinesis streams and forward to elasticsearch
golang
Aws Node Alexa Skill
This example demonstrates how to use an AWS Lambdas for your custom Alexa skill.
nodeJS
Aws Node Auth0 Cognito Custom Authorizers Api
Authorize your API Gateway with either Auth0 or Cognito RS256 tokens.
nodeJS
Aws Node Auth0 Custom Authorizers Api
Demonstration of protecting API gateway endpoints with auth0
nodeJS
Aws Node Dynamic Image Resizer nodeJS
Aws Node Dynamodb Backup
Serverless DynamoDB changes backed up to S3
nodeJS
Aws Node Env Variables Encrypted In A File
Serverless example managing secrets in an encrypted file
nodeJS
Aws Node Env Variables
This example demonstrates how to use environment variables for AWS Lambdas.
nodeJS
Aws Node Express Api nodeJS
Aws Node Express Dynamodb Api nodeJS
Aws Node Fetch File And Store In S3
Fetch an image from remote source (URL) and then upload the image to a S3 bucket.
nodeJS
Aws Node Fullstack/backend nodeJS
Aws Node Fullstack/frontend nodeJS
Aws Node Function Compiled With Babel
Demonstrating how to compile all your code with Babel
nodeJS
Aws Node Github Check nodeJS
Aws Node Github Webhook Listener
Extend your github repositories with this github webhook listener
nodeJS
Aws Node Graphql And Rds nodeJS
Aws Node Graphql Api With Dynamodb
A single-module GraphQL endpoint with query and mutation functionality.
nodeJS
Aws Node Heroku Postgres
Shows how to connect AWS Lambda to Heroku Postgres. Uses an api:release Heroku webhook and the Heroku API to handle automatic Heroku Postgres credential rotation.
nodeJS
Aws Node Http Api Dynamodb Local
Serverless HTTP API with DynamoDB and offline support
nodeJS
Aws Node Http Api Dynamodb
Serverless CRUD service exposing a REST HTTP interface
nodeJS
Aws Node Http Api Mongodb
Serverless HTTP API with MongoDB using Mongoose and Bluebird
nodeJS
Aws Node Http Api Typescript Dynamodb nodeJS
Aws Node Http Api Typescript
This template demonstrates how to make a simple HTTP API with Node.js and Typescript running on AWS Lambda and API Gateway using the Serverless Framework v3
nodeJS
Aws Node Iot Event
Example on how to setup a AWS IoT Rule to send events to a Lambda function
nodeJS
Aws Node Mongodb Atlas
Shows how to connect AWS Lambda to MongoDB Atlas.
nodeJS
Aws Node Oauth Dropbox Api
dropbox integration
nodeJS
Aws Node Puppeteer
When it comes to AWS Lambda function , they have their own limits as follows AWS Limits So , When you try to use Puppeteer your deployment package size(unzipped) easily go's above 250 mb because When you install Puppeteer, it downloads a recent version of Chromium (~170MB Mac, ~282MB Linux, ~280MB Win) that is guaranteed to work with the API.
nodeJS
Aws Node Rekognition Analysis S3 Image
Analyse an Image from an S3 Bucket with Amazon Rekognition
nodeJS
Aws Node Rest Api Mongodb
Serverless REST API with MongoDB using Mongoose and Bluebird
nodeJS
Aws Node Rest Api Typescript Simple nodeJS
Aws Node Rest Api Typescript
This is simple REST API example for AWS Lambda By Serverless framwork with TypeScript and MongoDB Atlas.
nodeJS
Aws Node Rest Api With Dynamodb And Offline
Serverless REST API with DynamoDB and offline support
nodeJS
Aws Node Rest Api With Dynamodb
Serverless CRUD service exposing a REST HTTP interface
nodeJS
Aws Node S3 File Replicator
Fetch an image from remote source (URL) and then upload the image to a S3 bucket.
nodeJS
Aws Node Scheduled Cron
Example of creating a function that runs as a cron job using the serverless schedule event
nodeJS
Aws Node Scheduled Weather
Example of creating a function that runs as a cron job using the serverless schedule event through pulling weather and sending an email daily.
nodeJS
Aws Node Serve Dynamic Html Via Http Endpoint
Hookup an AWS API Gateway endpoint to a Lambda function to render HTML on a GET request
nodeJS
Aws Node Serverless Gong
A simple serverless gong using GitHub webhooks and a Slack app
nodeJS
Aws Node Ses Receive Email Body
Receive an email, store in S3 bucket, trigger a lambda function.
nodeJS
Aws Node Ses Receive Email Header
Receive an email, trigger a lambda function to process header.
nodeJS
Aws Node Shared Gateway
A sample of implementing shared API gateway with multiple Node Lambdas.
nodeJS
Aws Node Signed Uploads
Serverless example for S3 signed uploads
nodeJS
Aws Node Simple Http Endpoint
Example demonstrates how to setup a simple HTTP GET endpoint
nodeJS
Aws Node Simple Transcribe S3
Example demonstrates how to setup a lambda function to transcribe audio file
nodeJS
Aws Node Single Page App Via Cloudfront
Demonstrating how to deploy a Single Page Application with Serverless
nodeJS
Aws Node Single Page App Via Cloudfront/serverless Single Page App Plugin
A plugin to simplify deploying Single Page Application using S3 and CloudFront
nodeJS
Aws Node Sqs Worker
Serverless Framework Node SQS Producer-Consumer on AWS
nodeJS
Aws Node Stripe Integration
This example for Stripe integration using AWS Lambda and API Gateway.
nodeJS
Aws Node Telegram Echo Bot
This is a simple echo bot on Telegram
nodeJS
Aws Node Text Analysis Via Sns Post Processing
Example demonstrates how to setup a simple data processing pipeline
nodeJS
Aws Node Twilio Send Text Message
Send a text message via twilio from aws lambda. See live demo
nodeJS
Aws Node Twitter Joke Bot nodeJS
Aws Node Typescript Apollo Lambda
Serverless example for apollo lambda
nodeJS
Aws Node Typescript Kinesis
Serverless example using Kinesis with TypeScript
nodeJS
Aws Node Typescript Nest
serverless app
nodeJS
Aws Node Typescript Rest Api With Dynamodb nodeJS
Aws Node Typescript Sqs Standard
Serverless example using Standard SQS with TypeScript
nodeJS
Aws Node Typescript nodeJS
Aws Node Upload To S3 And Postprocess
Upload a files to S3 to trigger a lambda function.
nodeJS
Aws Node Vue Nuxt Ssr
Sample project for using Nuxt.js to create a server-side rendered Vue.js app on AWS Lambda and AWS API Gateway. Can easily integrate with your own API or 3rd party APIs such as headless CMS, e-commerce or serverless architecture.
nodeJS
Aws Node Websockets Authorizers
Simple example that demonstrates how to use authorizer functions with websocket events
nodeJS
Aws Python Alexa Skill
This example demonstrates how to use an AWS Lambdas for your custom Alexa skill.
python
Aws Python Auth0 Custom Authorizers Api
Demonstration of protecting API gateway endpoints with auth0
python
Aws Python Flask Api
Example of a Python Flask API service with traditional Serverless Framework
python
Aws Python Flask Dynamodb Api
Example of a Python Flask API service backed by DynamoDB with traditional Serverless Framework
python
Aws Python Http Api With Dynamodb
Serverless HTTP API
python
Aws Python Http Api With Pynamodb
Serverless CRUD service exposing an HTTP API
python
Aws Python Line Echo Bot
this is echo bot on LINE message
python
Aws Python Pynamodb S3 Sigurl
Serverless signed uploader REST API using pynamodb, s3 generated events, custom log format, and DRY serverless.yml with custom section
python
Aws Python Rest Api With Dynamodb
Serverless CRUD service exposing a REST HTTP interface
python
Aws Python Rest Api With Faunadb
Serverless CRUD service exposing a REST HTTP interface
python
Aws Python Rest Api With Pymongo
Serverless pymongo example
python
Aws Python Rest Api With Pynamodb
Serverless CRUD service exposing a REST HTTP interface
python
Aws Python Scheduled Cron
Example of creating a function that runs as a cron job using the serverless schedule event
python
Aws Python Simple Http Endpoint
Example demonstrates how to setup a simple HTTP GET endpoint with python
python
Aws Python Sqs Worker
Serverless Framework Python SQS Producer-Consumer on AWS
python
Aws Python Telegram Bot
This example demonstrates how to setup an echo Telegram Bot using the Serverless Framework ⚡🤖
python
Aws Ruby Cron With Dynamodb
This is an example of creating a function that runs as a cron job using the serverless 'schedule' event. With the usage of the AWS Lambda function, it creates a record to the DynamoDB each and every 30 minutes.
ruby
Aws Ruby Line Bot
Example demonstrates how to setup a simple Line echo bot on AWS
ruby
Aws Ruby Simple Http Endpoint
Example demonstrates how to setup a simple HTTP GET endpoint
ruby
Aws Ruby Sinatra Dynamodb Api
Example of a Ruby Sinatra API service backed by DynamoDB with traditional Serverless Framework
ruby
Aws Ruby Sqs With Dynamodb
A serverless ruby example that creates DynamoDB records with the usage of SQS, API Gateway, and AWS Lambda functions.
ruby
Aws Ruby Sqs With Dynamodb/src
A serverless ruby example that creates DynamoDB records with usage of SQS, API Gateway, and AWS Lambda functions
ruby
Aws Ruby Step Functions Express
Ruby example that make usage of AWS Step Functions Express Type with AWS Lambda, DynamoDB, Amazon SES, API Gateway, and Step Functions flows
ruby
Aws Ruby Step Functions With Callback
Ruby example that make usage of AWS Step Functions with callback pattern, AWS Lambda, DynamoDB, Amazon Comprehend, API Gateway, and Step Functions flows
ruby
Aws Ruby Step Functions
Ruby example that make usage of AWS Step Functions with AWS Lambda, DynamoDB and Step Functions flows.
ruby
Aws Rust Simple Http Endpoint
Example demonstrates how to setup a simple HTTP GET endpoint with rust
nodeJS
Azure Node Line Bot
Azure Functions sample for the Serverless framework
nodeJS
Azure Node Simple Http Endpoint
An example of making http endpoints with the Azure Functions Serverless Framework plugin
nodeJS
Azure Node Telegram Bot
Azure Functions sample for the Serverless framework
nodeJS
Azure Node Typescript Servicebus Trigger Endpoint
Serverless application for asset model creation
nodeJS
Google Golang Simple Http Endpoint
Example demonstrates how to setup a simple HTTP GET endpoint with golang
golang
Google Node Simple Http Endpoint
An example of making http endpoints with the Google Cloud Functions Serverless Framework plugin.
nodeJS
Google Node Typescript Http Endpoint
Simple HTTP example for GCP functions by Serverless framework with Typescript
nodeJS
Google Python Simple Http Endpoint
Example demonstrates how to setup a simple HTTP GET endpoint with python
python
Google Ruby Simple Http Endpoint
Example demonstrates how to setup a simple HTTP GET endpoint with Ruby
ruby
Kubeless Python Simple Function
This example demonstrates how to setup a simple Python function with Kubeless
python
Kubeless Python Simple Scheduled Function
This example demonstrates how to setup a simple Python function with Kubeless
python
Openwhisk Go Simple
Example demonstrates how to setup a simple Go function with OpenWhisk.
nodeJS
Openwhisk Node And Docker Chaining Functions
Example of chaining function calls using sequences and docker images.
nodeJS
Openwhisk Node Chaining Functions
Example of chaining function calls using sequences and the sdk.
nodeJS
Openwhisk Node Scheduled Cron
Example of creating a function that runs as a cron job using the serverless schedule event.
nodeJS
Openwhisk Node Simple Http Endpoint
Example demonstrates how to setup a simple HTTP GET endpoint with OpenWhisk.
nodeJS
Openwhisk Node Simple
Simple example demonstrating OpenWhisk provider support.
nodeJS
Openwhisk Php Simple
Example demonstrates how to setup a simple PHP function with OpenWhisk.
php
Openwhisk Python Scheduled Cron
Example of creating a Python function that runs as a cron job using the serverless schedule event.
python
Openwhisk Python Simple Http Endpoint
Example demonstrates how to setup a simple HTTP GET endpoint with OpenWhisk.
python
Openwhisk Python Simple
Example demonstrates how to setup a simple Python function with OpenWhisk.
python
Openwhisk Ruby Simple
Example demonstrates how to setup a simple Ruby function with OpenWhisk.
ruby
Openwhisk Rust Simple Http Endpoint
Example demonstrates how to setup a simple Rust function with OpenWhisk.
nodeJS
Openwhisk Swift Precompiled Binaries
Swift packages and pre-compiled binaries on OpenWhisk.
swift
Openwhisk Swift Scheduled Cron
Example of creating a Swift function that runs as a cron job using the serverless schedule event.
swift
Openwhisk Swift Simple Http Endpoint
Example demonstrates how to setup a simple HTTP endpoint using Swift function with OpenWhisk.
swift
Openwhisk Swift Simple
Example demonstrates how to setup a simple Swift function with OpenWhisk.
swift
Twilio Node Forward Call
Example demonstrating Twilio Runtime support with an endpoint that returns TwiML to forward a phone call
nodeJS

Community Examples

Add an example

To install any of these you can run:

serverless install -u https://github.com/author/project -n my-project
Example Author
Aws Api Gateway Serverless Project Written In Go
A serverless project that contains an API Gateway endpoint powered by a Lambda function written in golang and built using eawsy/aws-lambda-go-shim.
yunspace
Aws Cognito Custom User Pool Example
Example CloudFormation custom resource backed by a lambda using Cognito User Pools
bsdkurt
Aws Lambda Power Tuning (Powered By Step Functions)
Build a Step Functions state machine to optimize your AWS Lambda Function memory/power configuration.
alexcasalboni
Aws Lambda, Amazon Api Gateway, S3, Dynamodb And Cognito Example
Step by step guide how to deploy simple web application on top of AWS Lambda, Amazon API Gateway, S3, DynamoDB and Cognito.
andreivmaksimov
Aws Node Typescript Warmup Lambda Example
The following simple example shows how to solve the cold start problem of AWS lambda functions, through keeping function warm using Serverless WarmUp Plugin.
Pigius
Aws Demo Java Spring Cloud Function Serverless
If Java is your choice of programming language-Spring Cloud Function,Serverless Framework makes a great technology stack. It boosts developer productivity by decoupling from Vendor specific FaaS API, and deployment activities.
mbsambangi
Amazon Kinesis Streams Fan Out Via Kinesis Analytics
Use Amazon Kinesis Analytics to fan-out your Kinesis Streams and avoid read throttling.
alexcasalboni
Commenting Api
A commenting api using Serverless Typescript GraphQl and Redis
AyoubEd
Daily Instance Backups With Ami Rotation
A simple Python application which scans through your entire AWS account for tagged instances, makes daily AMIs of them, and rotates their backups automatically
AndrewFarley
Demo Project For Serverless Migrate Plugin
An example about how to use migrations in your serverless project with serverless-migrate-plugin
EliuX
Dropbucket Serverless File Sharing
A serverless file sharing app powered by Cognito/S3/Lambda/API Gateway. Includes a React single-page app UI and virus scanning.
marksteele
Express Application With Lambda
This example demonstrates how to build an express application for AWS Lambda based on serverless framework.
HoseungJang
File Uploads Using S3 Presigned Urls
A Serverless photo upload service with API Gateway, S3 presigned URLs and Lambda.
marchetti2
Fotopia Serverless
A photo archive web app including API, storage and face detection using serverless framework
mbudm
Golive
Boilerplate to live stream using AWS MediaLive and MediaStore
adimoraret
Google Logging Event Subscription
This example demonstrates how to trigger a cloud functions when a specific event occurs in Google Cloud Platform project.
gnokoheat
Http Headers Checks
Serverless Application to check integrity of the headers of a given HTTP server
authdog
Idempotent Serverless Functions
This repository demonstrates how to ensure the idempotence of serverless functions running on AWS Lambda.
Nsupyq
Json Serverless
A simple & cheap serverless REST API using json-server in combination with AWS Lambda / S3 and the serverless framework
pharindoko
Lambda Pubsub Via Sns Example
Example illustrating the flow: Lambda (publisher) => SNS => Lambda (consumer)
didil
Monorepo Typescript Microservices
An opinionated Serverless template with several Typescript microservices in a monorepo
fargito
Neo4j Deployment In Aws Ec2
Serverless Framework example to deploy a Neo4j instance in EC2.
nanlabs
Nietzsche
A serverless application that fetches quotes from Goodreads and saves it to DynamoDB with example use cases using Lambda, SNS, SQS, Step Functions, DynamoDB, API Gateway, CloudWatch
rpidanny
Open Bot
An unoptionated Github bot driven by a configuration file in the repository
open-bot
Personal Access Tokens Cron Check
Audit for leaked PAT in your Contentful organization. How to use serverless as cronjobs to keep your Personal Access Tokens secure
madtrick
React & Stripe Serverless Ecommerce
Serverless E-Commerce App with AWS Lambda, Stripe and React
patrick-michelberger
Realtime Ww2 Alexa Skill
An alexa skill project that's using Alexa SDK. Can also be used for a working example of serverless-webpack (with use of async/await via babel).
ceilfors
Run Your Kubernetes Workloads On Amazon Ec2 Spot Instances With Amazon Eks And Lambda Part 1
From this tutorial you'll learn how to add AWS EKS Cluster with Spot Instances to your cloud environment managed by Serverless framework
andreivmaksimov
Run Your Kubernetes Workloads On Amazon Ec2 Spot Instances With Amazon Eks And Lambda Part 2
From this article you'll learn how to configure AWS Lambda functions to allow them manage your EKS Kubernetes cluster and run triggered jobs
andreivmaksimov
Sqs Worker With Aws Lambda And Cloudwatch Alarms
Process messages stored in SQS with an auto-scaled AWS Lambda worker function.
sbstjn
Serverless + Lambda + Vpc + Nat + Redis
Demo using API Gateway and Lambda with VPC and NAT to access Internet and AWS Resource
ittus
Serverless Aws Node Notifications
This template demonstrates how to make a simple HTTP API Endpoint with Node.js running on AWS Lambda and API Gateway using the Serverless Framework to send notifications using Courier.
trycourier
Serverless Analytics
Write your own Google Analytics clone and track website visitors serverless with API Gateway, Kinesis, Lambda, and DynamoDB.
sbstjn
Serverless Appsync Offline Typescript With Circleci
A Serverless Framework template that allows you to launch an AppSync emulator locally and proceed with development. Lambda Function build by TypeScript/Webpack.
daisuke-awaji
Serverless Appsync Offline With Python
Serverless Framework example to deploy an AWS AppSync API using Python. It also has a local development environment using Serverless Offline.
nanlabs
Serverless Appsync Offline With Typescript
Serverless Framework example to deploy an AWS AppSync API using TypeScript. It also has a local development environment using Serverless Offline.
nanlabs
Serverless Architecture Boilerplate
Boilerplate to organize and deploy big projects using Serverless and CloudFormation on AWS
msfidelis
Serverless Cloudwatch Proxy
Logging adapter that consumes log streams from AWS CloudWatch, streams them to other log destinations. Also capable of identying alerts and sending notifications via Slack/Email
abbasdgr8
Serverless Dashboard For Atom Editor
Atom editor package which allows you to deploy and visualize your serverless services with Serverless Framework on your editor.
horike37
Serverless Documentdb Cluster
Serverless Framework example to deploy a DocumentDB cluster with all the necessary resources. It accepts params to customize the deployment without even having to modify the source code.
nanlabs
Serverless Es6/7 Crud Api
Serverless Stack examples of backend CRUD APIs (DynamoDB + Lambda + API Gateway + Cognito User Pool authorizer) for React.js single-page app
AnomalyInnovations
Serverless Gitlab Ci
Simple Gitlab CI template for automatic testing and deployments
bvincent1
Serverless Glue With Python Shell And Pyspark Complete Boilerplate
A complete example of an AWS Glue application that uses the Serverless Framework to deploy the infrastructure and DevContainers and/or Docker Compose to run the application locally with AWS Glue Libs, Spark, Jupyter Notebook, AWS CLI, among other tools. It provides jobs using Python Shell and PySpark.
nanlabs
Serverless Glue With Python Shell And Pyspark Jobs
Serverless Framework example to deploy an AWS Glue job using Python Shell and PySpark.
nanlabs
Serverless Image Labeller
Serverless image labelling using Rekognition, s3, DynamoDB.
nileshprasad137
Serverless Instagram Crawler
Instagram hashtag Crawler with Lambda & DynamoDB.
kimcoder
Serverless Kakao Bot
Easy development for Kakaotalk Bot with Serverless
JisuPark
Serverless Lambda S3 Demonstration
This project demonstrates how the Serverless Framework can be used to deploy a NodeJS Lambda function that responds to events in an S3 bucket.
johncmunson
Serverless Load Balancer
A sample that shows how to combine a load balancer with (vpc/subnet configuration) with a lambda.
pharindoko
Serverless Rds Log Sync S3
Annotated exmaple of a periodic scheduled task to sync changed RDS log files to an S3 bucket.
drocco007
Serverless Rds Postgres Instance
Serverless Framework example to deploy a RDS Postgres Instance with all the necessary resources. It accepts params to customize the deployment without even having to modify the source code.
nanlabs
Serverless Reactjs Universal Rendering Boilerplate
ReactJS web app Starter kit does universal (isomorphic) rendering with Serverless
TylorShin
Serverless S3 Local Example
Serverless Framework example to run a lambda function locally using
nanlabs
Serverless Sns Sqs Offline Example
Minimal example of running serverless-offline with SQS and SNS in local environment.
kenyipp
Serverless Ssh Command
Example of executing ssh command with OpenWhisk
upgle
Serverless Screenshot To S3
An example serverless stack which takes a screenshot using aws-chrome-lambda and puts it in s3. NodeJS.
slaytr
Serverless Telegram Bot
This example demonstrates how to setup an echo Telegram Bot using the Serverless Framework ⚡🤖
jonatasbaldin
Serverless Typescript Using Middy
Serverless Framework example to deploy a lambda function using https://middy.js.org/, the stylish Node.js middleware engine for AWS Lambda.
nanlabs
Serverless Typescript Using Middy With Custom Middlewares
Serverless Framework example to deploy a lambda function using https://middy.js.org/, the stylish Node.js middleware engine for AWS Lambda with custom middlewares.
nanlabs
Serverless Ffmpeg
Bucket event driven FFMPEG using serverless. Input bucket => Serverless ffmpeg => Output bucket.
kvaggelakos
Serverless Sns Api
Build a SNS service on AWS, support backend API for SNS by device, by group and by user
eddielisc
Serverless Side Rendering With Vue.js And Nuxt.js
Sample project for using Nuxt.js to create a server-side rendered Vue.js app on AWS Lambda and AWS API Gateway. Can easily integrate with your own API or 3rd party APIs such as headless CMS, e-commerce or serverless architecture.
adnanrahic
Serving Binary Files
Small example showing how to serve binary files using Serverless on AWS with the serverless-apigw-binary plugin, using generated Excel files as an example
thomastoye
Spiderless, Web Spider On Serverless
A web spider / scraper / website change detector built with Lambda, API Gateway, DynamoDB and SNS
slashbit
Stack Overflow Monitor
Monitor Stack Overflow questions and post them in a Slack channel
picsoung
[Unly] Boilerplates Generator
A boilerplates generator, meant to help to quick-start Serverless (AWS Lambda/API GW) and OSS projects, using good defaults (sentry for automated error handling, staging/prod environments, built-in support for env vars, jest support, babel/webpack), yet flexible to fit your needs.
UnlyEd
Adoptable Pet Bot
Tweets adoptable pets using Serverless (Node.js) and AWS Lambda
lynnaloo
Aws Mfa Enforce
Serverless function to automate enforcement of Multi-Factor Authentication (MFA) to all AWS IAM users with access to AWS Management Console.
Chan9390
Aws Node Signed Uploads
Upload files larger than 10MB with AWS Lambda and API Gateway. Can be developed and tested locally.
kalinchernev
Aws Ses Serverless Example
AWS SES example in NodeJS using lambda
lakshmantgld
Bablebot
Lambda + API Gateway: Zero-to-chatbot in <10 lines of JS. Built-in integrations for Messenger, Telegram, Kik, Line, Twilio, Skype, and Wechat. Or roll your own!
abiglobalhealth
Bittman
A serverless project that follows a stock trading algorithm and uses scheduled functions to save data to DynamoDB and send emails through Mailgun.
rhlsthrm
Cordis Serverless
A serverless API for EU Cordis data
marzeelabs
Faultline
Error tracking tool on AWS managed services.
faultline
Giphy Bot
giphy-bot for Facebook chat
tywong
Grants Api Serverless
ES6 API to consume data from an external API, ingest into Elasticsearch and return a queryable endpoint on top of Elasticsearch
comicrelief
Honeylambda
a simple, serverless application designed to create and monitor URL {honey}tokens, on top of AWS Lambda and Amazon API Gateway
0x4D31
Jrestless Examples
JRestless (Java / JAX-RS) examples for API Gateway Functions (plain JAX-RS, Spring, binary data requests/responses, custom authorizers and Cognito User Pool authorizers), SNS Functions (asynchronous communication between functions) and Service Functions (synchronous HTTP-like communication between functions - transparent through Feign)
bbilger
Jwt Lambda Python
Minimal proof-of-concept implementation of JWT with Serverless / AWS Lambda
mikaelmork
Jwtauthorizr
Custom JWT Authorizer Lambda function for Amazon API Gateway with Bearer JWT
serverlessbuch
Keboola Developer Portal
Keboola developer portal built with Serverless
keboola
Offset Trump
Single page app using Serverless (C# runtime) and S3 site hosting. Pledge to do a good thing for the next four years to offset the potential negative effects of the US Presidency
FLGMwt
Owntracks Serverless
A serverless implementation of the OwnTracks HTTP backend
dschep
Pfs Email Serverless
This is a lambda function created by the serverless framework. It searches through members in our mongodb who have not been sent emails and sends them an email with their custom token to unlock the pledge free stream. It then marks those members off as already receiving the email.
SCPR
Plaid Cashburndown Service
Service for calculating cash burndown with plaid. Frontend code can be found here: https://github.com/cplee/cashburndown-site
cplee
Sc5 Serverless Boilerplate
A boilerplate that contains setup for test-driven development
SC5
Serverless + Java Dynamodb Imlementation Example
example for java programmers that want to work with AWS-Lambda and DynamoDB
igorbakman
Serverless + Lambda Protobuf Responses
Demo using API Gateway and Lambda with Protocol Buffer
theburningmonk
Serverless + Medium Text To Speech
Serverless-based, text-to-speech service for Medium articles
RafalWilinski
Serverless Dotnet Boilerplate
A serverless starter solution for .NET Core, ready for local debugging in VS Code, HTTP Endpoint, etc.
pharindoko
Serverless Aws Rekognition Finpics
Use AWS Rekognition to provide a faces search of finpics.com
rgfindl
Serverless Api Typescript Template
A starter template for a Serverless API using Typescript and Jest
JoshuaToth
Serverless Blog To Podcast
Service that reads RSS feed and converts the entries to a podcast feed and audio files using Amazon Polly
SC5
Serverless Cloudwatch Rds Custom Metrics
A NodeJS-based MySQL RDS Data Collection script to push Custom Metrics to Cloudwatch with Serverless
AndrewFarley
Serverless Delivery Framework
This is a boilerplate for version release pipeline with serverless framework
99xt
Serverless Example Send Email With Ses Offline
Sending emails with AWS SES, Node.js, serverless-offline and serverless-offline-ses-v2
domdomegg
Serverless Examples Cached Rds Ws
A serverless framework example project that uses API Gateway, ElastiCache, and RDS PostgreSQL.
mugglmenzel
Serverless Facebook Quotebot
100% Serverless Facebook messenger chatbot which will respond with inspiring quotes
pmuens
Serverless Garden Aid
IoT Garden Aid Backend
garden-aid
Serverless Graphql Api
Serverless GraphQL API using Lambda and DynamoDB
boazdejong
Serverless Html Pdf
Service that convert HTML to PDF using PhantomJS's rasterize example.
calvintychan
Serverless Image Manager
image upload / download with resizing. Used API gateway's binary support & serverless
TylorShin
Serverless Mailgun Slack
A Serverless function for posting to a Slack Webhook in response to a Mailgun route
Marcus-L
Serverless Messenger Boilerplate
Serverless messenger bot boilerplate
SC5
Serverless Modern Koa
Serverless modern koa starter kit
barczaG
Serverless Msg Gateway
A messaging aggregator for kik, skype, twilio, telegram, & messenger. Send and receive messages in a standard format.
yonahforst
Serverless Newsletter Signup
Saves user details into DynamoDB table. Required values are email, first_name and last_name.
dschep
Serverless Node Api Dynamodb Neo4j
Architecture example to stream DynamoDB data to a read-model using Neo4j
noetix
Serverless Npm Registry
Serverless private npm registry, proxy and cache.
craftship
Serverless Pokego
Serverless-powered API to fetch nearby Pokemon Go data
jch254
Serverless Postgraphql
GraphQL endpoint for PostgreSQL using postgraphql
rentrop
Serverless Python Rds Cron
A serverless python example that periodically removes entries from AWS RDS
caulagi
Serverless Python Sample
A simple serverless python sample with REST API endpoints and dependencies
bennybauer
Serverless React Boilerplate
A serverless react boilerplate for offline development
99xt
Serverless Screenshot
Serverless Screenshot Service using PhantomJS
svdgraaf
Serverless Slack Cron
Lambda function which sends messages to Slack channel in regular intervals via cron trigger.
ivanderbu2
Serverless Slack Emojibot
Serverless slack bot for emoji
markhobson
Serverless Slack Trevorbot
Slack bot for info on where in the world is Trevor Gerhardt?
conveyal
Serverless Url Shortener
A simple url-shortener, using Serverless framework
aletheia
Serverless Weekly2pocket App
Serverless-powered API for sending posts to pocket app
s0enke
Slack Signup Serverless
Serverless signup to Slack and more. Lambda with Python, StepFunctions, and Web front end. Python boilerplate included.
dzimine
Sls Access Counter
Site visitor counter
takahashim
Sls Form Mail
Send SNS email from form data
takahashim
Vanity Stargazer
Github vanity-stargazer is a serverless application to handle posting Github new star gazers to Slack
silvermullet
Video Preview And Analysis Service
An event-driven service that generates labels using Amazon Rekognition and creates preview GIF animation from a video file.
laardee

Contributing

We are happy to accept more examples from the community. 🎉

Adding example code

  1. Make sure your contribution matches the linting setup for this repo:

Run the linting via

npm run lint
  1. Add a package.json file in your example with the name of the example and a description and any dependencies used.

  2. Regenerate the README.md with the following command

npm run docs
  1. Open a new pull request with your example. ⚡️

Adding a community example

We love hearing about projects happening in the community. Feel free to add your serverless project to our growing list.

  1. Add link, title, and description to the community-examples.json file.

  2. Open a new pull request with your example. ⚡️

examples's People

Contributors

ac360 avatar adambrgmn avatar adnanrahic avatar beeceej avatar bildungsroman avatar christophgysin avatar davidwells avatar dependabot[bot] avatar dschep avatar eahefnawy avatar gsweene2 avatar hoseungme avatar jiyeonseo avatar jmpfrazao avatar louis70109 avatar medikoo avatar mnapoli avatar nikgraf avatar pgrzesik avatar pigius avatar pmuens avatar pramonow avatar quantuminformation avatar samueleresca avatar sebito91 avatar skierkowski avatar tmilewski avatar walidelnozahy avatar worldsoup avatar xf10w avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

examples's Issues

aws-node-rest-api-with-dynamodb example fails when deployed to non-default region

When deploying aws-node-rest-api-with-dynamodb to a region specified with --region:

$ serverless --region eu-west-1 deploy

It fails at runtime with:

$ curl https://xxxxxxxxx.execute-api.eu-west-1.amazonaws.com/dev/todos
{"message": "Internal server error"}

From the logs:

$ serverless --region eu-west-1 logs -f list
[...]
2017-02-06 13:32:26.513 (+02:00)  ... { [AccessDeniedException: User: arn:aws:sts::xxxxxxxxxx:assumed-role/serverless-rest-api-with-dynamodb-dev-eu-west-1-lambdaRole/serverless-rest-api-with-dynamodb-dev-list is not authorized to perform: dynamodb:Scan on resource: arn:aws:dynamodb:eu-west-1:xxxxxxxxxxxxx:table/serverless-rest-api-with-dynamodb-dev]
  message: 'User: arn:aws:sts::xxxxxxxxxxx:assumed-role/serverless-rest-api-with-dynamodb-dev-eu-west-1-lambdaRole/serverless-rest-api-with-dynamodb-dev-list is not authorized to perform: dynamodb:Scan on resource: arn:aws:dynamodb:eu-west-1:xxxxxxxxxx:table/serverless-rest-api-with-dynamodb-dev',
  code: 'AccessDeniedException',
  time: Mon Feb 06 2017 11:32:26 GMT+0000 (UTC),
  requestId: 'xxxxxxxxxxxxxxxxxxx',
  statusCode: 400,
  retryable: false,
  retryDelay: 0 }
    [...]

Looking at the role policy shows:

$ aws iam get-role-policy --role-name serverless-rest-api-with-dynamodb-dev-eu-west-1-lambdaRole --policy-name dev-serverless-rest-api-with-dynamodb-lambda
{
    "RoleName": "serverless-rest-api-with-dynamodb-dev-eu-west-1-lambdaRole",
    "PolicyName": "dev-serverless-rest-api-with-dynamodb-lambda",
    "PolicyDocument": {
        "Statement": [
            ....
            {
                "Action": [
                    "dynamodb:Query",
                    "dynamodb:Scan",
                    "dynamodb:GetItem",
                    "dynamodb:PutItem",
                    "dynamodb:UpdateItem",
                    "dynamodb:DeleteItem"
                ],
                "Resource": "arn:aws:dynamodb:us-east-1:*:table/serverless-rest-api-with-dynamodb-dev",
                "Effect": "Allow"
            }
        ]
    }
}

Notice how "Resource" refers to us-east-1 instead of eu-west-1.

Setting provider.region in the serverless.yml works as expected.

how do i pass multiple values to an environment variable?

how do i pass multiple values to an environment variable, this for me does not work:

service: serverless-test

plugins:
  - serverless-offline

provider:
  name: aws
  runtime: nodejs4.3
  timeout: 10
# you can define service wide environment variables here
  environment:
    database: mongo
    MONGO_URI: "mongodb://mongo-6:27000,mongo-7:27000,mongo-8:27000/db-dev?replicaSet=mongo"

aws-node-rest-api-with-dynamodb not delpoying

Despite being able to deploy other examples that require access to S3, i get the following error on when trying to deploy 'aws-node-rest-api-with-dynamodb'

Serverless: Packaging service...
Serverless: Uploading CloudFormation file to S3...
 
  Serverless Error ---------------------------------------
 
     The specified bucket does not exist
 

Data ingestion examples

                                                                               
     ┌──────────┐    ┌──────────┐   ┌───────────┐   ┌──────────┐   ┌──────────┐
     │          │    │  Lambda  │   │           │   │  Lambda  │   │          │
     │   APIG   │───▶│(validate)│──▶│  Kinesis  │──▶│(process &│──▶│ DynamoDB │
     │          │    │          │   │           │   │  save)   │   │          │
     └──────────┘    └──────────┘   └───────────┘   └──────────┘   └──────────┘

Real world use case in analytics systems. Tracking most visited pages.

It's pretty common pattern to expose some endpoint and push incoming messages to Kinesis steam. Second Lambda function takes care of processing and saving to DynamoDB.

DynamoDB table:

  • url: string
  • count: int

Incoming events:

{url: 'http://'}

Azure example fails to deploy

Following the instructions with these steps I get an error:

npm i -g azure-cli
azure login
azure account show
azure ad sp create -n NAME -p PASSWORD
azure role assignment create --objectId bad1234dad5678cab -o Contributor

azure account show gives the expected result at this point, and I set up my environment variables.

and then in the examples/azure-node-simple-http-endpoint directory, after editing serverless.yml to include my Azure credentials.

npm install
serverless deploy

But the end result is a failure I can only see in the Azure web console. "Website with given name azfx-node-http already exists"

The serverless debug output only includes this: 'At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-debug for usage details.'

aws-node-rest-api-with-dynamodb example non string error

I am getting the following issue with the aws-node-rest-api-with-dynamodb example. Have I missed something in the configuration. AWS cli seems to configured correctly as other examples deployed OK.

Serverless Error ---------------------------------------

 Trying to populate non string value into a string for
 variable ${env:DYNAMODB_TABLE}. Please make sure the
 value of the property is a string.

Get Support --------------------------------------------
Docs: docs.serverless.com
Bugs: github.com/serverless/serverless/issues

Your Environment Information -----------------------------
OS: darwin
Node Version: 7.4.0
Serverless Version: 1.6.1

aws-node-auth0-custom-authorizers-api example gives me CORS error

Hi,

I was just trying out the above mentioned example and it didn't work for me. I did everything exactly like the README stated. The error occurs when I'm trying to invoke the API calls (so logging into auth0 and obtaining a token works). Whether I call the public endpoint or the private endpoint it gives me the typical "No 'Access-Control-Allow-Origin' header is present on the requested resource". Even though cors is set to '' (as you can see in the serverless.yml). Even when I specifically enter my sites URL (instead of '') it won't work. When I test the API in the API Gateway console the Access-Control-Allow-Origin is present.

Any ideas?

Verify JWT Auth0

When verifying the JSON Web Token the secret has to be passed as a Base64 encoded string.

jwt.verify(token, new Buffer(AUTH0_CLIENT_SECRET, 'base64'));

But since december 2016 Auth0 no longer stores client Secret with Base64 encoding (https://auth0.com/forum/t/client-secret-stored-without-base64-encoding).
So the JSON Web Token can be passed as string without being encoded.

jwt.verify(token, AUTH0_CLIENT_SECRET);

Unable to deploy babel example

Hello!

I'm trying to get the babel example working (https://github.com/serverless/examples/tree/master/aws-node-function-compiled-with-babel) but I've run into an error and can't figure out how to move forward. First, I was running into an error because node_modules/.bin/babel didn't exist (installing babel-cli resolved that) but now I get this error and don't know why. Any ideas?

I'm using node 4.3.2 because that's the version Lambda is using but I've also tried it with 6.9.4 and I get the same error.

$ SLS_DEBUG=* serverless deploy
Serverless: Packaging service...
Serverless: Babel compilation:
tmpBabelDirectory/createResponse.js -> tmpBabelDirectory/createResponse.js
tmpBabelDirectory/handler.js -> tmpBabelDirectory/handler.js

Serverless: Packaging service with compiled files...

  Error --------------------------------------------------

     invalid signature: 0x6064b50

     For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.

  Stack Trace --------------------------------------------

Error: invalid signature: 0x6064b50
    at /Users/cmoel/Desktop/sls-babel/node_modules/serverless-babel-plugin/node_modules/unzip2/lib/parse.js:63:13
    at processImmediate [as _immediateCallback] (timers.js:383:17)

  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues

     Please report this error. We think it might be a bug.

  Your Environment Information -----------------------------
     OS:                 darwin
     Node Version:       4.3.2
     Serverless Version: 1.5.0

aws-node-rest-api-with-dynamodb deploy fails

If I try to deploy the aws-node-rest-api-with-dynamodb example without any change, I get foolowing message:

Trying to populate non string value into a string for
variable ${env:DYNAMODB_TABLE}. Please make sure the
value of the property is a string.

Proposal: Add tests

I would suggest adding tests to each one of the examples. Testing is a big subject and lots of people that are interested in a serverless architecture may be wondering how one is being tested. Your recommendation on the subject will be a big deal, imho.

Thank you

Can I use serverless to define an initializer of a DynamoDB table?

I'd like to write several initial items as the initial values in a table, could I automate this process using Serverless framework?

My idea is as the following:

  1. define DynamoDB as what normal serverless.yml does;
  2. define handler.js as what normal lambda function definitions do;
  3. define an init_handler.js as call that handler once (and only once) during serverless deploy command

I don't know if and how I may hack serverless to achieve this.

SLS remove does not remove dynamoDB Table?

So I can deploy fine if I change the service name. But I think I found what might have been causing the previous issue #131.
If I deploy successfully then try to remove the deployment the removal succeeds. However on a redeploy I get TodosDynamoDbTable - serverless-rest-api-with-dynamodb87-dev already exists.

Also at no point during this whole process do I see tables in the dynamoDB section in the AWS portal. Is this normal?

waltermvp@Walters-MacBook-Pro:~/Development/Open/examples/aws-node-rest-api-with-dynamodb (master)$ sls remove
Serverless: Getting all objects in S3 bucket...
Serverless: Removing objects in S3 bucket...
Serverless: Removing Stack...
Serverless: Checking Stack removal progress...
..
Serverless: Stack removal finished...
waltermvp@Walters-MacBook-Pro:~/Development/Open/examples/aws-node-rest-api-with-dynamodb (master)$ SLS_DEBUG="*" sls deploy --verbose
Serverless: Creating Stack...
Serverless: Checking Stack create progress...
CloudFormation - CREATE_IN_PROGRESS - AWS::CloudFormation::Stack - serverless-rest-api-with-dynamodb87-dev
CloudFormation - CREATE_IN_PROGRESS - AWS::S3::Bucket - ServerlessDeploymentBucket
CloudFormation - CREATE_IN_PROGRESS - AWS::S3::Bucket - ServerlessDeploymentBucket
CloudFormation - CREATE_COMPLETE - AWS::S3::Bucket - ServerlessDeploymentBucket
CloudFormation - CREATE_COMPLETE - AWS::CloudFormation::Stack - serverless-rest-api-with-dynamodb87-dev
Serverless: Stack create finished...
Serverless: Packaging service...
Serverless: Uploading CloudFormation file to S3...
Serverless: Uploading function .zip files to S3...
Serverless: Uploading service .zip file to S3 (5.4 KB)...
Serverless: Updating Stack...
Serverless: Checking Stack update progress...
CloudFormation - CREATE_COMPLETE - AWS::CloudFormation::Stack - serverless-rest-api-with-dynamodb87-dev
CloudFormation - UPDATE_IN_PROGRESS - AWS::CloudFormation::Stack - serverless-rest-api-with-dynamodb87-dev
CloudFormation - CREATE_IN_PROGRESS - AWS::ApiGateway::RestApi - ApiGatewayRestApi
CloudFormation - CREATE_IN_PROGRESS - AWS::IAM::Role - IamRoleLambdaExecution
CloudFormation - CREATE_IN_PROGRESS - AWS::ApiGateway::RestApi - ApiGatewayRestApi
CloudFormation - CREATE_IN_PROGRESS - AWS::Logs::LogGroup - DeleteLogGroup
CloudFormation - CREATE_IN_PROGRESS - AWS::DynamoDB::Table - TodosDynamoDbTable
CloudFormation - CREATE_IN_PROGRESS - AWS::Logs::LogGroup - UpdateLogGroup
CloudFormation - CREATE_IN_PROGRESS - AWS::IAM::Role - IamRoleLambdaExecution
CloudFormation - CREATE_IN_PROGRESS - AWS::Logs::LogGroup - DeleteLogGroup
CloudFormation - CREATE_IN_PROGRESS - AWS::Logs::LogGroup - ListLogGroup
CloudFormation - CREATE_COMPLETE - AWS::Logs::LogGroup - DeleteLogGroup
CloudFormation - CREATE_IN_PROGRESS - AWS::Logs::LogGroup - GetLogGroup
CloudFormation - CREATE_COMPLETE - AWS::ApiGateway::RestApi - ApiGatewayRestApi
CloudFormation - CREATE_IN_PROGRESS - AWS::Logs::LogGroup - CreateLogGroup
CloudFormation - CREATE_IN_PROGRESS - AWS::Logs::LogGroup - UpdateLogGroup
CloudFormation - CREATE_FAILED - AWS::DynamoDB::Table - TodosDynamoDbTable
CloudFormation - CREATE_COMPLETE - AWS::Logs::LogGroup - UpdateLogGroup
CloudFormation - CREATE_IN_PROGRESS - AWS::Logs::LogGroup - GetLogGroup
CloudFormation - CREATE_COMPLETE - AWS::Logs::LogGroup - GetLogGroup
CloudFormation - CREATE_IN_PROGRESS - AWS::Logs::LogGroup - CreateLogGroup
CloudFormation - CREATE_COMPLETE - AWS::Logs::LogGroup - CreateLogGroup
CloudFormation - CREATE_IN_PROGRESS - AWS::Logs::LogGroup - ListLogGroup
CloudFormation - CREATE_IN_PROGRESS - AWS::ApiGateway::Resource - ApiGatewayResourceTodos
CloudFormation - CREATE_FAILED - AWS::IAM::Role - IamRoleLambdaExecution
CloudFormation - CREATE_COMPLETE - AWS::Logs::LogGroup - ListLogGroup
CloudFormation - CREATE_FAILED - AWS::ApiGateway::Resource - ApiGatewayResourceTodos
CloudFormation - UPDATE_ROLLBACK_IN_PROGRESS - AWS::CloudFormation::Stack - serverless-rest-api-with-dynamodb87-dev
CloudFormation - UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS - AWS::CloudFormation::Stack - serverless-rest-api-with-dynamodb87-dev
CloudFormation - DELETE_IN_PROGRESS - AWS::Logs::LogGroup - DeleteLogGroup
CloudFormation - DELETE_IN_PROGRESS - AWS::Logs::LogGroup - UpdateLogGroup
CloudFormation - DELETE_IN_PROGRESS - AWS::Logs::LogGroup - ListLogGroup
CloudFormation - DELETE_IN_PROGRESS - AWS::Logs::LogGroup - CreateLogGroup
CloudFormation - DELETE_IN_PROGRESS - AWS::Logs::LogGroup - GetLogGroup
CloudFormation - DELETE_COMPLETE - AWS::ApiGateway::Resource - ApiGatewayResourceTodos
CloudFormation - DELETE_IN_PROGRESS - AWS::IAM::Role - IamRoleLambdaExecution
CloudFormation - DELETE_COMPLETE - AWS::Logs::LogGroup - UpdateLogGroup
CloudFormation - DELETE_COMPLETE - AWS::Logs::LogGroup - ListLogGroup
CloudFormation - DELETE_COMPLETE - AWS::Logs::LogGroup - DeleteLogGroup
CloudFormation - DELETE_COMPLETE - AWS::Logs::LogGroup - GetLogGroup
CloudFormation - DELETE_COMPLETE - AWS::IAM::Role - IamRoleLambdaExecution
CloudFormation - DELETE_COMPLETE - AWS::DynamoDB::Table - TodosDynamoDbTable
CloudFormation - DELETE_IN_PROGRESS - AWS::ApiGateway::RestApi - ApiGatewayRestApi
CloudFormation - DELETE_COMPLETE - AWS::Logs::LogGroup - CreateLogGroup
CloudFormation - DELETE_COMPLETE - AWS::ApiGateway::RestApi - ApiGatewayRestApi
CloudFormation - UPDATE_ROLLBACK_COMPLETE - AWS::CloudFormation::Stack - serverless-rest-api-with-dynamodb87-dev
Serverless: Deployment failed!
 
  Serverless Error ---------------------------------------
 
     An error occurred while provisioning your stack: TodosDynamoDbTable
     - serverless-rest-api-with-dynamodb87-dev already exists.
 
  Stack Trace --------------------------------------------
 
ServerlessError: An error occurred while provisioning your stack: TodosDynamoDbTable - serverless-rest-api-with-dynamodb87-dev already exists.
    at provider.request.then (/usr/local/lib/node_modules/serverless/lib/plugins/aws/lib/monitorStack.js:112:33)
From previous event:
    at AwsDeploy.monitorStack (/usr/local/lib/node_modules/serverless/lib/plugins/aws/lib/monitorStack.js:29:12)
    at provider.request.then (/usr/local/lib/node_modules/serverless/lib/plugins/aws/lib/updateStack.js:90:30)
From previous event:
    at AwsDeploy.update (/usr/local/lib/node_modules/serverless/lib/plugins/aws/lib/updateStack.js:90:8)
From previous event:
    at AwsDeploy.BbPromise.bind.then.then (/usr/local/lib/node_modules/serverless/lib/plugins/aws/lib/updateStack.js:111:12)
From previous event:
    at AwsDeploy.updateStack (/usr/local/lib/node_modules/serverless/lib/plugins/aws/lib/updateStack.js:103:8)
From previous event:
    at Object.deploy:deploy [as fn] (/usr/local/lib/node_modules/serverless/lib/plugins/aws/deploy/index.js:55:10)
    at BbPromise.reduce (/usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:210:55)
    at runCallback (timers.js:651:20)
    at tryOnImmediate (timers.js:624:5)
    at processImmediate [as _immediateCallback] (timers.js:596:5)
From previous event:
    at PluginManager.invoke (/usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:210:22)
    at PluginManager.run (/usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:225:17)
    at Serverless.run (/usr/local/lib/node_modules/serverless/lib/Serverless.js:97:31)
    at serverless.init.then (/usr/local/lib/node_modules/serverless/bin/serverless:23:50)
 
  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Forums:        forum.serverless.com
     Chat:          gitter.im/serverless/serverless
 
  Your Environment Information -----------------------------
     OS:                 darwin
     Node Version:       7.3.0
     Serverless Version: 1.11.0

aws-node-single-page-app-via-cloudfront errors when deploying

I got the following error when deploying:

Serverless Error ---------------------------------------

 An error occurred while provisioning your stack: WebAppS3BucketPolicy
 - Policy has invalid resource.

There's not much to debug from here.

Edit:

If I try to deploy again, I get this error:

Serverless Error ---------------------------------------

 Stack:arn:aws:cloudformation:us-east-1:162064893105:stack/single-page-app-via-cloudfront7-dev/9b33a8c0-f558-11e6-a02b-50d5ca6e6082
 is in UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS state
 and can not be updated.

Edit 2:

If I wait long enough, the UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS error goes away but I'm still getting the policy error.

Example for receiving a file through API Gateway and uploading it to S3

Hey,

I'm wondering if there is any good example which could be added to the list of examples, where a file (image, pdf, whatever) could be received through the API Gateway in a POST-request and then uploaded into a S3.

I think it would be great to have it, since it is a rather common use case for Lambdas.

Best regards,
Keksike

Stripe Integration Example

Let us know if you interested to work on this. I comment here if one of the core-team is starting to work on it.

Error during serverless syncToS3

I got the cloud formation template & s3 bucket deployed using serverless deploy. but when I invoke serverless syncToS3, I'm getting Serverless: fatal error: Unable to locate credentials.

The credentials within the serverless.yaml file worked when creating the stack. But somehow they are not letting me upload s3 artifacts.

Add more OpenWhisk examples

OpenWhisk has a list of example projects listed in the awesome list.

We want to convert some of these to examples in the serverless project repository, showing off features of the toolkit.

For example....

  • HTTP API Gateway Integration.
  • Basic trigger feeds.
  • Alarm-based schedulers.

Slack Bot example

Let us know if you interested to work on this. I comment here if one of the core-team is starting to work on it.

Contact for uses of serverless

README mentions we should contact someone when we create applications derived from serverless examples. Who should we contact?

All endpoints return {"message": "Internal server error"} on aws-node-rest-api-with-dynamodb

@christophgysin ran into another issue. Sorry to keep bugging.

You can see that the example is successfully deployed, however, I immediately perform a curl to get all todos and it returns the error.

waltermvp@Walters-MacBook-Pro:~/Development/Open/examples/aws-node-rest-api-with-dynamodb (master)$ SLS_DEBUG="*" sls deploy --verbose
Serverless: Creating Stack...
Serverless: Checking Stack create progress...
CloudFormation - CREATE_IN_PROGRESS - AWS::CloudFormation::Stack - serverless-short-test2-dev
CloudFormation - CREATE_IN_PROGRESS - AWS::S3::Bucket - ServerlessDeploymentBucket
CloudFormation - CREATE_IN_PROGRESS - AWS::S3::Bucket - ServerlessDeploymentBucket
CloudFormation - CREATE_COMPLETE - AWS::S3::Bucket - ServerlessDeploymentBucket
CloudFormation - CREATE_COMPLETE - AWS::CloudFormation::Stack - serverless-short-test2-dev
Serverless: Stack create finished...
Serverless: Packaging service...
Serverless: Uploading CloudFormation file to S3...
Serverless: Uploading function .zip files to S3...
Serverless: Uploading service .zip file to S3 (431.03 KB)...
Serverless: Updating Stack...
Serverless: Checking Stack update progress...
CloudFormation - CREATE_COMPLETE - AWS::CloudFormation::Stack - serverless-short-test2-dev
CloudFormation - UPDATE_IN_PROGRESS - AWS::CloudFormation::Stack - serverless-short-test2-dev
CloudFormation - CREATE_IN_PROGRESS - AWS::ApiGateway::RestApi - ApiGatewayRestApi
CloudFormation - CREATE_IN_PROGRESS - AWS::IAM::Role - IamRoleLambdaExecution
CloudFormation - CREATE_IN_PROGRESS - AWS::Logs::LogGroup - CreateLogGroup
CloudFormation - CREATE_IN_PROGRESS - AWS::Logs::LogGroup - ListLogGroup
CloudFormation - CREATE_IN_PROGRESS - AWS::Logs::LogGroup - UpdateLogGroup
CloudFormation - CREATE_IN_PROGRESS - AWS::DynamoDB::Table - TodosDynamoDbTable
CloudFormation - CREATE_IN_PROGRESS - AWS::ApiGateway::RestApi - ApiGatewayRestApi
CloudFormation - CREATE_IN_PROGRESS - AWS::Logs::LogGroup - GetLogGroup
CloudFormation - CREATE_COMPLETE - AWS::ApiGateway::RestApi - ApiGatewayRestApi
CloudFormation - CREATE_IN_PROGRESS - AWS::Logs::LogGroup - CreateLogGroup
CloudFormation - CREATE_IN_PROGRESS - AWS::IAM::Role - IamRoleLambdaExecution
CloudFormation - CREATE_IN_PROGRESS - AWS::Logs::LogGroup - UpdateLogGroup
CloudFormation - CREATE_IN_PROGRESS - AWS::DynamoDB::Table - TodosDynamoDbTable
CloudFormation - CREATE_COMPLETE - AWS::Logs::LogGroup - CreateLogGroup
CloudFormation - CREATE_IN_PROGRESS - AWS::Logs::LogGroup - ListLogGroup
CloudFormation - CREATE_COMPLETE - AWS::Logs::LogGroup - UpdateLogGroup
CloudFormation - CREATE_IN_PROGRESS - AWS::Logs::LogGroup - GetLogGroup
CloudFormation - CREATE_COMPLETE - AWS::Logs::LogGroup - GetLogGroup
CloudFormation - CREATE_COMPLETE - AWS::Logs::LogGroup - ListLogGroup
CloudFormation - CREATE_IN_PROGRESS - AWS::Logs::LogGroup - DeleteLogGroup
CloudFormation - CREATE_IN_PROGRESS - AWS::Logs::LogGroup - DeleteLogGroup
CloudFormation - CREATE_COMPLETE - AWS::Logs::LogGroup - DeleteLogGroup
CloudFormation - CREATE_IN_PROGRESS - AWS::ApiGateway::Resource - ApiGatewayResourceTodos
CloudFormation - CREATE_IN_PROGRESS - AWS::ApiGateway::Resource - ApiGatewayResourceTodos
CloudFormation - CREATE_COMPLETE - AWS::ApiGateway::Resource - ApiGatewayResourceTodos
CloudFormation - CREATE_COMPLETE - AWS::IAM::Role - IamRoleLambdaExecution
CloudFormation - CREATE_IN_PROGRESS - AWS::ApiGateway::Method - ApiGatewayMethodTodosOptions
CloudFormation - CREATE_IN_PROGRESS - AWS::ApiGateway::Resource - ApiGatewayResourceTodosIdVar
CloudFormation - CREATE_IN_PROGRESS - AWS::ApiGateway::Method - ApiGatewayMethodTodosOptions
CloudFormation - CREATE_IN_PROGRESS - AWS::Lambda::Function - DeleteLambdaFunction
CloudFormation - CREATE_COMPLETE - AWS::ApiGateway::Method - ApiGatewayMethodTodosOptions
CloudFormation - CREATE_IN_PROGRESS - AWS::Lambda::Function - UpdateLambdaFunction
CloudFormation - CREATE_IN_PROGRESS - AWS::Lambda::Function - ListLambdaFunction
CloudFormation - CREATE_IN_PROGRESS - AWS::Lambda::Function - GetLambdaFunction
CloudFormation - CREATE_IN_PROGRESS - AWS::Lambda::Function - CreateLambdaFunction
CloudFormation - CREATE_IN_PROGRESS - AWS::ApiGateway::Resource - ApiGatewayResourceTodosIdVar
CloudFormation - CREATE_IN_PROGRESS - AWS::Lambda::Function - DeleteLambdaFunction
CloudFormation - CREATE_COMPLETE - AWS::ApiGateway::Resource - ApiGatewayResourceTodosIdVar
CloudFormation - CREATE_COMPLETE - AWS::Lambda::Function - DeleteLambdaFunction
CloudFormation - CREATE_IN_PROGRESS - AWS::Lambda::Function - UpdateLambdaFunction
CloudFormation - CREATE_IN_PROGRESS - AWS::Lambda::Function - ListLambdaFunction
CloudFormation - CREATE_COMPLETE - AWS::Lambda::Function - UpdateLambdaFunction
CloudFormation - CREATE_COMPLETE - AWS::Lambda::Function - ListLambdaFunction
CloudFormation - CREATE_IN_PROGRESS - AWS::Lambda::Function - CreateLambdaFunction
CloudFormation - CREATE_COMPLETE - AWS::Lambda::Function - CreateLambdaFunction
CloudFormation - CREATE_IN_PROGRESS - AWS::ApiGateway::Method - ApiGatewayMethodTodosIdVarOptions
CloudFormation - CREATE_IN_PROGRESS - AWS::ApiGateway::Method - ApiGatewayMethodTodosIdVarDelete
CloudFormation - CREATE_IN_PROGRESS - AWS::ApiGateway::Method - ApiGatewayMethodTodosIdVarOptions
CloudFormation - CREATE_IN_PROGRESS - AWS::Lambda::Permission - DeleteLambdaPermissionApiGateway
CloudFormation - CREATE_IN_PROGRESS - AWS::ApiGateway::Method - ApiGatewayMethodTodosIdVarDelete
CloudFormation - CREATE_IN_PROGRESS - AWS::ApiGateway::Method - ApiGatewayMethodTodosGet
CloudFormation - CREATE_COMPLETE - AWS::ApiGateway::Method - ApiGatewayMethodTodosIdVarDelete
CloudFormation - CREATE_IN_PROGRESS - AWS::Lambda::Version - ListLambdaVersionvFSmJAY4jqmJqLz3Nj1bDHiSn2Hy2jLHIlL4w9hCbQ
CloudFormation - CREATE_COMPLETE - AWS::ApiGateway::Method - ApiGatewayMethodTodosIdVarOptions
CloudFormation - CREATE_IN_PROGRESS - AWS::ApiGateway::Method - ApiGatewayMethodTodosGet
CloudFormation - CREATE_IN_PROGRESS - AWS::ApiGateway::Method - ApiGatewayMethodTodosIdVarPut
CloudFormation - CREATE_IN_PROGRESS - AWS::Lambda::Permission - DeleteLambdaPermissionApiGateway
CloudFormation - CREATE_IN_PROGRESS - AWS::ApiGateway::Method - ApiGatewayMethodTodosIdVarPut
CloudFormation - CREATE_COMPLETE - AWS::ApiGateway::Method - ApiGatewayMethodTodosGet
CloudFormation - CREATE_IN_PROGRESS - AWS::Lambda::Version - UpdateLambdaVersionvFSmJAY4jqmJqLz3Nj1bDHiSn2Hy2jLHIlL4w9hCbQ
CloudFormation - CREATE_COMPLETE - AWS::ApiGateway::Method - ApiGatewayMethodTodosIdVarPut
CloudFormation - CREATE_IN_PROGRESS - AWS::Lambda::Version - ListLambdaVersionvFSmJAY4jqmJqLz3Nj1bDHiSn2Hy2jLHIlL4w9hCbQ
CloudFormation - CREATE_COMPLETE - AWS::Lambda::Version - ListLambdaVersionvFSmJAY4jqmJqLz3Nj1bDHiSn2Hy2jLHIlL4w9hCbQ
CloudFormation - CREATE_IN_PROGRESS - AWS::Lambda::Version - UpdateLambdaVersionvFSmJAY4jqmJqLz3Nj1bDHiSn2Hy2jLHIlL4w9hCbQ
CloudFormation - CREATE_IN_PROGRESS - AWS::Lambda::Function - GetLambdaFunction
CloudFormation - CREATE_IN_PROGRESS - AWS::Lambda::Permission - ListLambdaPermissionApiGateway
CloudFormation - CREATE_COMPLETE - AWS::Lambda::Version - UpdateLambdaVersionvFSmJAY4jqmJqLz3Nj1bDHiSn2Hy2jLHIlL4w9hCbQ
CloudFormation - CREATE_COMPLETE - AWS::Lambda::Function - GetLambdaFunction
CloudFormation - CREATE_IN_PROGRESS - AWS::Lambda::Permission - ListLambdaPermissionApiGateway
CloudFormation - CREATE_IN_PROGRESS - AWS::ApiGateway::Method - ApiGatewayMethodTodosPost
CloudFormation - CREATE_IN_PROGRESS - AWS::Lambda::Version - DeleteLambdaVersionvFSmJAY4jqmJqLz3Nj1bDHiSn2Hy2jLHIlL4w9hCbQ
CloudFormation - CREATE_IN_PROGRESS - AWS::ApiGateway::Method - ApiGatewayMethodTodosPost
CloudFormation - CREATE_COMPLETE - AWS::ApiGateway::Method - ApiGatewayMethodTodosPost
CloudFormation - CREATE_IN_PROGRESS - AWS::Lambda::Version - DeleteLambdaVersionvFSmJAY4jqmJqLz3Nj1bDHiSn2Hy2jLHIlL4w9hCbQ
CloudFormation - CREATE_IN_PROGRESS - AWS::Lambda::Permission - UpdateLambdaPermissionApiGateway
CloudFormation - CREATE_IN_PROGRESS - AWS::Lambda::Version - CreateLambdaVersionvFSmJAY4jqmJqLz3Nj1bDHiSn2Hy2jLHIlL4w9hCbQ
CloudFormation - CREATE_COMPLETE - AWS::Lambda::Version - DeleteLambdaVersionvFSmJAY4jqmJqLz3Nj1bDHiSn2Hy2jLHIlL4w9hCbQ
CloudFormation - CREATE_COMPLETE - AWS::DynamoDB::Table - TodosDynamoDbTable
CloudFormation - CREATE_IN_PROGRESS - AWS::Lambda::Permission - UpdateLambdaPermissionApiGateway
CloudFormation - CREATE_IN_PROGRESS - AWS::ApiGateway::Method - ApiGatewayMethodTodosIdVarGet
CloudFormation - CREATE_IN_PROGRESS - AWS::Lambda::Permission - CreateLambdaPermissionApiGateway
CloudFormation - CREATE_IN_PROGRESS - AWS::ApiGateway::Method - ApiGatewayMethodTodosIdVarGet
CloudFormation - CREATE_IN_PROGRESS - AWS::Lambda::Permission - CreateLambdaPermissionApiGateway
CloudFormation - CREATE_COMPLETE - AWS::ApiGateway::Method - ApiGatewayMethodTodosIdVarGet
CloudFormation - CREATE_COMPLETE - AWS::Lambda::Permission - DeleteLambdaPermissionApiGateway
CloudFormation - CREATE_IN_PROGRESS - AWS::Lambda::Version - CreateLambdaVersionvFSmJAY4jqmJqLz3Nj1bDHiSn2Hy2jLHIlL4w9hCbQ
CloudFormation - CREATE_COMPLETE - AWS::Lambda::Version - CreateLambdaVersionvFSmJAY4jqmJqLz3Nj1bDHiSn2Hy2jLHIlL4w9hCbQ
CloudFormation - CREATE_IN_PROGRESS - AWS::Lambda::Version - GetLambdaVersionvFSmJAY4jqmJqLz3Nj1bDHiSn2Hy2jLHIlL4w9hCbQ
CloudFormation - CREATE_IN_PROGRESS - AWS::Lambda::Permission - GetLambdaPermissionApiGateway
CloudFormation - CREATE_COMPLETE - AWS::Lambda::Permission - ListLambdaPermissionApiGateway
CloudFormation - CREATE_IN_PROGRESS - AWS::Lambda::Permission - GetLambdaPermissionApiGateway
CloudFormation - CREATE_IN_PROGRESS - AWS::Lambda::Version - GetLambdaVersionvFSmJAY4jqmJqLz3Nj1bDHiSn2Hy2jLHIlL4w9hCbQ
CloudFormation - CREATE_COMPLETE - AWS::Lambda::Version - GetLambdaVersionvFSmJAY4jqmJqLz3Nj1bDHiSn2Hy2jLHIlL4w9hCbQ
CloudFormation - CREATE_COMPLETE - AWS::Lambda::Permission - UpdateLambdaPermissionApiGateway
CloudFormation - CREATE_IN_PROGRESS - AWS::ApiGateway::Deployment - ApiGatewayDeployment1493232080255
CloudFormation - CREATE_COMPLETE - AWS::Lambda::Permission - CreateLambdaPermissionApiGateway
CloudFormation - CREATE_IN_PROGRESS - AWS::ApiGateway::Deployment - ApiGatewayDeployment1493232080255
CloudFormation - CREATE_COMPLETE - AWS::ApiGateway::Deployment - ApiGatewayDeployment1493232080255
CloudFormation - CREATE_COMPLETE - AWS::Lambda::Permission - GetLambdaPermissionApiGateway
CloudFormation - UPDATE_COMPLETE_CLEANUP_IN_PROGRESS - AWS::CloudFormation::Stack - serverless-short-test2-dev
CloudFormation - UPDATE_COMPLETE - AWS::CloudFormation::Stack - serverless-short-test2-dev
Serverless: Stack update finished...
Service Information
service: serverless-short-test2
stage: dev
region: us-east-1
api keys:
  None
endpoints:
  POST - https://yhhzsbppdj.execute-api.us-east-1.amazonaws.com/dev/todos
  GET - https://yhhzsbppdj.execute-api.us-east-1.amazonaws.com/dev/todos
  GET - https://yhhzsbppdj.execute-api.us-east-1.amazonaws.com/dev/todos/{id}
  PUT - https://yhhzsbppdj.execute-api.us-east-1.amazonaws.com/dev/todos/{id}
  DELETE - https://yhhzsbppdj.execute-api.us-east-1.amazonaws.com/dev/todos/{id}
functions:
  create: serverless-short-test2-dev-create
  list: serverless-short-test2-dev-list
  get: serverless-short-test2-dev-get
  update: serverless-short-test2-dev-update
  delete: serverless-short-test2-dev-delete

Stack Outputs
DeleteLambdaFunctionQualifiedArn: arn:aws:lambda:us-east-1:056882338896:function:serverless-short-test2-dev-delete:1
CreateLambdaFunctionQualifiedArn: arn:aws:lambda:us-east-1:056882338896:function:serverless-short-test2-dev-create:1
GetLambdaFunctionQualifiedArn: arn:aws:lambda:us-east-1:056882338896:function:serverless-short-test2-dev-get:1
UpdateLambdaFunctionQualifiedArn: arn:aws:lambda:us-east-1:056882338896:function:serverless-short-test2-dev-update:1
ListLambdaFunctionQualifiedArn: arn:aws:lambda:us-east-1:056882338896:function:serverless-short-test2-dev-list:1
ServiceEndpoint: https://yhhzsbppdj.execute-api.us-east-1.amazonaws.com/dev
ServerlessDeploymentBucketName: serverless-short-test2-d-serverlessdeploymentbuck-1lin9n3dy4vvz

waltermvp@Walters-MacBook-Pro:~/Development/Open/examples/aws-node-rest-api-with-dynamodb (master)$ curl https://yhhzsbppdj.execute-api.us-east-1.amazonaws.com/dev/todos
{"message": "Internal server error"}waltermvp@Walters-MacBook-Pro:~/Development/Open/examples/aws-node-rest-api-with-dynamodb (master)$ 

Deploy API Gateway NodeJS + MongoDB

I have a similar scenario as the example AWS Node REST API + MongoDB.

The main difference of my project is that I wrote the service in multiple files using modules for better testability.

I can package and deploy from my Mac, but I'm implementing some CI/CD using Bitbucket Pipelines for my project. And as I use bcrypt for password generation and user authentication I need to use a docker image for bitbucket-pipelines that mimics the AWS AMI used for AWS Lambda deploys.

The main problem is that when I use the serverless deploy on the Linux machine, the command returns an error in the Bitbucket Pipelines:

Serverless Error ---------------------------------------
 
An error occurred while provisioning your stack: UserAuthLambdaFunction
    - Unzipped size must be smaller than 262144000 bytes.
 
Stack Trace --------------------------------------------

An example of my setup is the following:

Files and folders:

__tests__/ # jest folder for model and services test
bitbucket-pipelines.yml
config/
models/
package.json
serverless.yml
services/
userService.js
yarn.lock

My serverless.yml file is setup as this:

service: <NAME-OF-MY-SERVICE>

provider:
  name: aws
  runtime: nodejs6.10
  profile: ${env:AWS_PROFILE}
  stage: ${env:STAGE_ENVIRONMENT}
  region: us-east-2

functions:
  userSignup:
    handler: userService.signup
    events:
      - http:
          path: users
          method: post
  userAuth:
    handler: userService.auth
    events:
      - http:
          path: users/sign_in
          method: post

package:
  exclude:
    - .git/**
    - .gitignore
    - __tests__/**
    - config/utils.js
    - bitbucket-pipelines.yml
    - yarn.lock

My userService.js handler file is setup as this:

'use strict'

const mongoose = require('./config/mongoose')
require('dotenv').config()
let db = mongoose.connect(process.env.MONGO_URL)

const UserService = require('./services/users')
const userService = new UserService()

module.exports.signup = (event, context, cb) => {
  userService.signup(event, (err, res) => {
    cb(err, res)
    db.disconnect()
  })
}

module.exports.auth = (event, context, cb) => {
  const response = {
    statusCode: 200,
    body: {
      message: 'userService auth endpoint',
      payload: event.body
    }
  }

  cb(null, response)
  db.disconnect()
}

My service currently only does the signup part and return an authorization token as the response body. I need to know how the Mac deploys successfully (but with error from native modules as bcrypt being generated with the different architecture needed), and the Linux (AWS AMI) one can't deploy.

Separate Event for Alexa Smart Home Skill Trigger

AWS offers a separate trigger called 'Alexa Smart Home' for their Smart Home skills, besides the regular 'Alexa Skills Kit' trigger. It would be great if this could be added as a new event besides the alexaSkill option, as I am currently unable to transfer our existing Lambda function to the Serverless Framework

aws-node-single-page-app-via-cloudfront deploy error

I get the following error when I make the "serverless deploy":

  Syntax Error -------------------------------------------
 
     Unexpected token )
 
     For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.
 
  Stack Trace --------------------------------------------
 
SyntaxError: Unexpected token )
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:373:25)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at /usr/lib/node_modules/serverless/lib/classes/PluginManager.js:59:22
    at Array.forEach (native)
    at PluginManager.loadPlugins (/usr/lib/node_modules/serverless/lib/classes/PluginManager.js:58:13)
    at PluginManager.loadServicePlugins (/usr/lib/node_modules/serverless/lib/classes/PluginManager.js:86:10)
    at PluginManager.loadAllPlugins (/usr/lib/node_modules/serverless/lib/classes/PluginManager.js:54:10)
    at /usr/lib/node_modules/serverless/lib/Serverless.js:64:28
 
  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
 
     Please report this error. We think it might be a bug.
 
  Your Environment Information -----------------------------
     OS:                 linux
     Node Version:       4.6.1
     Serverless Version: 1.3.0

aws-node-rest-api-with-dynamodb-and-offline always returns an Error

I'm having issues with the offline plugin. Is this normal? Error: connect ECONNREFUSED 127.0.0.1:8000. Not sure since the local host is 3000

waltermvp@Walters-MacBook-Pro:~/Development/Open/examples/aws-node-rest-api-with-dynamodb-and-offline (master)$ sls offline
Serverless: Starting Offline: dev/us-east-1.

Serverless: Routes for create:
Serverless: POST /todos

Serverless: Routes for list:
Serverless: GET /todos

Serverless: Routes for get:
Serverless: GET /todos/{id}

Serverless: Routes for update:
Serverless: PUT /todos/{id}

Serverless: Routes for delete:
Serverless: DELETE /todos/{id}

Serverless: Offline listening on http://localhost:3000

Serverless: GET /todos (λ: list)
Serverless: The first request might take a few extra seconds
Serverless: 
{ Error: connect ECONNREFUSED 127.0.0.1:8000
    at Object.exports._errnoException (util.js:1022:11)
    at exports._exceptionWithHostPort (util.js:1045:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1090:14)
  message: 'connect ECONNREFUSED 127.0.0.1:8000',
  code: 'NetworkingError',
  errno: 'ECONNREFUSED',
  syscall: 'connect',
  address: '127.0.0.1',
  port: 8000,
  region: 'localhost',
  hostname: 'localhost',
  retryable: true,
  time: 2017-05-01T15:17:51.864Z }
Serverless: Failure: Couldn't fetch the todos.
Serverless: Replying 200

UUIDs *and* timestamps?

{"text":"Learn Serverless","id":"ee6490d0-aa81-11e6-9ede-afdfa051af86","createdAt":1479138570824,"checked":false,"updatedAt":1479138570824}%

I used to think, UUID is a timestamp plus process id (v1)
Are these UUIDs random (v4) ?

Python Auth0 Example

Hello, I am looking for an example of doing auth0 with python but I am having a hard time finding the correct procedure.

aws-node-alexa-skill example response causing error in Service Simulator Tool

https://github.com/serverless/examples/tree/master/aws-node-alexa-skill
I get the following when invoking the skill using the Service Simulator Tool
Error: There was a failure invoking your skill with text input, please try again.

The solution was to send the setEndSession attribute in the response because it is a required field when using the Service Simulator Tool to test the skill. I set shouldEndSession: false in the response and it resolved the issue

reference:
https://forums.developer.amazon.com/questions/57631/error-there-was-a-failure-invoking-your-skill-with-3.html

aws-node-rest-api-with-dynamodb -- server error

I worked through this particular example. The stack completes and the DynamoDB table is created just fine. When I try to create a ToDo item, the response is "message", "internalServererror". Not sure what a did wrong.

Remote MongoDB Example

I would like to provide a NodeJS example for remote mongodb (Atlas , or Mlab etc... )

Can i submit a PR for this ?

aws-node-rest-api-with-dynamodb 502 Bad Gateway

When I execute any of my resources I get 502 Bad Gateway.

Here is the exact response when ran from the API Gateway console:

Execution log for request test-request
Sat Feb 04 04:37:12 UTC 2017 : Starting execution for request: test-invoke-request
Sat Feb 04 04:37:12 UTC 2017 : HTTP Method: GET, Resource Path: /todos
Sat Feb 04 04:37:12 UTC 2017 : Method request path: {}
Sat Feb 04 04:37:12 UTC 2017 : Method request query string: {}
Sat Feb 04 04:37:12 UTC 2017 : Method request headers: {}
Sat Feb 04 04:37:12 UTC 2017 : Method request body before transformations:
Sat Feb 04 04:37:12 UTC 2017 : Endpoint request URI: https://lambda.us-east-1.amazonaws.com/2015-03-31/functions/arn:aws:lambda:us-east-1xxxxxx:function:serverless-rest-api-with-dynamodb-dev-list/invocations
Sat Feb 04 04:37:12 UTC 2017 : Endpoint request headers: {x-amzn-lambda-integration-tag=test-request, Authorization=****************************************************************************************************************************************************************************************************************************************************************************************************************************************, X-Amz-Date=20170204T043712Z, x-amzn-apigateway-api-id=xxxxxxxxxx, X-Amz-Source-Arn=arn:aws:execute-api:us-east-1:xxxxxxxxx/null/GET/todos, Accept=application/json, User-Agent=AmazonAPIGateway_xxxxxxx, X-Amz-Security-
[----omitted----]
Sat Feb 04 04:37:12 UTC 2017 : Endpoint response body before transformations: {"errorMessage":"Couldn't fetch the todos.","errorType":"Error","stackTrace":["Response. (/var/task/todos/list.js:16:16)","Request. (/var/task/node_modules/aws-sdk/lib/request.js:355:18)","Request.callListeners (/var/task/node_modules/aws-sdk/lib/sequential_executor.js:105:20)","Request.emit (/var/task/node_modules/aws-sdk/lib/sequential_executor.js:77:10)","Request.emit (/var/task/node_modules/aws-sdk/lib/request.js:668:14)","Request.transition (/var/task/node_modules/aws-sdk/lib/request.js:22:10)","AcceptorStateMachine.runTo (/var/task/node_modules/aws-sdk/lib/state_machine.js:14:12)","/var/task/node_modules/aws-sdk/lib/state_machine.js:26:10","Request. (/var/task/node_modules/aws-sdk/lib/request.js:38:9)","Request. (/var/task/node_modules/aws-sdk/lib/request.js:670:12)"]}
Sat Feb 04 04:37:12 UTC 2017 : Endpoint response headers: {x-amzn-Remapped-Content-Length=0, x-amzn-RequestId=989d821e-ea93-11e6-be3d-6768b0c930a1, Connection=keep-alive, Content-Length=829, X-Amz-Function-Error=Handled, Date=Sat, 04 Feb 2017 04:37:11 GMT, Content-Type=application/json}
Sat Feb 04 04:37:12 UTC 2017 : Execution failed due to configuration error: Malformed Lambda proxy response
Sat Feb 04 04:37:12 UTC 2017 : Method completed with status: 502

I have tried switching to lambda instead of lambda-proxy. This results in a 500.

Error using the GitHub Webhook example

Situation

I am setting up the aws-node-github-webhook-listener example for a project at Netlify and running into the error where the generated sha1 create from my secret GitHub token set in my webhook settings never matched the one in header['X-Hub-Signature'].

screenshot 2017-06-23 17 27 22

Complication

There is a function that creates sha1 based on the github event body and secret key.

function signRequestBody(key, body) {
  // key is my secret
  return `sha1=${crypto.createHmac('sha1', key).update(body, 'utf-8').digest('hex')}`;
}

Question

TBH, I don't have ever encountered a problem where I needed to compared encrypted data. Is there that someone has a working example of this in the wild? Is there is something I am overlooking?

My function works fine of course if I remove this secret checking, but my guess is @DavidWells has this working as is 😄. Just need some gentle nudging in the correct direction.

Error Message

Error Message from my logs:

{"errorMessage":"[401] X-Hub-Signature incorrect. Github webhook token doesn't match","errorType":"Error","stackTrace":["module.exports.githubWebhookListener (/var/task/handler.js:52:21)"]}
// serverless.yml

service: netlify-cms-www-webhook

provider:
  name: aws
  runtime: nodejs6.10
  environment:
    GITHUB_WEBHOOK_SECRET: unencrytedSecret
    NETLIFY_WEBHOOK_BUILD: https://api.netlify.com/build_hooks/12345

Live Code is at https://github.com/netlify/netlify-cms-docs-webhook

How to remove default body template for java?

default request body template for API Gateway

  • application/json
  • application/x-www-form-urlencoded

How can I remove default request body template?
Currently request gets from "body" template.
How Can I get body request on root level?
I want to access direct request object.

Failing with "Parameter 'url' must be a string, not undefined"

Hi,
I am new to Serverless and Node.js. I am trying to run the "aws-node-fetch-file-and-store-in-s3" example. I have not modified the code. Here is how I am invoking it.

serverless invoke -f save -l -d "{'image_url':'https://assets-cdn.github.com/images/modules/open_graph/github-mark.png','key':'github.png'}"

I am getting the following error message.

{
    "errorMessage": "Parameter 'url' must be a string, not undefined",
    "errorType": "TypeError",
    "stackTrace": [
        "Url.parse (url.js:90:11)",
        "urlParse (url.js:84:5)",
        "Body.Request (/var/task/node_modules/node-fetch/lib/request.js:27:16)",
        "/var/task/node_modules/node-fetch/index.js:51:17",
        "new Fetch (/var/task/node_modules/node-fetch/index.js:49:9)",
        "Fetch (/var/task/node_modules/node-fetch/index.js:37:10)",
        "module.exports.save.fetch.then.then.response.then.buffer.then (/var/task/handler.
js:9:3)"
    ]
}

I guess I am doing a silly error, but I am not able to get rid of it. Please help.

Thanks in advance.

Serving Dynamic HTML how to add JS and CSS files

Hello,

I followed your examples on how to set the response to HTML. Now I am wondering how would I add CSS and JS to the HTML output? I was spinning my head around and tried some S3 alternatives but they are all not working on serverless 1.x

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.