Skip to content

Bring Your Own Inference

Use configured inference endpoints and connect your own inference through Amazon Bedrock.

Build with agents
On this page

This guide explains the steps to provision an Anthropic model through Amazon Bedrock to be used by Claude Code running within a beam. This guide covers setting up Teleport Beams as an OIDC provider in AWS, granting the required permissions and creating an LLM proxy. The steps are the same for any compatible model.

Built-in inference is for evaluation only. Connect your own inference provider for regular use and production workloads.

Beams offers a convenient connection to Amazon Bedrock via an AWS OIDC integration. To view the latest supported models, visit AWS: Models at a glance.

How it works

Beam instances access inference models securely through an LLM proxy hosted by your Teleport cluster. The proxy authorizes and forwards requests to the inference provider (Amazon Bedrock) and passes responses back to the beam. Tools and SDKs running in a beam that support the Anthropic Messages API or OpenAI Responses API reach these endpoints transparently.

Switching inference providers is simply a process of creating a new LLM proxy for the provider and configuring beams to use it. Beams have two provider slots, one supporting providers using the Anthropic Messages API and the other supporting providers using the OpenAI Responses API.

Existing beams will continue to use the providers configured when they were created, while new beams will use the newly set LLM proxy.

Prerequisites

Install the client tools and sign in

Beams is a Teleport project and uses official Teleport client tools.

The client tools include tsh to sign in and run commands, and tctl to administer your cluster if you have permission.

Cluster: example.beams.run. Edit this example to use your cluster name.

Install version 18.11.10 of the client:

Operating system
macOS

Download and open the macOS installer, then follow its instructions.

CLI
curl -O https://cdn.teleport.dev/teleport-tools-18.11.10.pkg
open teleport-tools-18.11.10.pkg
Linux

For Linux x86-64, download and install the client tools:

CLI
curl -O https://cdn.teleport.dev/teleport-v18.11.10-linux-amd64-bin.tar.gz
tar -xzf teleport-v18.11.10-linux-amd64-bin.tar.gz
sudo ./teleport/install
Windows

For Windows x86-64, run these commands in PowerShell. Add the extraction directory ($env:LOCALAPPDATA\Teleport) to your user PATH to use tsh in future terminals; the last command adds it to this terminal's PATH.

PowerShell
Invoke-WebRequest -Uri https://cdn.teleport.dev/teleport-v18.11.10-windows-amd64-bin.zip -OutFile teleport.zip
Expand-Archive -Path teleport.zip -DestinationPath "$env:LOCALAPPDATA\Teleport" -Force
$env:Path += ";$env:LOCALAPPDATA\Teleport"

Follow the official client tools install guide for other versions and architectures.

Check that you’re running v18.11.10 of the client with tsh version.

CLI
tsh version
Sign-in method
Passwordless

I sign in without a password (e.g. a passkey).

CLI
tsh login --proxy='example.beams.run' --auth=passwordless
Password & MFA

I have a password & MFA set up for my account:

Replace you@example.com with your Teleport username.

CLI
tsh login --proxy='example.beams.run' --user=you@example.com
SSO

I sign in with SSO (e.g. Okta, GitHub, SAML).

CLI
tsh login --proxy='example.beams.run'
  • A Teleport Beams cluster. Start your free trial.

  • An active Teleport session and tsh version 18.11.9 or newer. This guide also uses tctl to configure the cluster.

  • The AWS CLI, curl, jq, and uuidgen (or another way to generate a UUID).

  • An active AWS CLI session in the account where you’ll create the IAM resources. Run aws sts get-caller-identity to confirm the account ID before continuing.

  • AWS permissions to create and tag an OIDC provider, create an IAM role, and attach an inline policy.

  • Teleport permissions to create and test an integration, register and use an LLM app, configure Beams, and create a test beam with the beam-user role.

  • A chosen model, ensuring the following:

    • The model is available in Amazon Bedrock via the bedrock-mantle endpoint
    • For Anthropic-compatible models, the Messages API is supported
    • For OpenAI-compatible models, the Responses API is supported
    • The model is available in a region that suits your use case (default is us-east-1)

Step 1/4. Configure an AWS OIDC integration

Set these example values before copying the commands. The provider URL is your Teleport cluster’s public HTTPS URL, without a trailing slash. Use the same hostname without https:// for Provider hostname, which appears in IAM trust keys and ARNs. Use your 12-digit AWS account ID.

