published on Wednesday, Mar 11, 2026 by Pulumi
Serverless TypeScript App
published on Wednesday, Mar 11, 2026 by Pulumi
This example deploys a complete serverless TypeScript application using raw aws.apigateway.RestAPI, aws.lambda.Function and
aws.dynamodb.Table resources from @pulumi/aws. It demonstrates how to program AWS resources directly to build serverless applications.
The deployed Lambda function is a simple C# application, highlighting the ability to manage existing application code in a Pulumi application, even if your Pulumi code is written in a different language like JavaScript or Python.
The Lambda function is a C# application using .NET Core 3.1 (a similar approach works for any other language supported by AWS Lambda).
Deploying and running the Pulumi App
Create a new stack:
$ pulumi stack init devRestore NPM modules via
npm installoryarn install.Build the C# application.
dotnet publish appSet the AWS region:
$ pulumi config set aws:region us-east-2Optionally, set AWS Lambda provisioned concurrency:
$ pulumi config set provisionedConcurrency 1Run
pulumi upto preview and deploy changes:$ pulumi up Previewing update (dev): ... Updating (dev): ... Resources: + 10 created Duration: 1m 20sCheck the deployed GraphQL endpoint:
$ curl $(pulumi stack output endpoint)/hello {"Path":"/hello","Count":0}See the logs
$ pulumi logs -f 2018-03-21T18:24:52.670-07:00[ mylambda-d719650] START RequestId: d1e95652-2d6f-11e8-93f6-2921c8ae65e7 Version: $LATEST 2018-03-21T18:24:56.171-07:00[ mylambda-d719650] Getting count for '/hello' 2018-03-21T18:25:01.327-07:00[ mylambda-d719650] Got count 0 for '/hello' 2018-03-21T18:25:02.267-07:00[ mylambda-d719650] END RequestId: d1e95652-2d6f-11e8-93f6-2921c8ae65e7 2018-03-21T18:25:02.267-07:00[ mylambda-d719650] REPORT RequestId: d1e95652-2d6f-11e8-93f6-2921c8ae65e7 Duration: 9540.93 ms Billed Duration: 9600 ms Memory Size: 128 MB Max Memory Used: 37 MB
Clean up
Run
pulumi destroyto tear down all resources.To delete the stack itself, run
pulumi stack rm. Note that this command deletes all deployment history from the Pulumi console.
published on Wednesday, Mar 11, 2026 by Pulumi
