code-index uses AWS Bedrock for two things:
- LLM summaries — generating natural language descriptions of your code
- Vector embeddings — converting summaries into vectors for similarity search
You need access to these models in your AWS account:
| Purpose | Model | Model ID |
|---|---|---|
| Function summaries | Claude Haiku 4.5 | us.anthropic.claude-haiku-4-5-20251001-v1:0 |
| File/package summaries | Claude Sonnet 4.6 | us.anthropic.claude-sonnet-4-6 |
| Embeddings | Cohere Embed v4 | cohere.embed-v4:0 |
The Anthropic models are available by default on Bedrock. Cohere Embed v4 is an AWS Marketplace model — a user with marketplace permissions needs to invoke it once to enable it account-wide.
code-index uses the standard AWS SDK credential chain. Any of these methods work:
# Configure your profile (one-time)
aws configure sso --profile my-profile
# Login before using code-index
aws sso login --profile my-profile
# Set the profile
export AWS_PROFILE=my-profileexport AWS_ACCESS_KEY_ID=...
export AWS_SECRET_ACCESS_KEY=...
export AWS_SESSION_TOKEN=... # if using temporary credentials
export AWS_REGION=us-east-1In GitHub Actions, use OIDC-based role assumption:
- uses: aws-actions/configure-aws-credentials@v5
with:
role-to-assume: arn:aws:iam::123456789012:role/code-index-gha
aws-region: us-east-1See CI Setup for the full workflow.
The IAM role or user needs these permissions:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "bedrock:InvokeModel",
"Resource": [
"arn:aws:bedrock:*::foundation-model/anthropic.*",
"arn:aws:bedrock:*::foundation-model/cohere.*"
]
}
]
}If you're distributing the vector database via S3:
{
"Effect": "Allow",
"Action": [
"s3:GetObject",
"s3:PutObject",
"s3:ListBucket"
],
"Resource": [
"arn:aws:s3:::my-code-index",
"arn:aws:s3:::my-code-index/*"
]
}The scripts/pull-code-index-vectors.sh script can automatically find a working AWS profile. Configure it in .code-index.json:
{
"aws": {
"account": "123456789012",
"profiles": ["dev", "staging", "production"]
}
}The script checks the current profile first. If it doesn't match the configured account, it tries each profile in the list until one works.
At typical usage (10K items indexed):
| Operation | Model | Cost |
|---|---|---|
| Function summaries | Haiku | ~$0.50 |
| File summaries | Sonnet | ~$1.00 |
| Package summaries | Sonnet | ~$0.50 |
| Embeddings | Cohere Embed v4 | ~$0.16 |
| Total full rebuild | ~$2 |
Incremental runs (typical daily update) cost a few cents.