khaledosman / serverless-node-typescript-dynamodb-s3-lambda

starter template for an AWS lambda with serverless framework, typescript, S3 & DynamoDB integration

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

serverless-node-typescript-dynamodb-s3-lambda

starter template for an AWS lambda with serverless framework, typescript, S3 & DynamoDB integration

This Project was bootstraped using serverless framework using the aws-nodejs-typescript template by running sls create -t aws-nodejs-typescript

Development workflow

  • use npm start to run the project in offline mode and test it locally
  • use npm run-script deploy to deploy the lambda as --region eu-central-1 & --stage live
  • use npm run-script undeploy to delete the lambda and all related resources created by serverless
  • use npm run-script build to generate an output zipfile in build/ directory that you can manually upload to AWS Lambda

Serverless introduction & AWS Setup

  1. See https://serverless.com/framework/docs/providers/aws/guide/installation/ for installation
  2. Create an IAM Role for your serverless lambda & Setup your AWS credentials https://serverless.com/framework/docs/providers/aws/guide/credentials/
  3. use sls deploy to deploy the application
  4. you can setup the environment, region and role for deployment either via the CLI flags or from the serverless.yaml file
  5. environment variables are configured in the serverless.yaml file
  6. if you want to just get a zip file without deploying you can use sls package
  7. Dynamic variables can be set in the yaml file either by passing them to the CLI flags or by inheriting them from different files based on the enviornment, see https://serverless.com/framework/docs/providers/aws/guide/variables/

Running offline

yarn install sls offline start

About

starter template for an AWS lambda with serverless framework, typescript, S3 & DynamoDB integration


Languages

Language:TypeScript 80.0%Language:JavaScript 20.0%