

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 3
click for more info
Not enough gems
Cost: 6 gems
1: AWS Lambda
incomplete
2: Deploy Lambda
incomplete
3: Testing Lambda Functions
incomplete
4: API Gateway
incomplete
5: CloudWatch Log Groups and Viewing Lambda Logs
incomplete
6: Other Lambda Use Cases
incomplete
7: Final Cleanup
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
So you've got a simple application you want to run in the cloud. Maybe it's an API endpoint, a scheduled task, or a function that processes files uploaded to Amazon S3. You could spin up an EC2 instance, set up an ECS cluster, or run code directly on a server.
AWS Lambda is a serverless compute service. You write your code and upload it, and AWS handles the rest: provisioning servers, scaling, patching, and monitoring. You only pay for the compute time you actually use.
Click to play video
Here's the thing: with EC2 or ECS, you're paying for servers whether they're busy or idle. If your application only handles 100 requests a day, you're still paying for a server to sit there 24/7 waiting for those requests.
Lambda flips this model. Your code only runs when it's triggered, and you only pay for those milliseconds of execution time. No requests? No charges (beyond a tiny storage fee for the code itself).
In my day job, I write a lot of "occasional utilities": widgets that are important, but are not going to run on a day-to-day basis. Lambda lets me fire these apps when they're needed for near-zero cost. It's definitely not a golden hammer, and even AWS found it's a poor fit in some cases, but sometimes it's really convenient.
When a Lambda function is invoked: