AWS Builder Center
Claude Code on Amazon Bedrock: Build and Ship an AWS Agent

Claude Code on Amazon Bedrock: Build and Ship an AWS Agent

"Connect Claude Code to Amazon Bedrock with the /setup-bedrock wizard, install the Agent Toolkit for AWS, have it build a flrepetitiveight and weather agent, then deploy that agent to AgentCore Runtime. Plus how to run Claude Desktop on the same setup."

Senior Developer Advocate

Introduction

Building apps on AWS with Claude Code takes two environment variables. The model calls never leave AWS, and everything bills to the account you already use.
In this post I'll connect Claude Code to  Amazon Bedrock  two different ways, first I'll install the  Agent Toolkit for AWS  so the agent knows how AWS works, and then I'll have it build me a flight tracking and weather agent from a one-line prompt. Once it works locally I'll push it to AgentCore Runtime so it has a real endpoint. At the end I'll show you Claude Desktop running on the exact same Bedrock config, including a full Claude Code tab.
Let's jump in!
If you rather watch a video, here it is!


Before you start

Three things need to be true before Claude Code can talk to Bedrock.
You need the AWS CLI installed and a valid session. The quickest way to check is:
aws sts get-caller-identity
If that returns your account and ARN, you're logged in. If it doesn't, install the CLI and run  aws login , or  aws sso login --profile your-profile  if your org uses IAM Identity Center.
You also need model access. Open the Bedrock console, go to the model catalog, pick an Anthropic model, and submit the use case form. Access is granted right after you submit, and you only do this once per account. If you're on AWS Organizations you can submit it once from the management account and it flows down to the children.
Last one is Claude Code itself. If you type  claude  right now with no configuration, it'll prompt you to log in, and that login goes to your Claude subscription. That's not what we want. We want it pointed at Bedrock.

The manual way: two environment variables

Claude Code reads a flag that tells it to route inference through Bedrock instead of Anthropic's API, plus a region.
export CLAUDE_CODE_USE_BEDROCK=1
export AWS_REGION=us-east-1
That's it. Run  claude  now and it starts up already authenticated, because it uses the same AWS SDK credential chain the CLI uses. If  aws sts get-caller-identity  works in your terminal, Claude Code works.
When I did this, it came up on Claude Fable 5 with high effort and greeted me like nothing had changed. Behind the scenes every token was going through my own AWS account.
The catch is that those exports stop with your shell. You either set them every session or you add them to your  .bashrc  or  .zshrc 

The better way: the /setup-bedrock wizard

There's a slash command that does all of this properly.
/setup-bedrock
To prove it works, I set  CLAUDE_CODE_USE_BEDROCK  back to  0  first so Claude Code went back to asking me to log in. Then I ran the wizard.
It asks how you want to authenticate and gives you four options:
  • An AWS profile
  • A Bedrock API key, which you generate in the Bedrock console
  • An access key and secret
  • Credentials already sitting in your environment
I went with the profile. If you're already using SSO day to day, a profile is the option I'd reach for, since it picks up your existing session instead of asking you to manage another secret. The Bedrock API key is genuinely useful for a quick proof of concept or a CI job where there's no SSO to lean on.
After the profile it asks for a region. I picked  us-east-1 . Next, it verifies you're actually logged in before continuing.
Next it probes the models in your account and tests each one. In my case that was Sonnet, Opus, Haiku, and Fable. Anything it can reach, it offers to pin. I pinned mine, including the 1 million context variant, so next time I open Claude Code the models I want are already there.
This gets updated in the  ~/.claude/settings.json . You can absolutely hand-edit that file if you'd rather, and pin a model yourself with  ANTHROPIC_MODEL . I just find the wizard faster and less error-prone.
Heads up: the wizard reminds you that your SSO session will expire and you'll need to sign in again. That's normal. Claude Code caches resolved credentials in memory and refreshes them, but when the underlying Identity Center session is gone, it's gone.
Once it saves, it restarts Claude Code. I'm logged in, no environment variables set, and my settings file has everything it needs.

