hands-on lab

Invoking Amazon Bedrock Models Using the Bedrock Runtime and AWS Lambda

Intermediate
Up to 1h 15m
10
Get guided in a real environmentPractice with a step-by-step scenario in a real, provisioned environment.
Learn and validateUse validations to check your solutions every step of the way.
See resultsTrack your knowledge and monitor your progress.
Lab description

The Amazon Bedrock service includes a runtime that allows you to interact with the Amazon Titan models using APIs. The runtime is designed to be used with AWS Lambda functions, and it abstracts the complexity of invoking models, allowing you to focus on the model's input and output.

In this lab, you will deploy two AWS Lambda functions using AWS Serverless Application Model (AWS SAM) templates. Both functions will use the Amazon Bedrock runtime to interact with the Amazon Titan models. The first function will generate a text response using the Amazon Titan Text Model, and the second function will generate an image response using the Amazon Titan Image Generator Model.

The following AWS and AWS Community content was referenced to create this lab:

Learning objectives

Upon completion of this intermediate-level lab, you will be able to:

  • Learn the prerequisites and limitations of the Amazon Bedrock runtime
  • Deploy a Lambda function that generates a text response using the Amazon Titan Text Model
  • Deploy a Lambda function that generates an image using the Amazon Titan Image Generator Model

Intended audience

  • Candidates for the AWS Certified Machine Learning Specialty certification
  • Cloud Architects
  • Software Engineers

Prerequisites

Familiarity with the following will be beneficial but is not required:

  • Amazon Bedrock
  • AWS Lambda
  • Amazon API Gateway
  • AWS Serverless Application Model (AWS SAM)

The following content can be used to fulfill the prerequisites:

Environment before
Environment after
About the author
Avatar
Jun Fritz, opens in a new tab
Cloud Labs Developer
Students
39,556
Labs
106
Courses
1
Learning paths
6

Jun is a Cloud Labs Developer with previous experience as a Software Engineer and Cloud Developer. He holds the AWS Certified Solutions Architect and DevOps Engineer Professional certifications. He also holds the AWS Certified Solutions Architect, Developer, and SysOps Administrator Associate certifications. 

Jun is focused on giving back to the growing cloud community by sharing his knowledge and experience with students and creating engaging content. 

Covered topics
Lab steps
Setting up the AWS SAM CLI
Invoking the AWS Titan Text Model Using AWS Lambda
Generating Images With the Amazon Titan Image Generator Model Using AWS Lambda