AWSBedrockEnterprise
Merlin AI Code ReviewUsing Merlin AI Code Review with AWS Bedrock
March 16, 2025·6 min read·Merlin AI Code Review Team
AWS Bedrock provides managed access to foundation models — including Claude from Anthropic — inside the AWS cloud perimeter. For teams already on AWS with enterprise agreements, data residency requirements, or existing IAM infrastructure, using Merlin AI Code Review with Bedrock keeps AI code review entirely within your AWS environment.
Why AWS Bedrock for AI code review?
Teams choose Bedrock for several reasons:
- Data residency — Bedrock inference stays within your chosen AWS region
- Existing IAM — use existing AWS access control, no new API key management
- Enterprise agreements — AWS enterprise customers often have Bedrock included or at negotiated rates
- Consolidated billing — AI costs appear on the AWS bill alongside other infrastructure
- VPC integration — Bedrock can be accessed via VPC endpoints, keeping traffic off the public internet entirely
Prerequisites
- AWS account with Bedrock enabled in your target region
- Claude model access granted in the Bedrock console (Model access → Request access → Anthropic Claude)
- IAM credentials with
bedrock:InvokeModelpermission
Configuration
merlin.toml
toml[ai]provider = "bedrock"model = "anthropic.claude-sonnet-4-6-20241022-v2:0"bedrock_region = "us-east-1" # must match where you enabled model accessmax_tokens = 4096temperature = 0.2
Setting up credentials in GitHub Actions
The recommended approach is to use OIDC federation — no long-lived AWS credentials in GitHub secrets:
yaml
jobs:merlin-review:runs-on: ubuntu-latestpermissions:id-token: write # needed for OIDCpull-requests: writesteps:- uses: actions/checkout@v4with:fetch-depth: 0- name: Configure AWS credentialsuses: aws-actions/configure-aws-credentials@v4with:role-to-assume: arn:aws:iam::123456789012:role/MerlinReviewRoleaws-region: us-east-1- run: |curl -L https://github.com/Arunachalamkalimuthu/merlin-ai-code-review/releases/latest/download/merlin-linux-amd64 -o merlinchmod +x merlin && ./merlin reviewenv:GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}# AWS credentials provided automatically by the configure-aws-credentials step
IAM policy for the review role
text
{"Version": "2012-10-17","Statement": [{"Effect": "Allow","Action": ["bedrock:InvokeModel"],"Resource": ["arn:aws:bedrock:us-east-1::foundation-model/anthropic.claude-*"]}]}
Static credentials alternative
If OIDC isn't available, use static credentials stored as GitHub secrets:
yaml
env:GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
Available Claude models on Bedrock
| Model ID | Context window | Best for |
|---|---|---|
anthropic.claude-sonnet-4-6-20241022-v2:0 | 200K | Best quality |
anthropic.claude-3-haiku-20240307-v1:0 | 200K | Speed/cost |
anthropic.claude-3-5-sonnet-20241022-v2:0 | 200K | Balanced |