Skip to main content
Deploy your Restate services as serverless functions on AWS Lambda. This guide covers project setup, packaging, and service registration.
For infrastructure as code, check out the Restate CDK construct library.

Set up your project

Create your Restate + Typescript + Lambda repository

You can check out the template here: https://github.com/restatedev/lambda-typescript-templateSee the TypeScript serving docs for more details.

Package and deploy

Build a deployment package containing your application code and dependencies.
Package your application as a zip file for Lambda:
The Lambda handler to setup is app.handler.
Head over to your AWS dashboard to create the Lambda and upload the zip. For more details, follow the AWS Lambda documentation.

Role to invoke the Lambda

When using Cloud, you’ll need to create an IAM Role for Restate Cloud to invoke your Lambda. To set up the role, visit your Restate Cloud Dashboard at Developers > Security > AWS Lambda.

Register the service to Restate

In order for Restate to push requests to your Lambda function, you need to register the service to Restate using the CLI or UI:
Always register a specific Lambda version (not $LATEST) to ensure Restate routes requests to a stable deployment. Check the versioning documentation for more info.
Once your service is registered, you can start sending requests to it.

CI/CD Automation

You can set up automation to upload a new Lambda version and register new Restate service versions.
For this workflow to execute, you need to configure your AWS account for the Github OIDC provider. Then, add the following GitHub Actions repository secrets:
  • RESTATE_ADMIN_URL: The Admin URL. You can find it in Developers > Admin URL
  • RESTATE_AUTH_TOKEN: Your Restate Cloud auth token. To get one, go to Developers > API Keys > Create API Key, and make sure to select Admin for the role
  • AWS_INVOKE_ROLE_TO_ASSUME: The role created in the above paragraph to invoke the function
  • AWS_DEPLOY_ROLE_TO_ASSUME: The role to deploy the function, see below
To configure your account for the Github OIDC provider, run:
To create the deploy role, head over to the AWS IAM console, and create a new role.The role should have the following Trust policy:
And the following permissions:
You can use this workflow with Self-hosted Restate as well, just make sure to correctly set up RESTATE_AUTH_TOKEN and RESTATE_ADMIN_URL to reach your Restate cluster.