AWS

2 Mins Read

Setting Up a Strands Agent with AWS Bedrock

Voiced by Amazon Polly

Overview of Strands Agents

Strands Agents is an open-source SDK from AWS that simplifies the development of AI agents through a model-driven approach. It allows you to define a task-specific prompt and tools the agent can use, and relies on foundation models like Claude, LLaMA, or models available in Amazon Bedrock.

With Strands, developers can create intelligent agents that plan, reason, and reflect while completing tasks using minimal code. It is already used internally by several AWS services such as Amazon Q Developer and AWS Glue.

Transform Your Career with AWS Certifications

  • Advanced Skills
  • AWS Official Curriculum
  • 10+ Hand-on Labs
Enroll Now

Prerequisites

Before setting up your Strands Agent, ensure the following:

  • AWS CLI installed and configured
  • Active AWS account with Amazon Bedrock access
  • Python 3.10+
  • A virtual environment manager (e.g. venv)

Create Project Environment

Set up a Python virtual environment and install required packages over the terminal:

4) Configure AWS Access

Make sure AWS credentials are configured properly using:

 

Build and Run a Basic Strands Agent

In agent.py, define your agent:

Run your agent on the terminal:

Output:

Handle Common Errors

AccessDeniedException for Model ID

  • Make sure you’re using a region where your AWS account has access to the Bedrock model.
  • Double-check IAM permissions for Bedrock.

Region Configuration

  • Ensure AWS_REGION is exported correctly before importing the strands module.

Conditional Write Error

  • If you encounter an error like “pre-condition failed”, verify if you’re trying to overwrite an existing object in S3 via a conditional call — this doesn’t apply directly to Strands, but could arise if tools use S3.

Clean Up Resources

Once testing is done:

  • Deactivate Bedrock Model access enabled
  • Deactivate and remove your virtual environmentml

Earn Multiple AWS Certifications for the Price of Two

  • AWS Authorized Instructor led Sessions
  • AWS Official Curriculum
Get Started Now

About CloudThat

Established in 2012, CloudThat is an award-winning company and the first in India to offer cloud training and consulting services for individuals and enterprises worldwide. Recently, it won Google Cloud’s New Training Partner of the Year Award for 2025, becoming the first company in the world in 2025 to hold awards from all three major cloud giants: AWS, Microsoft, and Google. CloudThat notably won consecutive AWS Training Partner of the Year (APJ) awards in 2023 and 2024 and the Microsoft Training Services Partner of the Year Award in 2024, bringing its total award count to an impressive 12 awards in the last 8 years. In addition to this, 20 trainers from CloudThat are ranked among Microsoft’s Top 100 MCTs globally for 2025, demonstrating its exceptional trainer quality on the global stage.  

As a Microsoft Solutions Partner, AWS Advanced Tier Training Partner, Google Cloud Platform Partner, and collaborator with leading organizations like HPE and Databricks, CloudThat has trained over 850,000 professionals across 600+ cloud certifications, empowering students and professionals worldwide to advance their skills and careers. 

WRITTEN BY Kamlesh N

Share

Comments

    Click to Comment

Get The Most Out Of Us

Our support doesn't end here. We have monthly newsletters, study guides, practice questions, and more to assist you in upgrading your cloud career. Subscribe to get them all!