DEV Community

Cover image for serverless framework template
Meir Gabay
Meir Gabay

Posted on

5 4

serverless framework template

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

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more