> ## Documentation Index
> Fetch the complete documentation index at: https://docs.usecompiler.com/llms.txt
> Use this file to discover all available pages before exploring further.

# AWS Bedrock

> Create AWS credentials to use Claude through Amazon Bedrock instead of the Anthropic API.

This guide walks through creating AWS credentials so Compiler can use Claude through Amazon Bedrock instead of the Anthropic API.

## Why use Bedrock?

* Use existing AWS billing and cost management
* Keep model traffic inside your AWS network when the instance runs in a VPC with a Bedrock VPC endpoint (PrivateLink)
* Comply with enterprise AWS-only policies
* Use AWS IAM for access control

## Prerequisites

* An AWS account with Bedrock access
* IAM permissions to create users and policies
* Claude models enabled in your Bedrock region

## Step 1: Verify Claude model access

Claude models on Bedrock are enabled automatically when first invoked. However, **first-time Anthropic users may need to submit use case details** before access is granted.

1. Open the [Amazon Bedrock console](https://console.aws.amazon.com/bedrock)
2. Select your preferred region (for example `us-east-1` or `us-west-2`)
3. Go to **Model catalog** in the left sidebar
4. Search for "Claude" and select a current model (for example Claude Sonnet 5.5)
5. Click **Open in playground** to test access
6. If prompted, submit the use case details for Anthropic models (see below)

Once you've invoked a model successfully, it's enabled account-wide for all users.

<Info>
  Compiler uses Claude through Bedrock **inference profiles** (for example `us.anthropic.…`, `au.anthropic.…` or `global.anthropic.…`). Models that AWS offers only as in-region on-demand models, without an inference profile, won't appear in Compiler.
</Info>

### Anthropic use case submission

First-time users see a form asking for use case details. Here's what to enter:

| Field | What to enter |
| - | - |
| **Company name** | Your company or organization name |
| **Company website URL** | Your company website |
| **Industry** | The closest match (for example Technology, Software, Professional Services) |
| **Intended users** | Who will use the application (for example "Internal employees", "Business customers") |

Example use case description:

> Internal tool for analyzing and understanding how codebases work. Used by our team to explore software projects and get answers to questions about functionality.

## Step 2: Create an IAM policy

1. Go to the [IAM console](https://console.aws.amazon.com/iam) > **Policies** > **Create policy**

2. Select the **JSON** tab and paste:

   ```json theme={null}
   {
     "Version": "2012-10-17",
     "Statement": [
       {
         "Sid": "BedrockModelAccess",
         "Effect": "Allow",
         "Action": [
           "bedrock:InvokeModel",
           "bedrock:InvokeModelWithResponseStream"
         ],
         "Resource": [
           "arn:aws:bedrock:*::foundation-model/anthropic.claude-*",
           "arn:aws:bedrock:*:*:inference-profile/*"
         ]
       },
       {
         "Sid": "BedrockListAccess",
         "Effect": "Allow",
         "Action": [
           "bedrock:ListFoundationModels",
           "bedrock:ListInferenceProfiles"
         ],
         "Resource": "*"
       },
       {
         "Sid": "MarketplaceAccess",
         "Effect": "Allow",
         "Action": [
           "aws-marketplace:ViewSubscriptions",
           "aws-marketplace:Subscribe"
         ],
         "Resource": "*"
       }
     ]
   }
   ```

3. Click **Next**

4. Name the policy (for example `CompilerBedrockAccess`)

5. Click **Create policy**

## Step 3: Create an IAM user

1. Go to **IAM** > **Users** > **Create user**
2. Enter a username (for example `compiler-bedrock`)
3. Click **Next**
4. Select **Attach policies directly**
5. Search for and select your policy (`CompilerBedrockAccess`)
6. Click **Next** > **Create user**

## Step 4: Create access keys

1. Click the user you just created

2. Go to the **Security credentials** tab

3. Under **Access keys**, click **Create access key**

4. Select **Application running outside AWS**

   <Note>
     Compiler takes access keys even when it runs on AWS. It doesn't use EC2 instance roles or ECS task roles for Bedrock.
   </Note>

5. Click **Next** > **Create access key**

6. Save these credentials securely:
   * Access key ID: `AKIA...`
   * Secret access key: `wJalrXUtnFEMI...`

<Warning>
  The secret access key is only shown once. Download the CSV or copy it now.
</Warning>

## Step 5: Configure your instance

1. Log in to your self-hosted instance as an admin

2. Go to **Settings** > **AI** > **Provider** (or choose **AWS Bedrock** during onboarding)

3. Select **AWS Bedrock** as the service

4. Enter your credentials:

   | Field | Value |
   | - | - |
   | **Region** | The region where you enabled models (for example `us-east-1`) |
   | **Access Key ID** | Your IAM user access key |
   | **Secret Access Key** | Your IAM user secret key |

5. Click **Save**

   Compiler validates your credentials by calling the Bedrock `ListFoundationModels` API, then loads the available models with `ListInferenceProfiles`.

6. Open **Settings** > **AI** > **Models** to choose which models people can use and how much effort each one puts in.

   When a model has more than one inference profile, it has a **Routing** choice: a geography profile (for example Australia, United States or Europe) or Global. Compiler starts each model on the most local geography profile AWS offers in your region, and uses Global only when nothing else is available. New models appear tagged **New** and stay off until you turn them on.

## Troubleshooting

<AccordionGroup>
  <Accordion title="&#x22;Unsupported model or your request did not allow prompt caching&#x22;">
    Prompt caching is on by default. If the model or region you use doesn't support it on Bedrock, turn it off in **Settings** > **AI** > **Context** > **Prompt caching**, or switch the model's **Routing** in **Settings** > **AI** > **Models**.
  </Accordion>

  <Accordion title="No models listed">
    1. Confirm the IAM policy allows `bedrock:ListInferenceProfiles`
    2. Confirm your region offers Claude inference profiles (check **Cross-region inference** in the Bedrock console)
  </Accordion>

  <Accordion title="Organization SCP blocking cross-region access">
    If your AWS Organization has Service Control Policies (SCPs) that restrict Bedrock to specific regions:

    1. Use a region where your organization allows Bedrock access (check with your AWS administrator)
    2. In **Settings** > **AI** > **Models**, choose a route your SCPs allow for each model
    3. Cross-region inference profiles (`apac.*`, `global.*`, `us.*`) won't work if SCPs block those regions
  </Accordion>

  <Accordion title="Access denied errors">
    1. Verify your IAM policy includes all required permissions (see [step 2](#step-2-create-an-iam-policy))
    2. Make sure Claude models are enabled in your selected region (see [step 1](#step-1-verify-claude-model-access))
    3. Check whether your organization has SCPs limiting Bedrock access
  </Accordion>
</AccordionGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.