Building Serverless GenAI Application with Amazon Bedrock

Building Serverless GenAI Application with Amazon Bedrock
Building Serverless GenAI Application with Amazon Bedrock

CLOUD LABS



Building Serverless GenAI Application with Amazon Bedrock

In this Cloud Lab, you’ll build a serverless GenAI question-answering application using Amazon Bedrock, Aurora PostgreSQL, Lambda, API Gateway, and Amplify.

12 Tasks

intermediate

3hr

Certificate of Completion

Desktop OnlyDevice is not compatible.
No Setup Required
Amazon Web Services

Learning Objectives

Hands-on experience building a serverless GenAI application using Amazon Bedrock
Understanding how to create and manage a knowledge base with the Amazon Embedding model
The ability to integrate knowledge base, Bedrock Guardrails and the Amazon Premier model into the Bedrock Agent
The ability to set up API Gateway and AWS Lambda for seamless backend communication
Hands-on experience deploying a React web application on AWS Amplify and integrating it with backend services

Technologies
Bedrock
Amplify
Aurora logoAurora
Secrets Manager
Lambda logoLambda
API Gateway logoAPI Gateway
Cloud Lab Overview

Amazon Bedrock enables developers to integrate powerful Generative AI models without the complexity of model training, infrastructure management, or scaling. By leveraging Bedrock, you can build intelligent applications that process and respond to user queries efficiently using advanced AI techniques.

In this Cloud Lab, you’ll begin by creating a knowledge base using the Amazon embedding model, which transforms input data into vector representations. You will then store these embeddings in an Amazon Aurora PostgreSQL database, ensuring structured and efficient storage for easy retrieval. Next, you’ll set up Bedrock Guardrails to ensure responsible AI output filtering and integrate these with the Bedrock Agent, which uses the Amazon Premier model for processing user queries.

Once your data and models are in place, you’ll create a Lambda function to interact with the Bedrock Agent. This function will fetch relevant context from your database when a user query is made. You will configure an API Gateway to invoke this Lambda function, passing the query and receiving the processed response. Finally, you’ll integrate the API with a React web application hosted on AWS Amplify, establishing a seamless connection between the frontend and backend services, enabling the full AI-powered question-answering experience.

After completing this Cloud Lab, you’ll have the skills to leverage Amazon Bedrock for creating and managing knowledge bases, integrating it with AWS services like Lambda, API Gateway, and Aurora to build serverless GenAI applications. You’ll also gain experience deploying a React web application on AWS Amplify, seamlessly connecting the frontend to the backend.

The following is the high-level architecture diagram of the infrastructure you’ll create in this Cloud Lab:

End-to-end GenAI serverless application with Amazon Bedrock
End-to-end GenAI serverless application with Amazon Bedrock
Cloud Lab Tasks
1.Introduction
Getting Started
2.Set Up the Bedrock Knowledge Base
Create an S3 Bucket
Create an Amazon Aurora Cluster
Configure Amazon Aurora for the Amazon Bedrock Knowledge Bases
Create the Amazon Bedrock Knowledge Base
3.Set Up Bedrock Agent and Lambda
Create a Bedrock Agent
Create a Lambda Function
4.AWS API Gateway and Amplify
Create the REST API
Deploy the React Application
Testing the End-to-End Application Flow
5.Conclusion
Clean Up
Wrap Up
Labs Rules Apply
Stay within resource usage requirements.
Do not engage in cryptocurrency mining.
Do not engage in or encourage activity that is illegal.

Before you start...

Try these optional labs before starting this lab.

Relevant Course

Use the following content to review prerequisites or explore specific concepts in detail.

Hear what others have to say
Join 1.4 million developers working at companies like