All services

Serverless

AWS Lambda

Run code without provisioning servers.

Official docs

Overview

Lambda runs your code in response to events (HTTP, queue messages, file uploads, schedules). You pay per invocation and GB-seconds of execution; no servers to patch.

When to use it

  • Event-driven glue code between AWS services
  • Lightweight APIs behind API Gateway
  • Scheduled jobs (cron via EventBridge)
  • Short-lived test helpers and webhooks

Setup

  1. Console → Lambda → Create function. Choose runtime (Node 20, Python 3.12, etc).
  2. Define an execution role (IAM) with least-privilege policies.
  3. Set memory (128 MB – 10 GB) and timeout (max 15 min).
  4. Add a trigger (API Gateway, S3, SQS, EventBridge…).
  5. Optionally enable VPC access if calling private resources.

How to use

Minimal Node.js handler
export const handler = async (event) => {
  return { statusCode: 200, body: JSON.stringify({ ok: true, event }) };
};
Deploy with AWS CLI
zip -r fn.zip index.mjs
aws lambda update-function-code --function-name my-fn --zip-file fileb://fn.zip

QA use cases

  • Webhook receiver that posts CI results into Slack / Teams.
  • On S3 upload of a test report, generate a summary and email QA leads via SES.
  • Scheduled API health-check that pings endpoints and writes pass/fail metrics to CloudWatch.