Amazon API Gateway HTTP API to AWS Lambda

API Gateway HTTP API → AWS Lambda

Create an HTTP API routed to AWS Lambda.

This pattern deploys an Amazon API Gateway HTTP API with a Lambda integration.
The AWS Lambda function is written in Python3.9. The function returns a small message and a status code to the caller.

< Back to all patterns

GitHub icon Download this pattern (.zip)

GitHub icon View this pattern on GitHub


Clone repo

git clone https://github.com/aws-samples/serverless-patterns/cd serverless-patterns/apigw-http-api-lambda-python

Deploy

sam deploy


Testing

Once the application is deployed, retrieve the API ID provided as output and go to API Gateway console.
Click on the newly created API, in the stages window, click on the link under 'invoke URL'.
You can also make the request from Postman or from a terminal using the curl command.

Cleanup

Delete the stack: sam delete.

Additional resources

Created by:

Alice Goumain

Alice Goumain

Cloud Support Engineer in Serverless @ AWS

Follow on LinkedIn