Beginner

Serverless with Lambda and API Gateway

Build a fully serverless HTTP API: a Python Lambda function triggered by API Gateway HTTP API (API Gateway v2), with proper IAM execution role, CloudWatch logging, and a test client that hits the deployed endpoint.

~3h
0 / 7 steps
🚀
Intro

What you're building

Prerequisites: An AWS account, AWS CLI v2 configured, Python installed locally for writing the function code.

AWS Lambda runs your code in response to events without you managing any servers. API Gateway HTTP API (v2) is the current recommended API Gateway product for most Lambda-backed API use cases — it's cheaper and simpler than the older REST API (v1) and supports the same Lambda integration. You'll build a minimal but complete serverless API: function, execution role, logging, API endpoint, and a working URL you can hit from curl.

The architecture: HTTP request → API Gateway HTTP API → Lambda function → response. Lambda has a 15-minute execution limit and is priced per invocation and per GB-second of compute — the first 1 million requests and 400,000 GB-seconds per month are free, making this essentially free for a project of this scale.

🔨

Write the Lambda function and create the execution role

🔨

Deploy the Lambda function

🔨

Create API Gateway HTTP API and wire it to Lambda

🔨

Test the endpoint and check CloudWatch Logs

🎯
Secret Mission

Secret Mission: Lambda cold start measurement

🧹
Wrap Up

Before You Go

Pro

Test what you just learned

Self-testing is one of the best ways to retain new skills. Unlock project quizzes to check your understanding.

Log in to unlock