A powerful tool for building serverless applications, the AWS Serverless Application Model (SAM) frequently pairs with JavaScript: 62% of developers across medium and large companies choose JavaScript for their serverless code. However, TypeScript is soaring in popularity and far outranks JavaScript as developers’ third-most-loved language.

While JavaScript boilerplate isn’t hard to find, starting AWS SAM projects with TypeScript is more complex. The following tutorial shows how to create an AWS SAM TypeScript project from scratch as well as how the different parts work together. Readers need be only somewhat familiar with AWS Lambda functions to follow along.

Starting Our AWS SAM TypeScript Project

The groundwork of our serverless application includes various components. We will first configure the AWS environment, our npm package, and Webpack functionality–then we can create, invoke, and test our Lambda function to see our application in action.

Prepare the Environment

To set up the AWS environment, we need to install the following:

  1. AWS CLI
  2. AWS SAM CLI
  3. Node.js and npm

Note that this tutorial requires installing Docker during step 2 above to test our application locally.

Sign up for updates

Join our mailing list to get interesting news and updates from the Vixus delivered to your inbox.

Leave a reply