3.67 out of 5
3 reviews on Udemy

The Comprehensive Guide to AWS Lambda Functions

Learn how AWS Lambda Functions can work with S3, SNS, and CloudWatch to build the most robust cloud infrastructures
Ahmad Al-Fakharany
114 students enrolled
English [Auto-generated]
Choose when to and why add Lambda functions to your AWS infrastructure stack
Build a real-world web scraper using only Lambda functions
Enhance CloudWatch standard alerts by invoking Lambda functions midway
Use Lambda functions for scheduling repetitive tasks

Infrastructures have always been evolving since the “old days” when apps used to live on physical servers, the not-so-old days were when  every app had its own virtual machine, and multiple virtual machines shared the same physical server. Recently, we had containers and each virtual machine could host several apps. But the future is serverless computing, where apps don’t even need a server to run on!

Welcome to AWS Lambda functions. You can use Lambda functions to invoke “code on demand“. Gone are the days when you had to pay for a machine that should be up 24×7 to perform tasks that take a tiny fraction of this uptime.

In this course, I assume no prior knowledge of AWS Lambda functions and take you right from the beginning in an exciting journey. In this class, we start by a little – but important – but of theory:

  • How to determine if your specific use case is a good candidate Lambda functions

  • How to write a Lambda function from scratch and configure it for optimum pricing

In this class, I intentionally give little room to theory and much more room to hands-on labs. After all, this is how you’ll work with Lambda functions afterwards, and how you’ll land your future job as an AWS cloud engineer, who is proficient in using Lambda functions. So, we start getting our hands dirty and:

  • Draw an overview of the main application that we’ll be using in our labs: the G2CSV. It’s a simple – but powerful – application that takes a keyword or more, searches Google for them, extracts the URLs and titles of the first-page’s results, and saves them in a CSV (Comma Separated Values) file. Pretty simple right? This app will not be running on any servers. It’ll work only using Lambda functions.

  • Then we explore different ways to trigger our app to work. First, using an S3 trigger, where a file upload action will invoke our app/function.

  • S3 is not the only valid trigger source for Lambda functions so we also explore SNS (Simple Notification Service) as an event source.

  • In an optional section, I take this app even one step more and add a web graphical user interface (GUI) so that the end user can type the keywords and send them. We’ll be using a combination of Lambda functions, SNS, and S3 to make it all work.

  • In the last part of the course, we visit CloudWatch, an integral and very powerful part of AWS. We use Lambda functions to add more detail to our regular CloudWatch events about different aspects of a running EC2 instances. Instead of just reporting a CPU spike, a Lambda function can tell you which process caused this anomaly and – optionally – take actions against it. The alert still follows its normal route through SNS, so changes should be made to how recipients get the messages.

  • Finally, we explore a second way of how a Lambda function could run: self-invocation. Here, we build a second app, which will be used to aggregate exchange rates hour-by-hour from an API and saves the results to an S3 bucket. This will be a demonstration on how to use Lambda functions in cron-job mode.

What are Lambda functions and the FaaS model

Get to know AWS Lambda functions
When to use Lambda functions and when not to use them
Your first Lambda function
Lambda functions configuration settings
Creating a Lambda function using the CLI
Calculating Lambda function pricing
AWS October 2018 update

Maintaining your Lambda functions

Project overview: A Python web scraper using a Lambda function
Packaging third-party modules in the Lambda function
Lambda functions logging and exception handling

Using S3 as a Lambda function trigger

G2CSV: a Lambda-based web scraper
Refactoring the Lambda code to accept multiple keywords at the same time
Extracting the S3 bucket and key from the Lambda event
Building and running the Lambda-S3 workflow

Using SNS as a Lambda function trigger

What is AWS SNS? Why integrate with a Lambda function?
Examining the SNS event sent to Lambda
Running the Lambda function locally
Save 99% of Lambda code upload time by using S3

[Optional] Build a real-world web-scraping app using Lambda, SNS, and S3

Application roadmap: Docker, Nginx, Flask, Lambda, SNS, and S3
Building the Docker image and running the app
Allowing public download from S3 bucket and finishing up

Using CloudWatch with AWS Lambda

Why using CloudWatch alone might not be sufficient for your alarm needs?
Creating a CloudWatch alarm, the traditional way
Building our helper Lambda function
Extracting useful information from the CloudWatch alarm data
Extracting the EC2 instance's IP address or DNS name
Establishing SSH connection to the EC2 instance using Paramiko
Workaround for macOS and Ubuntu users by using Docker
Using Lambda functions in the cron job mode
Storing exchange rates updates periodically using a Lambda function
Exploring different Lambda cron job options
You can view and review the lecture materials indefinitely, like an on-demand channel.
Definitely! If you have an internet connection, courses on Udemy are available on any device at any time. If you don't have an internet connection, some instructors also let their students download course lectures. That's up to the instructor though, so make sure you get on their good side!
3.7 out of 5
3 Ratings

Detailed Rating

Stars 5
Stars 4
Stars 3
Stars 2
Stars 1
30-Day Money-Back Guarantee


5 hours on-demand video
Full lifetime access
Access on mobile and TV
Certificate of Completion