Skip to content

jshaw-cm/vf-going-serverless

Repository files navigation

vf-going-serverless

TLDR

Copy and paste this line.

  • npm i && npm run build && npm run sls -- deploy --stage <stage>

Table of Contents

This is a serverless application that deploys a Lambda, DynamoDB, and S3 bucket. Upon deploy, a file will be synced to the S3 bucket, and a custom serverless plugin will invoke the lambda which will read the file from S3 and store the contents of the file in dynamodb.

Prerequisites

Getting Started

Structure

  • vf-going-serverless: This is the root of the serverless project.
  • vf-going-serverless/app: This is the lambda applicatin.
  • upload: This directory will be synced to the S3 bucket after the deployment of the serverless application.
  • vf-going-serverless/plugin/invoke-after-deploy: This is the plugin for invoking the lambda after the serverless deployment.
  • .vscode: Settings for vscode (lint on save). Tasks settings.

Usage

Install dependencies

$ vf-going-serverless
npm i

This will install dependencies in:

  • vf-going-serverless
  • vf-going-serverless/app
  • vf-going-serverless/plugin/invoke-after-deploy

Build

$ vf-going-serverless
npm run build

This will lint and build:

  • vf-going-serverless/app
  • vf-going-serverless/plugin/invoke-after-deploy

Setup environment

Setup your access key and secret:

export AWS_ACCESS_KEY_ID=<your-access-key>
export AWS_SECRET_ACCESS_KEY=<your-secret>

Deploy

$ vf-going-serverless
npm run sls -- deploy --stage <stage>

Some extra stuff

  • jest for unit testing.
  • eslint for linting typescript.
  • husky to test and lint before pushing code.
  • prettier for formatting code.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published