Follow the request/data flow through the architecture.
Work through each concept and mark it understood. This unlocks the knowledge check.
Run code in response to events without provisioning servers; billed per request + duration.
Why it matters
Scales to zero and to thousands automatically — no idle cost, no patching.
When to use it
Use for event-driven glue, APIs, and spiky workloads. Avoid for long (>15 min) or very high-throughput steady jobs where Fargate is cheaper.
Example
def handler(event, context):
# Triggered by API Gateway / S3 / EventBridge
name = event.get("queryStringParameters", {}).get("name", "human")
return {"statusCode": 200, "body": f"*bleep* hello, {name}"}Gotcha (exam trap)
Cold starts add latency; memory and CPU are coupled (more memory = more CPU). The 15-minute hard timeout is a frequent exam trap.
A realistic main.tf for this mission. Read it top to bottom — it mirrors the concepts above.
# Serverless with Lambda
# BleepxCloud — AWS · Intermediate
# Realistic starter — adapt names, regions and CIDRs to your environment.
terraform {
required_providers { aws = { source = "hashicorp/aws", version = "~> 5.0" } }
}
provider "aws" {
region = "eu-west-1" # pick a region close to users / data-residency rules
}
# FinOps: mandatory cost-allocation tags on every resource.
locals {
common_tags = {
Project = "bleepx-cloud"
Domain = "core"
Mission = "lambda-serverless"
ManagedBy = "terraform"
CostCenter = "REPLACE_ME"
}
}
data "aws_caller_identity" "current" {}
# Event-driven function fronted by API Gateway.
resource "aws_lambda_function" "api" {
function_name = "bleepx-api"
runtime = "python3.12"
handler = "app.handler"
filename = "build/api.zip"
memory_size = 256 # CPU scales with memory
timeout = 10 # hard ceiling is 900s (15 min)
role = aws_iam_role.lambda.arn
environment { variables = { TABLE = aws_dynamodb_table.app.name } }
}
Bleepx skills build on each other. Continue your learning path across Query, Lab, and Cloud.