4.63 out of 5
769 reviews on Udemy

Build a Serverless App with AWS Lambda – Hands On!

Create a chat web app using Amazon Web Services - Lambda, DynamoDB, API Gateway, S3, Cognito, CloudFront, and more.
Sundog Education by Frank Kane
6,754 students enrolled
English [Auto-generated] More
Build a chat application entirely with AWS services, and no stand-alone servers at all
Architect and design serverless applications
Serve static resources to browsers using AWS's S3 (Simple Storage Service)
Use Javascript to dynamically modify web pages
Manage permissions and access policies using IAM (Identity and Access Management)
Manipulate and vend data in the cloud using AWS Lambda
Use CORS to manage client-side security in serverless apps
Store and retrieve data with DynamoDB
Model API's and create SDK's with API Gateway
Create a user login system with Cognito
Speed up your web app with a CloudFront CDN

Immerse yourself in Amazon Web Services (AWS) with this hands-on, project-based course – and truly internalize some highly valuable skills in the world of technology. We’ll walk you through building your own chat website using nothing but AWS services – and no standalone services or server instances at all! 

Building a “serverless app” using AWS and its Lambda service is a great introduction to the core services AWS offers. As you create your chat application, you’ll learn and use the following AWS services:

  • S3 (Simple Storage Service) – For storing static HTML and vending it to your users’ browsers
  • Lambda – For executing logic in the cloud for storing and retrieving data in your application
  • IAM (Identity and Access Management) – For securing access to your services
  • API Gateway – For presenting a well-modeled API to your clients and automatically generating client-side code to communicate with it
  • DynamoDB – For quickly storing and retrieving data at scale
  • Cognito – For managing users, account creation, and logins securely
  • CloudFront – For accelerating the delivery of your site to end users with a CDN

We’ll tie it all together by learning and practicing Javascript, and we’ll learn about CORS to grant browsers the permissions they need to run a serverless application.

Even if you’re familiar with AWS, you’ll learn valuable techniques on how to build a fully functional, dynamic website without maintaining any servers at all – not even via EC2!

Your highly experienced guides through this project are Frank Kane, formerly a senior manager at Amazon, and Brian Tajuddin, a principal engineer also formerly working at Amazon. You’ll be learning AWS from people who were there when it was being created. You’ll join over 140,000 other students of the Sundog Education team who have leveled up their careers with hot technical skills.

As an added bonus, you’ll be offered membership in a closed Facebook Group for students of this course, where you can continue to collaborate with each other even after you’ve finished it.

Although this course isn’t targeting any specific AWS certification exam, you’ll leave it with a great foundation of AWS knowledge that will begin to prepare you for them.


Udemy 101: Getting the Most From This Course

Course overview and demo of the chat application

Setup the website

Create an AWS account, an S3 bucket, upload a website, and view it in your browser

Static Chat Application with S3

S3 Overview

Buckets, paths, and static website hosting

Walkthrough of demo site

We'll review all of the static HTML, CSS, and Javascript that make up our chat application so far.

Adding static data to the website

For now, we'll upload some static chat data into S3 in JSON format so we have something to display.

JavaScript Syntax Basics

This course uses Javascript, so let's do a quick crash course on the basics of the language.

JavaScript Parallelism

How does Javascript execute in parallel to speed up your website, without dealing with all the nastiness of multi-threading and concurrency?

Accessing static data from javascript

Let's dynamically modify our chat pages to include the static chat data we're vending from S3.

Exercise 1 solutions

We'll walk through the previous lecture's challenge of adding a new message and a new conversation to our chats.

Creating an API

Lambda functions overview

Learn how Lambda allows you to execute snippets of code without running a dedicated server.

Introduction to IAM and policies

Identity and Access Management lets you secure your services and the services they have access to.

Creating a policy for the Lambda function

Let's give our Lambda function the permissions it needs to read our data from S3.

Code walkthrough of the first Lambda function

Let's dissect our first Lambda function, and how it works.

Running the lambda function with test data

Learn how to create a test case for our Lambda function, and run it from within the AWS console.

Lambda triggers

Triggers are what cause your Lambda function to be executed. Let's cover the various ways in which that can work.

Adding an API Gateway trigger to the function

Let's set up the API Gateway in Proxy mode to trigger our Lambda function when an API is called from our client.

Understand and Setup CORS

Learn how Cross-Origin Resource Sharing (CORS) gets around browser security to allow you to call web services from your page.

Calling the API from the website

Let's modify our client-side code to hit the API Gateway and Lambda, instead of S3 directly.

CORS Activity Solution

We'll walk through the previous lecture's challenge to break CORS support intentionally and see what happens, and to lock down our API to only be accessible to your S3 bucket.

Retrieving a conversation with the API