Install the Agent Toolkit for AWS

If you take one thing from this post, take this one.
The Agent Toolkit for AWS went GA in May 2026, and it's the official successor to all those AWS Labs MCP servers and skills you might have collected. It's a single plugin install that bundles the  AWS MCP Server  configuration together with a curated set of AWS skills. Think of it as carrying AWS best practices around in your editor.
Because I'm building an agent, I installed the  aws-agents  plugin, which covers Amazon API Gateway, Bedrock AgentCore, and related services:
/plugin install aws-agents@claude-plugins-official
/reload-plugins
If you're doing general AWS work instead, EC2, storage, IaC, billing, install  aws-core . There's also  aws-data-analytics  for data lake and ETL work, and  aws-agents-for-devsecops  for security scanning and incident work.
It works with Kiro, Codex, and Cursor too. Kiro talks to the AWS MCP Server directly and skips the plugin step, and there's an  aws configure agent-toolkit  wizard in AWS CLI v2.35.0 and later that detects your installed agents and wires them all up in one shot.
Why bother? Without it, Claude Code knows AWS about as well as its training data does, which means it confidently writes CDK for an API that changed six months ago. With it, the agent can look up current docs, follow AWS guidance, and call real AWS APIs.

Have it build the agent

Now I wanted an agent that pulls live flight tracking data and weather.
You can just type that as a prompt and the toolkit skills will get picked up automatically. I prefer to pick the skill myself, so I typed  agents  to see the list and tabbed into the get started skill, which is the right one for scaffolding something brand new.
shows screen shot of claude code

I also switched on plan mode. If you know me, you know I'd rather be doing spec-driven development in Kiro, and plan mode is not that. But it gives me a look at the shape of the work before the agent starts writing files, which is enough for a demo this size.
Then the prompt:
Please create an agent that tracks flight data and weather.
It came back with questions instead of guessing, which is what I want from an agent scaffolding tool. It asked for a framework and I chose  Strands Agents , because I like how it handles the agent loop and I've used it enough to trust it. Then it asked for a model provider, and I picked Bedrock.
Those two questions are the  AgentCore CLI  wizard, which the skill drove on my behalf.
I fast forwarded through the build. What came out was a flight weather agent on Strands with a small set of tools:
  •  get_weather 
  •  track_flight 
  •  get_flight_route 
That's the right shape. Each tool does one thing and the agent decides which to call.

Testing it locally

The dev server was already running, which is what  agentcore dev  gives you. It sets up a virtual environment, installs dependencies, starts a local server with hot reload, and opens an agent inspector in the browser where you can chat with the agent and read its traces.
Mine was on  localhost:8081 . The default port is 8080 and it auto-increments when that's taken, so don't be surprised if yours lands somewhere else.
I asked it a question a real user would ask:
Tell me the aircraft near Seattle right now.
It called the flight API and came back with a list of aircraft, including which ones were inbound and descending. Then I followed up:
Can you tell me about the weather in the area?
It pulled the weather and threw in a three day forecast I didn't ask for.
Nice! It all worked as I expected.

Deploy it to AgentCore Runtime

Note: I didn't explicitly mention this in the video but here are the instructions to deploy!
A dev server is fine for checking that the tools fire. It's the wrong place to leave an agent, because it dies with your terminal and there's nothing in front of it that an app could call.
 Amazon Bedrock AgentCore  Runtime is where it goes instead. Each session gets its own microVM with an isolated filesystem, and you get a real endpoint with identity and observability attached.
