DEV Community

loading...
Cover image for serverless framework template

serverless framework template

unfor19 profile image Meir Gabay ・1 min read

Looking for a reusable template to start your serverless framework journey in AWS? You've come to the right place.

Goals

Repository

GitHub logo unfor19 / serverless-template

Boilerplate template for the serverless-framework

serverless-template

Serverless-Template

GitHub version Build Status License: MIT serverless

Boilerplate template for the serverless-framework.

Want to learn how to get start with the serverless framework? Watch my YouTube video where I explain about how to use the framework, while using this GitHub repository.

Requirements

  1. AWS account

  2. Docker

Getting Started

Goal

Deploy two serverless services (APIs)

  • todo-api - NodeJS 12.x (JavaScript/TypeScript)
    • CRUD app - To keep it simple, we're using an S3 bucket as a database. The contents are saved to the objects' user-defined metadata
  • greet-api - Python 3.8
    • Send a name and get a greeting

Both services have dependencies, and we'll use Lambda Layers to meet these dependencies.

  1. Clone this repository (or Use as template and then clone)

    $ (home) git clone https://github.com/unfor19/serverless-template.git
    Enter fullscreen mode Exit fullscreen mode
  2. Use this Docker image

    Image Usage Examples
    • With aws-vault

      $ (serverless-template) aws-vault exec PROFILE_NAME -- bash ./scripts/docker_run.sh
      Enter fullscreen mode Exit fullscreen mode
    • AWS Environment variables

      $ (serverless-template) export AWS_SECRET_ACCESS_KEY=A123123
      $ (serverless-template) export AWS_ACCESS_KEY_ID=B1232123123
      $ (serverless-template) export AWS_REGION=eu-west-1
      $ (serverless-template) export
      Enter fullscreen mode Exit fullscreen mode

Discussion (0)

Forem Open with the Forem app