Build a Serverless App with AWS Lambda - Hands On!
4.5 (1,340 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
11,348 students enrolled

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.
4.5 (1,340 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
11,348 students enrolled
Last updated 3/2020
English [Auto], Portuguese [Auto], 1 more
  • Spanish [Auto]
Current price: $34.99 Original price: $49.99 Discount: 30% off
5 hours left at this price!
30-Day Money-Back Guarantee
This course includes
  • 7.5 hours on-demand video
  • 2 articles
  • Full lifetime access
  • Access on mobile and TV
  • Certificate of Completion
Training 5 or more people?

Get your team access to 4,000+ top Udemy courses anytime, anywhere.

Try Udemy for Business
What you'll learn
  • 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
Course content
Expand all 60 lectures 07:22:19
+ Introduction
3 lectures 32:42

Course overview and demo of the chat application

Preview 17:40

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

Preview 12:52
+ Static Chat Application with S3
7 lectures 51:45

Buckets, paths, and static website hosting

Preview 10:06

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

Walkthrough of demo site

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

Adding static data to the website

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

JavaScript Syntax Basics

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

JavaScript Parallelism

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

Accessing static data from javascript

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

Exercise 1 solutions
+ Creating an API
12 lectures 01:04:14

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

Preview 06:12

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

Introduction to IAM and policies

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

Creating a policy for the Lambda function

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

Code walkthrough of the first Lambda function

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

Running the lambda function with test data

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

Lambda triggers

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

Adding an API Gateway trigger to the function

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

Preview 07:25

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

Calling the API from the website

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.

CORS Activity Solution

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

Retrieving a conversation with the API

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

Failure test activity solution
+ Use DynamoDB for storage
9 lectures 01:13:50

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

Preview 09:29

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

DynamoDB vs. S3

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

Create DynamoDB tables

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

Create some sample data in DynamoDB

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

Update Lambda policy to access DynamoDB tables

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

Read a conversation from Dynamo DB

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

Read conversation list from DynamoDB

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

Write new messages to DynamoDB

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.

Exercise Solution
+ Break up the monolith
9 lectures 01:11:38

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

Overview of why having only one Lambda function can create problems

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

API Gateway overview - Resources and Methods

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

API Gateway overview - Models

Dissecting the request flow diagram in the API Gateway.

API Gateway overview - Request Flow

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

Create API structure in API Gateway

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

Lambda functions for reading and writing messages

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

API Gateway stages

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.

Preview 13:07

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.

Remove hard-coded user names from Lambda
+ Add Identity to the app
12 lectures 01:30:49

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

Preview 07:36

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

Create a user pool

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 in the API

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

List Users on the site

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

Create a new conversation

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

Create sign up 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.

Create verification page

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 login and logout

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

Add a Cognito authorizer to the API Gateway

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

Pass user token to the API
Heads up!

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.

Mapping unauthorized responses to HTTP status codes
+ Optimization and Preparing for Production
6 lectures 46:55

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.

Preview 14:21

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.

Using stage variables

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

CloudFront overview

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

Setting up a CloudFront CDN

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


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.

Custom domains
+ You Made It! Where to go from here.
2 lectures 10:25

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

More to Explore...
Bonus Lecture: More courses to explore!
  • You'll need a desktop PC with Internet access
  • Basic familiarity with HTML, Javascript, and AJAX will be helpful

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.

Who this course is for:
  • Technologists curious about Amazon Web Services and how to build web applications entirely in the cloud
  • People seeking basic AWS skills as a start in working toward certifications
  • People who learn best by doing, with a concrete example.
  • Engineers tasked with building a web app who want to minimize ongoing maintenance