Skip to main content

AWS Lambda + TypeScript

You can run your Restate services as serverless functions on AWS Lambda.

First, make sure you create a Lambda endpoint in your Restate service, as described in the TypeScript SDK docs.

tip

The easiest way to run Restate handlers on AWS Lambda is to use the Restate CDK construct library.

To deploy a Restate service as a Lambda function, you can follow the guidelines of AWS for deploying plain TypeScript NodeJS functions. Restate does not add any complexity to this. You build a zip file containing the application code and dependencies and upload this to AWS Lambda. If you are using the Restate node template, then you can create a zip file with:

npm run bundle

AWS Lambda assumes that the handler can be found under index.handler in the uploaded code. By default, this is also the case for the Lambda functions developed with the Restate SDK.

Lambda service registration

Once your Lambda handler is deployed, register it with Restate as described in the registration docs. Make sure you first publish a new version of the Lambda function before registering it with Restate.