Serverless Web Development with Python for AWS


167 students completed the lab in ~1h:12m

Total available time: 2h:0m

52 students rated this lab!

Lab Overview

Serverless architectures let cloud providers handle the burden of managing servers and scaling to meet demand. Costs can also be reduced because you only pay for the compute resources needed to handle requests instead of paying for idle servers waiting for requests to come in. In this Lab you will practice serverless web development with Python for AWS by testing and deploying a to-do list application that uses:

  • AWS Serverless Application Model (SAM) to package and deploy the API code as Lambda functions behind an API Gateway
  • Cognito user pools to handle user registration and sign in
  • DynamoDB for persisting each users to-do list

Lab Objectives

Upon completion of this Lab you will be able to:

  • Test, package, and deploy serverless Python applications following the AWS Serverless Application Model (SAM)
  • Configure an Amazon Cognito user pool as an API Gateway authorizer
  • Synchronize a local folder with Amazon S3 to publish a website

Lab Prerequisites

You should be familiar with:

  • Working with Linux on the command-line
  • Basic concepts of Amazon S3, Cognito, API Gateway, Lambda, DynamoDB, and AWS command-line interface (CLI)
  • Experience developing in Python is beneficial but not required
  • The Build AWS Serverless Web Applications With Python Course walks through a similar development scenario as this Lab and can be beneficial to watch

Lab Environment

Before completing the Lab instructions, the environment will look as follows:

After completing the Lab instructions, the environment should look similar to:

Follow these steps to learn by building helpful cloud resources

Logging in to the Amazon Web Services Console

Your first step to start the Lab experience

Creating a DynamoDB Table for the Serverless Application

Create a DynamoDB table with minimal configuration

Creating a Cognito User Pool for the Serverless Application

Create a user pool to manage the application's authentication requirements

Creating an S3 Bucket for the Web Front-End Assets

Create an S3 bucket that will store the front-end JavaScript, HTML, and CSS files

Connecting to the Virtual Machine using SSH

Create a secure connection to a remote machine

Testing the Serverless API Code

Briefly explore the code and test its functionality

Fixing the Python Serverless API Code

Write a line of Python code to recover API functionality

Deploying the Serverless API Code

Deploy the serverless API code using AWS Serverless Application Model (SAM) tools

Modifying the API Gateway Configuration

Configure the API Gateway to use the Cognito user pool as an authorizer and enable CORS

Testing the Front-End Website

Test the front-end website before deploying it to S3

Deploying the Front-End Website to S3

Deploy the front-end website to make the serverless application available to the world