The CLI is an npm package, so if the toolkit didn't already put it there you'll want Node 20 or later and:
npm install -g @aws/agentcore
From the project that got scaffolded, deploying is one command:
agentcore deploy
Under that single command, your code gets packaged into a zip artifact, or built as a container if you scaffolded with  --build Container . AWS CDK provisions the resources, an AgentCore Runtime endpoint gets created, and CloudWatch logging and observability are configured for you, so you're not shipping something you can't see into.
The first deploy takes a few minutes because CDK has to bootstrap your account. After that it's quick. If you want to see what's about to change before it happens:
agentcore deploy --dry-run
agentcore status
Then invoke the deployed agent the same way you'd talk to it locally:
agentcore invoke --prompt "Tell me the aircraft near Seattle right now"
Now it's running in AWS instead of on my laptop. When something looks wrong, the logs and traces are a command away:
agentcore logs --since 30m --level error
agentcore traces list
There's a lot more you can hang off this project without rewriting it.  agentcore add memory  gives the agent short-term or long-term memory.  agentcore add gateway  puts governed connectivity in front of external APIs, which is where I'd move those flight and weather calls for anything real. Each one scaffolds config and takes effect on the next deploy.
Heads up: the managed harness is the other path here. Instead of writing the agent loop, you declare the model, prompt, and tools in config and AgentCore runs the loop for you. Same CLI, and you can graduate to code later. I went the code route because I wanted the Strands loop, but the harness is the faster road if you just need a working agent.

Claude Desktop on the same Bedrock setup

The terminal isn't the only place this runs. Claude Desktop connects to Bedrock too, and it brings  Claude Cowork  and a full Claude Code tab with it. Since I was already logged in on the CLI, I could reuse the same profile.
Here's the path:
  1. Open Claude Desktop. Go to Help → Troubleshooting and turn on developer mode. A new Developer menu appears.
  1. Developer → Configure Third-Party Inference…
  1. In the Connection section, set the inference provider. You'll see AWS Bedrock and Bedrock Mantle. Mantle is the newer endpoint, and I kept this simple by choosing AWS Bedrock.
  1. Pick your credential kind. The options are a static API key, interactive sign-in, a cloud vendor profile, or a helper script. I used the cloud vendor profile to match what I had locally.
  1. Fill in the region and the AWS profile name. It defaults the profile to  default , so change it if yours has a different name.
  1. Under Models, add a model list entry using a Bedrock inference profile ID, for example  us.anthropic.claude-sonnet-5 . There's a 1 million context variant if you want it. Profile and SSO auth both require this list, so don't skip it.
  1. Click Save changes, then Test connection. Mine came back green.
  1. Apply changes, then relaunch the window.
If you'd rather use SSO, set interactive sign-in instead and configure it the same way you set up AWS SSO on the command line. For a whole team, this same config gets exported to a  .mobileconfig  or  .reg  file and pushed through MDM, so nobody has to click through those steps individually.
After the relaunch I had Cowork and Code side by side, and could switch models from the picker at the bottom. Cowork is worth a look on its own, since it can reach into your desktop and work more like an assistant than a chat window.
One caveat: some Anthropic-hosted features don't work through Bedrock, because they depend on inference that Anthropic runs. Most of what I use works fine, but if a specific feature matters to you, check before you roll this out to a team.

Clean up

The deployed agent provisions real resources, so tear it down when you're finished experimenting:
agentcore remove all
agentcore deploy
The first command resets the configuration. The second one notices the empty state and removes the resources from your account. Running only the first leaves everything deployed and billing, so don't stop halfway.

Where I'd take this next

AWS published a walkthrough on  hosting coding agents on AgentCore  that races Claude Code, Codex, Kiro, and Cursor against the same GitHub issue in parallel, each in its own microVM. Check it out you might be surprised!
If you're rolling any of this out past your own machine, the  Guidance for Claude Code with Amazon Bedrock  is the page to read. It covers hooking Claude Code into IAM Identity Center, controlling who can reach which models, and getting usage visibility per team. There's deployable sample code in the repo.

My take

I really enjoy Claude Code, and I was surprised how easy it is to get set up with Amazon Bedrock. Let me know what you think below! And check out the resources.
Resources:
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