Typescript AWS Terraform Starter
A boilerplate for developing serverless applications with typescript and terraform.
webpackto compile deployment packages.
jestand for testing
typescript-isto validate event input
- ✅ Minimal terraform configuration to manage deployment.
I believe both can be installed via brew (`brew install terraform aws)
npm run build- Turns all typescript files in
lambda-fnsinto 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
- Simply duplicate
lambda-fns/example.tsand edit the file and filename.
npm run deployand all files in
lambda-fnswill 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
assertType<MyEvent>(event) to validate the type of the event.
This repository uses
Every lambda function should have an accompanying test file in
Give feedback or make suggestions
If you have suggestions for what can be improved, please open an issue