Provider URL: https://teleport.example.com. Provider hostname: teleport.example.com. Integration name: my-integration. AWS account ID: 123456789012.

If you already have an aws-oidc integration, use its name and IAM role. Check it with tctl get integration, skip the creation steps below, and continue with Step 2 if the role still needs Bedrock permissions.

To configure a new integration, start by creating an identity provider in AWS. Use the aws iam create-open-id-connect-provider CLI command, or create the identity provider through the AWS Console. Use the following configuration:

  • Provider type: OpenID Connect

  • Provider URL: https://teleport.example.com

  • Audience: discover.teleport

  • Tags:

    • teleport.dev/cluster: teleport.example.com
    • teleport.dev/origin: integration_awsoidc
    • teleport.dev/integration: my-integration

For the CLI workflow, save this as beams-oidc-provider.json:

JSON
{
  "Url": "https://teleport.example.com",
  "ClientIDList": ["discover.teleport"],
  "Tags": [
    {"Key": "teleport.dev/cluster", "Value": "teleport.example.com"},
    {"Key": "teleport.dev/origin", "Value": "integration_awsoidc"},
    {"Key": "teleport.dev/integration", "Value": "my-integration"}
  ]
}

Create the provider and save the AWS response, which contains its ARN. If an IAM OIDC provider already exists for that URL, don’t create a duplicate: confirm it allows the discover.teleport audience, then save a JSON object with its ARN as OpenIDConnectProviderArn in beams-oidc-provider-result.json.

CLI · Local terminal
aws iam create-open-id-connect-provider --cli-input-json file://beams-oidc-provider.json \
  --output json > beams-oidc-provider-result.json

Use that ARN to generate beams-oidc-trust.json. Review the policy before creating the role. It lets your Teleport cluster assume the IAM role through the OIDC provider you just created.

CLI · Local terminal
jq -e '
  (.OpenIDConnectProviderArn | strings) as $arn
  | ($arn | split(":oidc-provider/")[1] | strings | select(length > 0)) as $host
  | {
      Version: "2012-10-17",
      Statement: [{
        Effect: "Allow",
        Principal: {Federated: $arn},
        Action: "sts:AssumeRoleWithWebIdentity",
        Condition: {StringEquals: {($host + ":aud"): "discover.teleport"}}
      }]
    }' beams-oidc-provider-result.json > beams-oidc-trust.json

Create the role from that file and note the returned ARN:

CLI · Local terminal
aws iam create-role \
  --role-name beams-oidc \
  --assume-role-policy-document file://beams-oidc-trust.json \
  --query Role.Arn --output text

Save the following as awsoidc-integration.yaml. Use the ARN returned above if it differs from the example.

YAML
kind: integration
sub_kind: aws-oidc
version: v1
metadata:
  name: "my-integration"
spec:
  aws_oidc:
    role_arn: "arn:aws:iam::123456789012:role/beams-oidc"

Create the resource:

CLI · Local terminal
tctl create awsoidc-integration.yaml

Validate the new integration is operational using the tctl integration test utility:

CLI · Local terminal
tctl integrations test 'my-integration'

See the dedicated AWS OIDC guide for more details.

Step 2/4. Grant Amazon Bedrock permissions

The integration’s IAM role needs permission to invoke Bedrock models. Save the following permissions policy as beams-bedrock-policy.json.

JSON
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": ["bedrock-mantle:CreateInference"],
      "Resource": "arn:aws:bedrock-mantle:*:*:project/*"
    },
    {
      "Effect": "Allow",
      "Action": [
        "aws-marketplace:Subscribe",
        "aws-marketplace:ViewSubscriptions"
      ],
      "Resource": "*",
      "Condition": {
        "StringEquals": {
          "aws:CalledViaLast": "bedrock-mantle.amazonaws.com"
        }
      }
    }
  ]
}

The policy above gives access to all Bedrock Mantle projects. Projects provide a useful way to track token usage and costs. Currently, the Amazon Bedrock integration uses the default project only.

The aws-marketplace:Subscribe and aws-marketplace:ViewSubscriptions actions are required for Mantle to automatically create subscriptions when models are first used.

