Giter Club home page Giter Club logo

typescript-aws-lambda-terraform's Introduction

Typescript AWS Terraform Starter

A boilerplate for developing serverless applications with typescript and terraform.

  • webpack to compile deployment packages.
  • jest and for testing
  • typescript-is to validate event input
  • ✅ Minimal terraform configuration to manage deployment.

Prerequisites:

I believe both can be installed via brew (`brew install terraform aws)

Commands

  • npm run build - Turns all typescript files in lambda-fns into lambda deployment packages (To deploy run )
  • npm run test - Runs all tests
  • npm run test:watch - Rerun tests when files change
  • npm run plan - Display terraform deployment plan. Shows you what AWS resources will be created.
  • npm run deploy - Deploys project to aws with terraform
  • npm run destroy - Tear down project on aws with terraform

Adding more Lambdas

  1. Simply duplicate lambda-fns/example.ts and edit the file and filename.
  2. Run npm run deploy and all files in lambda-fns will be deployed on AWS as lambda handlers.

Validating lambda input

This boilerplate uses typescript-is to check types at runtime, you can use this as an easy way to validate lambda input, the example handler at lambda-fns/example.ts uses assertType<MyEvent>(event) to validate the type of the event.

Testing

This repository uses jest and ts-jest. Every lambda function should have an accompanying test file in lambda-fns/__tests__.

Give feedback or make suggestions

If you have suggestions for what can be improved, please open an issue

Made by Julian, follow me on twitter

typescript-aws-lambda-terraform's People

Contributors

juliankrispel avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.