Set up two lambda-backed API Gateways: an API Gateway V1 (REST) and an API Gateway V2 (HTTP). AWS provides some information on the differences between these two API Gateway types, here: (Announcing HTTP APIs for Amazon API Gateway)[https://aws.amazon.com/blogs/compute/announcing-http-apis-for-amazon-api-gateway/] & (API Gateway V2 FAQs)[https://aws.amazon.com/api-gateway/faqs/]
This example provides API endpoints which are executed by lambda using TypeScript and AWS.
This sample uses the following AWS products:
- Amazon API Gateway is used as an API proxy
- AWS Lambda is used to process API events by executing typescript/javascript code
-
Create a new stack:
$ pulumi stack init aws-py-apigateway-lambda-serverless
-
Set the AWS region:
$ pulumi config set aws:region us-east-2
-
Run
pulumi up
to preview and deploy changes: -
To view the runtime logs of the Lambda function, use the
pulumi logs
command. To get a log stream, usepulumi logs --follow
.
-
Run
pulumi destroy
to 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.
In this tutorial, you built a lambda-backed API on AWS using API Gateway, lambda functions, and Pulumi. This serverless solution is highly scaleable, resilient, and stateless.