hands-on lab

Moderating Content with Amazon Bedrock

Difficulty: Beginner
Duration: Up to 1 hour
Students: 615
Rating: 3.2/5
On average, students complete this lab in30m
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.

Description

Generative AI models, such as those available through the fully managed Amazon Bedrock service, can be used to moderate content in sophisticated and flexible ways. These models are capable of moderating at a human level of understanding and can be used to moderate text, images, and audio.

Learning how to integrate Amazon Bedrock into an existing content moderation system will benefit anyone looking to make use of generative AI in their systems.

In this hands-on lab, you will configure Amazon SNS and Amazon SQS to work together, implement an AWS Lambda function that invokes a generative AI model, and test the resulting content moderation system.

Learning objectives

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

  • Subscribe an Amazon SQS queue to an Amazon SNS topic
  • Invoke an Amazon Bedrock model from an AWS Lambda function using Python
  • Use the AWS CLI to upload content to Amazon S3
  • Monitor the moderation system using Amazon CloudWatch

Intended audience

  • Candidates for the AWS Certified AI Practitioner certification
  • Cloud Architects
  • Data Engineers
  • DevOps Engineers
  • Machine Learning Engineers
  • Software Engineers

Prerequisites

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

  • Amazon SNS and Amazon SQS
  • AWS Lambda and Python
  • Amazon Bedrock

The following content can be used to fulfill the prerequisites:

Updates

July 25th, 2025 - Upgraded lab to use the latest Nova Micro model

April 18th, 2025 - Updated instructions to reflect the latest Lambda console interface

March 5th, 2025 - Added a file with complete Python code for convenience

Environment before

Environment after

Covered topics

Hands-on Lab UUID

Lab steps

0 of 4 steps completed.Use arrow keys to navigate between steps. Press Enter to go to a step if available.
  1. Logging In to the Amazon Web Services Console
  2. Configuring Amazon SNS and SQS
  3. Using Amazon Bedrock to Moderate Content
  4. Testing the Moderation System