Skip to content

AWS Bedrock support #6

Closed
Closed

Description

@Quentin-M

AWS and Anthropic together revolutionized, with AWS Bedrock, the way modern AI models may be used in enterprise environments where intellectual property and privacy are paramount.

It would be amazing if Claude Code, just like other Anthropic tools & models, as well as Aider, would be available to use through AWS Bedrock.

Activity

  1. self-assigned this
    on Feb 24, 2025
  2. bcherny commented on Feb 24, 2025

    @bcherny
    Collaborator
  3. added
    invalidIssue doesn't seem to be related to Claude Code
    on Feb 24, 2025
  4. Quentin-M commented on Feb 25, 2025

    @Quentin-M
    Author

    @bcherny Thank you for your answer.

    After further testing, it appears that Claude Code does not support AWS credentials provided through profiles to the same extent that the awscli, Aider, Cline, Goose and others do.

    Here is a completely valid ~/.aws/config file for use with AWS SSO:

    [sso-session gen-ai]
    sso_start_url = https://d-<sso account>.awsapps.com/start
    sso_region = eu-west-1
    sso_registration_scopes = sso:account:access
    
    [profile gen-ai-login]
    sso_session = gen-ai
    sso_account_id = <sso account>
    sso_role_name = GenerativeAI
    
    [profile gen-ai]
    role_arn=arn:aws:iam::<bedrock account>:role/bedrock-user
    source_profile=gen-ai-login
    region = us-west-2
    

    This will result in the following error from Claude Code when AWS_PROFILE=gen-ai:

    > /init is analyzing your codebaseâ€Ķ
      âŽŋ  API Error: Profile is configured with invalid SSO credentials. Required parameters "sso_account_id", "sso_region", "sso_role_name",
    "sso_start_url". Got sso_session, sso_account_id, sso_role_name
    Reference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html
    

    It can be worked around as follows for the time being, albeit less user-friendly:

    claude() {
      # Claude Code does not support profiles for now
      eval "$(aws configure export-credentials --profile gen-ai --format env)
      export AWS_REGION=us-west-2
    
      export CLAUDE_CODE_USE_BEDROCK=1
      export ANTHROPIC_MODEL='us.anthropic.claude-3-7-sonnet-20250219-v1:0' claude"
      export DISABLE_PROMPT_CACHING=1
      command claude "$@"
    }
    claude
    
  5. added a commit that references this issue on Mar 3, 2025
  6. github-actions commented on Aug 9, 2025

    @github-actions

    This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.

  7. locked as resolved and limited conversation to collaborators on Aug 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

invalidIssue doesn't seem to be related to Claude Code

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions