- Lab
-
Libraries: If you want this lab, consider one of these libraries.
- Cloud
Deploy a Serverless Function Using AWS Lambda
In this hands-on lab, you’ll build and secure an event-driven AWS Lambda workflow that updates data stored in Amazon S3. You’ll upload a text file containing a single number into an existing S3 bucket, then create a Python-based Lambda function that reads the file, multiplies the number by 3, and overwrites the original object with the updated result. You’ll also configure AWS IAM permissions so the function can only access the specific S3 actions and resources it needs. By completing this lab, you’ll practice core serverless fundamentals through authoring and invoking Lambda code, integrating with S3, and verifying CloudWatch logs for real-world automation tasks.
Lab Info
Table of Contents
-
Challenge
Create and Deploy a Basic AWS Lambda Function
- Download the lab resources from GitHub (
test.txtandlambda.py). - Create a new Lambda function in the AWS Management Console using the Python runtime.
- Generate a new Lambda execution role during function creation.
- Copy the Python code from
lambda.pyinto the Lambda code editor (code source). - Update the
s3-bucket-namevalue in the code to match the existings3gurubucketin the lab environment. - Deploy the Lambda function.
- Download the lab resources from GitHub (
-
Challenge
Configure IAM Permissions for S3 Read and Overwrite Access
- Update the Lambda execution role permissions to allow the required S3 actions (read and overwrite objects).
- Confirm the Lambda function is using the intended execution role.
-
Challenge
Automate Lambda Execution with an S3 Event Trigger and S3 Destination
- Add an S3 trigger for all object-created events on the target bucket.
- Configure Amazon S3 as the destination for the Lambda function’s action/output.
-
Challenge
Validate the End-to-end Workflow
- Upload
test.txtto thegurus3bucketS3 bucket to trigger the function. - Verify successful execution by reviewing CloudWatch metrics in the Lambda console (Monitor tab).
- Upload
About the author
Real skill practice before real-world application
Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.
Learn by doing
Engage hands-on with the tools and technologies you’re learning. You pick the skill, we provide the credentials and environment.
Follow your guide
All labs have detailed instructions and objectives, guiding you through the learning process and ensuring you understand every step.
Turn time into mastery
On average, you retain 75% more of your learning if you take time to practice. Hands-on labs set you up for success to make those skills stick.