Back to Catalog
Compute

AWS Lambda

"Run code without thinking about servers or clusters."

AWS Lambda

AWS Lambda is a serverless, event-driven compute service that lets you run code for virtually any type of application or backend service without provisioning or managing servers. You can trigger Lambda from over 200 AWS services and software as a service (SaaS) applications.

Key Features

  • Serverless: No servers to manage (OS patching, scaling handled by AWS).
  • Event-Driven: Functions execute in response to events (e.g., S3 upload, API Gateway request, DynamoDB update).
  • Auto-Scaling: Scales out automatically in response to incoming requests.
  • Short-Lived: Max execution time is 15 minutes (900 seconds).
  • Supported Runtimes: Node.js, Python, Java, Go, Ruby, .NET, and Custom Runtimes.
  • Lambda@Edge: Run Lambda functions at CloudFront Edge locations (closer to users).
  • Layers: Distribute libraries/dependencies for use by multiple functions.

Pricing

  1. Requests: First 1 million requests per month are free. $0.20 per 1M requests thereafter.
  2. Duration: Calculated from the time your code begins execution until it returns or otherwise terminates. Charged per ms (GB-seconds).
  3. Provisioned Concurrency: Pay to keep functions initialized (warm) to avoid "Cold Starts".

Exam Tips

  • 15 Minute Limit: If a task takes longer than 15 minutes, Lambda is NOT the solution. Look at AWS Batch or EC2.
  • Cold Starts: First invocation takes time to load. Use Provisioned Concurrency to solve this.
  • Pricing: You pay for invocations and compute time. Very cheap for intermittent workloads.
  • Triggers: Know common triggers: S3, API Gateway, DynamoDB Streams, SNS, SQS, CloudWatch Events (EventBridge).
  • Function Limit: 128 MB to 10 GB memory. CPU scales with memory.

Common Use Cases

  • Real-time File Processing: Trigger lambda when file uploaded to S3 to create thumbnail.
  • Serverless Backends: Use with API Gateway to build Web/Mobile API.
  • Data Transformation: Streaming data processing with Kinesis.
  • Scheduled Tasks: "Cron jobs" using EventBridge (CloudWatch Events).
EKS
AWS Fargate
SWIPE ZONE
< DRAG ME >