[FEATURE] Add BEDROCK_AWS_PROFILE env variable or config flag to make Bedrock independent from current profile

Resolved 💬 9 comments Opened Mar 27, 2026 by mateuszsoltys99-spec Closed Jun 14, 2026

Preflight Checklist

  • [x] I have searched existing requests and this feature hasn't been requested yet
  • [x] This is a single feature request (not multiple features)

Problem Statement

When using Bedrock as the model in Claude Code with the AWS_PROFILE environment variable instead of a Bedrock token, the AWS_PROFILE variable overwrites the currently user-set profile. This becomes an issue when I want to use Claude Code to interact with AWS resources in a different account than the one used for my Bedrock model, while going through the AWS-provided MCP instead of making direct awscli calls from Claude Code (as a good practice to prevent the agent from performing unintended actions on the AWS side, this MCP does not support adding the profile flag in calls and Claude Code uses the currently set profile in the environment variable).

Currently, Claude Code uses the same environment variable to specify profile for both Bedrock and all AWS interactions within its environment. Using different AWS accounts for Bedrock and other AWS calls is already possible by using Bedrock access tokens and not setting the AWS_PROFILE variable, since all AWS calls—whether via MCP or AWS CLI—will then use the default profile.

However, not being able to specify a separate profile exclusively for Bedrock makes the configuration far less convenient and prevents the use of auto-refresh sso for this purpose. It also introduces a gap in Claude Code functionality between using Bedrock and other models, as with non-AWS models there is no issue with swapping between doing calls to different AWS accounts

Proposed Solution

Add either BEDROCK_AWS_PROFILE env variable input or bedrockAwsProfile configuration option to specify, that Claude Code will use this specific user profile for the Bedrock it uses, allowing the user to use their default profile for other interactions via AWS-provided MCP or direct AWSCli calls, thus giving users full control over what credentials are used for AWS calls

Alternative Solutions

_No response_

Priority

High - Significant impact on productivity

Feature Category

CLI commands and flags

Use Case Example

  1. I'm working on a cloud based app and use Bedrock as a model for my local Claude Code
  2. Bedrock model I use is on a different account than the one I want to deploy the app on
  3. I need to do modifications to my terraform infrastructure and want Claude Code to read some information from AWS to do those changes
  4. I cannot do that without using a Bedrock Access Token, as when Claude Code is configured to use a specific AWS_PROFILE for Bedrock it cannot call AWS for information using other profiles (the env variable used for that is the same as the one used to set up Bedrock)

Additional Context

_No response_

View original on GitHub ↗

This issue has 9 comments on GitHub. Read the full discussion on GitHub ↗