Package and Invoke Your First Lambda Function
Beginner · 30 minutes · 5 tasks, checked automatically · 100 points
In this foundational lab you will write a simple Python handler, package it into a ZIP archive, create an IAM execution role, deploy the function to the local AWS emulator, and invoke it — all from the command line. By the end you will understand the full lifecycle of a Lambda function: author → package → deploy → invoke → inspect logs.
What you’ll learn
- Write a Python Lambda handler and package it as a ZIP file
- Create an IAM execution role and attach the basic Lambda execution policy
- Deploy the packaged function to the local AWS emulator using the AWS CLI
- Invoke the function synchronously and inspect its JSON response and logs
How this lab works
- Start the lab: One click starts an emulated cloud on your computer, with the cloud’s own CLI ready: no account and no bill.
- Work through 5 tasks: Each task says what to build or fix. You do it yourself, in a real terminal, with hints when you get stuck.
- Check your work: Check my work reads the emulated cloud’s resources and says, task by task, what passed and what to fix.
- Finish and keep going: 100 points, your progress saved, and the next lab to try.
What it runs on
- Runs: An emulated cloud on your computer: no cloud account, no bill
- Cloud: AWS
- Services: Lambda, IAM
What you need
- A free LearnXops account
- The LearnXops desktop app for macOS, Windows or Linux
- Docker Desktop (or Podman / Rancher Desktop) installed and running
- A AWS sandbox created in the Local Cloud Playground
Topics: lambda, iam, python, serverless, aws, local-cloud, functions-as-a-service
Create a free account to start this lab.