AWS Builder Center
Day 1: Meet Amazon Bedrock - Build Your First AI App in 15 Minutes (7-Day Beginner Series)

Day 1: Meet Amazon Bedrock - Build Your First AI App in 15 Minutes (7-Day Beginner Series)

New to AWS and AI? In this 7-day beginner series, a student learns Amazon Bedrock step by step and shares everything. Day 1: understand what Bedrock is and get your first AI answer, using the console and 10 lines of Python. No experience needed.

 

What you'll learn today

  • What Amazon Bedrock is, in simple words
  • How to get your first AI response from the console
  • How to do the same thing with Python code
  • A few common mistakes to avoid
Time needed: about 15 minutes. Experience needed: none.

What is Amazon Bedrock?

You've probably used AI chatbots like ChatGPT. Behind each one is a big AI model called an LLM (Large Language Model).
Normally, using these models in your own app means setting up servers, which is hard. Amazon Bedrock makes it easy. It's an AWS service that gives you many AI models from different companies in one place, and you use them with simple calls. No servers to manage.
Think of Bedrock like a food court: one place, many restaurants (models), and you pick what you like.

What can you build with it?

  • A chatbot that answers questions
  • A tool that summarizes long notes
  • An assistant that reads your own documents (we'll build this on Day 4!)

Step 1: Open Bedrock

  1. Sign in to your AWS account.
  2. Search for Amazon Bedrock in the search bar.
  3. Pick a region where Bedrock is available (I used us-east-1).
[Screenshot: Bedrock console home page]

Step 2: Try the Playground (no code!)

  1. In the left menu, open Playground (Chat).
  2. Select a model. I picked an Amazon Nova model because it's quick and low-cost.
  3. Type this prompt: Explain cloud computing like I'm 10 years old.
 
Congratulations, you just used an LLM on AWS!

Step 3: Do it with Python

Now let's do the same thing with code.
Set up AWS access
  1. Create an IAM user (don't use your root account) with Bedrock permissions.
  2. Install the AWS CLI and run aws configure.
  3. Install the library: pip install boto3
The code
1
2
3
4
5
6
7
8
9
10
11
12
13
import boto3

client = boto3.client("bedrock-runtime", region_name="us-east-1")

response = client.converse(
modelId="amazon.nova-lite-v1:0", # use the model ID shown in your console
messages=[
{"role": "user", "content": [{"text": "Explain cloud computing like I'm 10."}]}
],
inferenceConfig={"maxTokens": 300, "temperature": 0.5},
)

print(response["output"]["message"]["content"][0]["text"])
Run it and you'll see the answer in your terminal.
 

What does each part do?

PartMeaning
bedrock-runtimeThe Bedrock service we talk to
modelIdWhich AI model to use
messagesOur question
maxTokensMaximum length of the answer
temperatureCreativity: low is focused, high is creative

Mistakes I made (so you don't have to)

  • "Access denied" error: my IAM user didn't have Bedrock permissions.
  • "Model ID not valid" error: some models need a slightly different ID in some regions. Copy the exact ID from the console.
  • Wrong region: the model wasn't available in the region I selected.

Cost tip

Bedrock charges based on how much text you send and receive, so small experiments cost very little. Still, set up a billing alert in AWS Budgets so there are no surprises.

Recap

  • Bedrock = many AI models, one easy service
  • You can use it from the Playground or from code
  • Your first AI app took only about 10 lines

Coming up next

Day 2: Prompt Engineering. How to ask better questions and get much better answers. Follow me so you don't miss it!
What was the first thing you asked the AI? Tell me in the comments!
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article