Lambdas-Boilerplate
Lambdas Boilerplate
Table of Contents
Installation
First, clone this Repository:
git clone https://github.com/zappts/Lambdas-Boilerplate.git
Depedencies
- AWS CLI already configured with Admin permissions
- SAM CLI
- NodeJS 8.10+ installed
- Docker installed
Usage
Local development
Running the project
sam local start-api
OR
sh run.sh
If the previous command ran successfully you should now be able to hit the following local endpoint to invoke your function http://localhost:3000/hello
SAM CLI is used to emulate both Lambda and API Gateway locally and uses our template.yaml
to understand how to bootstrap this environment (runtime, where the source code is, etc.) - The following excerpt is what the CLI will read in order to initialize an API and its routes:
Deploying the project
aws cloudformation package --template-file template.yaml --s3-bucket {INSERT-BUCKET-NAME-HERE} --output-template-file sam-packaged.yaml
aws cloudformation deploy --template-file sam-packaged.yaml --stack-name {INSERT-STACK-NAME-HERE} --capabilities CAPABILITY_IAM
OR
sh deploy.sh
Contributing
Please contribute using Github Flow. Create a branch, add commits, and open a pull request.