- Lab
- A Cloud Guru
Building and Troubleshooting a Serverless Web Application
In this hands-on lab, we are going to build and troubleshoot a serverless web application using the following technologies: * DynamoDB * Lambda * API Gateway * S3 * X-Ray
Path Info
Table of Contents
-
Challenge
Create a DynamoDB Table
- Create the DynamoDB table and populate it using the file named
items.json
. All files required for this hands-on lab are located in the folder namedBuilding_and_Troubleshooting_a_Serverless_Web_Application
that you will find in the following GitHub repository.
- Create the DynamoDB table and populate it using the file named
-
Challenge
Create a Lambda Function with a Function Endpoint
- Create a Lambda function using
lambda_function.py
. - Configure the Lambda to use Python 3.9 and 256 MB.
- Test the function to see if it works.
- Diagnose and fix an error with the function configuration.
- Create and test a function URL endpoint once the function's error has been corrected.
- Create a Lambda function using
-
Challenge
Create an S3 Bucket and Upload the Website Files
- Modify
index.html
to add the invoke URL of your API Gateway endpoint. - Create an S3 bucket with public access enabled.
- Upload the following website files to your bucket. Make sure they have public-read enabled:
index.html
,error.html
, andcookie.html
- Configure S3 static website hosting on your S3 bucket.
- Check you can access everything from the S3 website-hosting URL.
- Modify
-
Challenge
Configure X-Ray
- Enable tracing from within the Lambda function.
- Enable the API gateway endpoint to send traces.
- Add the Lambda Layer to your function using the file named
layer.zip
Make sure to use Python 3.9. - Update your Lambda function code to import the X-Ray SDK to your function using the snippet provided named
lambda_function_xray.py
. - Test the function to see if it works.
- Diagnose and fix an error with the function configuration.
-
Challenge
Review The X-Ray Service Map
- Generate some traffic to your website.
- Review the X-Ray service map and traces.
- Break the application and see the results displayed in X-Ray.
What's a lab?
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.
Provided environment for hands-on practice
We will provide the credentials and environment necessary for you to practice right within your browser.
Guided walkthrough
Follow along with the author’s guided walkthrough and build something new in your provided environment!
Did you know?
On average, you retain 75% more of your learning if you get time for practice.