Attach the saved policy to the role from Step 1. If you reused an integration, replace beams-oidc with its IAM role’s name.

CLI · Local terminal
aws iam put-role-policy \
  --role-name beams-oidc \
  --policy-name beams-bedrock \
  --policy-document file://beams-bedrock-policy.json

Step 3/4. Configure an LLM proxy

An LLM proxy exposes Bedrock models to beam instances. It can also be used by authenticated cluster users via a local proxy.

Save the following as llm-proxy.yaml. Replace REPLACE_WITH_UUID with a fresh UUID from uuidgen. Check that the model is available through Bedrock Mantle in the selected region before creating the proxy.

YAML
kind: app_server
version: v3
metadata:
  name: beams-anthropic
spec:
  host_id: REPLACE_WITH_UUID
  app:
    kind: app
    sub_kind: llm
    version: v3
    metadata:
      name: beams-anthropic
      labels:
        teleport.internal/beams/app-type: llm
    spec:
      public_addr: "beams-anthropic.teleport.example.com"
      integration: "my-integration"
      aws:
        region: us-east-1
      inference:
        format: anthropic
        provider: bedrock
        models:
          - name: claude-opus-4-8
            provider_name: anthropic.claude-opus-4-8

To set shared token limits for this connection, see Budgets.

The teleport.internal/beams/app-type: llm label grants access through the built-in beam-user role. Anyone with that role can use this connection, which can incur AWS charges.

This configuration allows only claude-opus-4-8. Remove the models list from the inference block to expose all available models. The model name is the name used in an inference request, while the model provider_name is the Amazon Bedrock ID for the model. Discover model IDs in the Amazon Bedrock model cards.

Create the resource:

CLI · Local terminal
tctl create llm-proxy.yaml

Check that beams-anthropic appears in the app list, then start the local proxy and leave it running:

CLI · Local terminal: proxy
tsh apps ls
tsh proxy app --port 56789 beams-anthropic

Open a second terminal to send a test request:

CLI · Local terminal: test request
export ANTHROPIC_API_URL=http://localhost:56789
response=$(curl --fail-with-body --silent --show-error \
  -X POST "$ANTHROPIC_API_URL/v1/messages" \
  -H "Content-Type: application/json" -H "anthropic-version: 2023-06-01" \
  -d '{"model":"claude-opus-4-8","max_tokens":256,"messages":[{"role":"user","content":"Hello!"}]}') &&
  printf '%s\n' "$response" | jq -er '[.content[]? | select(.type == "text") | .text][0] | select(length > 0)'

A successful response from the model means the LLM proxy is operational and your user has permission to access it.

To expose models supporting the OpenAI Responses API, repeat this step to create another LLM proxy, changing the inference.format to openai.

Step 4/4. Update the global beams config

This step changes the Anthropic connection for all new beams in the cluster. Existing beams keep their original connection.

Run tctl get beams_config first. If a configuration already exists, do not overwrite it with the example. Follow Use the connection in new beams to change only the Anthropic route.

If no configuration exists, save this as beams-config.yaml. It routes Anthropic requests to beams-anthropic and keeps OpenAI requests on the built-in openai connection.

YAML
kind: beams_config
version: v1
metadata:
  name: beams-config
spec:
  llm:
    anthropic:
      app_name: beams-anthropic
    openai:
      app_name: openai
CLI · Local terminal
tctl create beams-config.yaml

Validate the beams config changes have had an effect by inspecting the config available to a new beam and sending a test request:

CLI · Local terminal
beam_id=$(tsh beams add --roles=beam-user --no-share-connected-accounts \
  --no-console --format=json | jq -er '.id') &&
  tsh beams exec "$beam_id" -- 'printf "%s\n" "$ANTHROPIC_BASE_URL"' &&
  tsh beams exec "$beam_id" -- 'claude -p --model claude-opus-4-8 "Reply with hello in one sentence."'

Expect the beam to print its Anthropic endpoint and return a model reply. To confirm the request reached the new connection, run tctl llm usage --endpoint=beams-anthropic before and after the test. Usage is batched and can take a few minutes to appear. When you’re done, delete the test beam with tsh beams rm "$beam_id".

Search docs

Loading search and AI…

Skills

Install all available skills. All Beams and Teleport skills are hosted in our OSS Teleport repository.

npx skills add https://github.com/gravitational/teleport