DEV Community

Cover image for Configure Claude Code with AWS Bedrock in 30 Seconds (Python)
Mahmood Khordoo
Mahmood Khordoo

Posted on • Edited on • Originally published at Medium

Configure Claude Code with AWS Bedrock in 30 Seconds (Python)

The Problem: AWS Configuration is tedious

If you’ve tried using the new Claude Code extension with AWS Bedrock, you’ve probably hit the same wall I did.

The extension is amazing, but the setup? It’s a friction-heavy process. You have to:

  1. Log into the AWS Console.
  2. Navigate IAM roles and permissions.
  3. Deal with config and credentials files manually.
  4. Debug vague "Access Denied" errors when it doesn't work.

I just wanted to code with Claude, not spend 20 minutes acting as a SysAdmin.

The Solution: Automating the boring stuff

I realized this process could be scripted. So, I built clauth, a lightweight, open-source Python CLI that automates the handshake between your local environment and AWS Bedrock.

It turns a 15-minute manual setup into a single command.

How to use it

You can install it directly from PyPI.

Step 1: Install

pip install clauth
Enter fullscreen mode Exit fullscreen mode

Step 2: Run the configuration
Run the command in your terminal. It will guide you through the authentication process automatically.

# Make sure to run this in your terminal
clauth
Enter fullscreen mode Exit fullscreen mode

What it does under the hood

For the curious developers, here is what the library handles for you:

  • Profile Management: Automatically updates your ~/.aws/credentials without breaking existing profiles.
  • SSO Integration: Handles the browser-based login flow if you are using AWS SSO.
  • Bedrock Handshake: Verifies that your session actually has access to the Bedrock models before you try to use them in your IDE.

Why Open Source?

I built this to scratch my own itch, but I packaged it up because I know how frustrating AWS IAM can be for developers who just want to use GenAI tools.

The project is fully open source. If you have feature requests or run into edge cases, feel free to open an issue or PR!

Happy coding! 🚀


Built by an Engineer who got tired of manually setting environment variables 😉

Top comments (0)