Let's modify our app to retrieve entire conversations using the API Gateway.

Failure test activity solution

We'll walk through our solution to the previous lecture's challenge of writing test cases for failure modes.

Use DynamoDB for storage

DynamoDB overview

Let's cover DynamoDB from a high level, and learn how it might help us store our chat data more efficiently.

DynamoDB vs. S3

Why use DynamoDB instead of S3? There are pros and cons to each, but DynamoDB is the clear winner for us.

Create DynamoDB tables

Create the tables we need for chat conversations and messages in DynamoDB

Create some sample data in DynamoDB

Populate our DynamoDB tables with some sample chats for us to test with.

Update Lambda policy to access DynamoDB tables

Grant our Lambda function the necessary permissions via IAM to access our DynamoDB tables instead of S3.

Read a conversation from Dynamo DB

Modify and test our application to read chat conversations from DynamoDB instead of S3.

Read conversation list from DynamoDB

Modify and test our application to read the conversation list from DynamoDB instead of S3.

Write new messages to DynamoDB

Modify our chat application to allow users to enter new chat messages and store them in DynamoDB where others can see them!

Exercise Solution

We'll walk through our solution to the challenge of handling invalid HTTP methods, and removing the now unnecessary access to S3 from our Lambda functions.

Break up the monolith

Overview of why having only one Lambda function can create problems

Why go through the trouble of breaking up our monolithic Lambda function? Let's explain.

API Gateway overview - Resources and Methods

What are resources and methods in the API Gateway, and how are they used?

API Gateway overview - Models

What models are in the API Gateway, and how to use them.

API Gateway overview - Request Flow

Dissecting the request flow diagram in the API Gateway.

Create API structure in API Gateway

Let's go hands on and define our API for our chat application in the API Gateway, not in proxy mode.

Lambda functions for reading and writing messages

Let's split up our Lambda function into individual ones for reading and writing messages.

API Gateway stages

We'll cover stages in the API Gateway and how they are used.

Exporting a JavaScript client and Swagger

With a well defined API in the API Gateway, you can automatically generate client code for Javascript, and for pretty much any other client using the Swagger definition it creates for you.

Remove hard-coded user names from Lambda

We'll tackle the previous lecture's challenge of removing the hardcoded "Student" user name from our Lambda functions, and providing it as an event parameter instead.

Add Identity to the app

Cognito overview

Let's cover the various components of Cognito, which we'll use for user account management.

Create a user pool

Let's walk through Cognito in the console, and set up the user pool for our chat application.

List Users in the API

Next we need to wire things up for listing users through Lambda with an associated IAM policy and role, and through the API Gateway.

List Users on the site

Let's add the front-end code for listing users - and dive into how to debug things when things don't work.

Create a new conversation

Let's wire up the API and front end for creating a new conversation.

Create sign up page

Let's create a working sign up page so new users can create accounts.

Create verification page

Now we need to wire up a page so users can enter the authentication code they received via email, or request it to be re-sent.

Add login and logout

Now that we can sign in and confirm users, let's actually sign them in and tie their identity into the rest of the app.

Add a Cognito authorizer to the API Gateway

We need to reconfigure the API Gateway to use an Authorizer, and modify our input mappings to use the new authenticated user.

Pass user token to the API

We have sign in and authorization on the API, and now we just need to link the two together! 

Mapping unauthorized responses to HTTP status codes

In the last lecture, we challenged you to fix the problem of starting chats with yourself, and to ensure you can't see chats that you're not involved in. Let's look at our solution.

Optimization and Preparing for Production

Lambda Versioning

You don't want your changes to "go live" immediately. Lambda versioning ensures a known good version of what your code is what's live. We'll also use Canary to divide traffic between different deployments, create and use a test stage and promote it to production, and use version aliases to simplify the configuration of Lambda.

Using stage variables

Let's see how Stage Variables can let us maintain separate databases, or resources in general, between different stages so they don't pollute each other.

CloudFront overview

Let's talk about how CloudFront, AWS's content delivery network, works and why it's important.

Setting up a CloudFront CDN

Let's walk through setting up CloudFront to accelerate the delivery of our static resources in S3.


We'll tour the various monitoring available in AWS for our application, and practice setting up an alarm.

Custom domains

Finally, let's walk through how you would go about associating your own custom domain name with this application. We'll also show you how to associate a custom domain name with your API layer, if that's something you want to expose more widely.

You Made It! Where to go from here.

More to Explore...

There's so much more learn about AWS! Here are some pointers for continuing your exploration.

Bonus Lecture: Discounts to continue your journey!
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!
4.6 out of 5
769 Ratings

Detailed Rating

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


7 hours on-demand video
1 article
Full lifetime access
Access on mobile and TV
Certificate of Completion