Skip to content

Commit fc11126

Browse files
committed
feat!: change bedrock bearer token variable to match AWS docs
Rename AWS_BEDROCK_API_KEY to AWS_BEARER_TOKEN_BEDROCK to align with the naming convention used in AWS Bedrock documentation and the AWS web console UI. This reduces confusion when developers compare LLS docs with AWS docs. Internally within Llama Stack, keep the Python str variable named `aws_bedrock_api_key`, because: 1) AWS does refer to this as an "API Key" in the UI and docs, 2) This matches the naming convention for other providers' API keys.
1 parent 840ad75 commit fc11126

File tree

10 files changed

+11
-11
lines changed

10 files changed

+11
-11
lines changed

docs/docs/providers/inference/remote_bedrock.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ AWS Bedrock inference provider using OpenAI compatible endpoint.
2222
## Sample Configuration
2323

2424
```yaml
25-
api_key: ${env.AWS_BEDROCK_API_KEY:=}
25+
api_key: ${env.AWS_BEARER_TOKEN_BEDROCK:=}
2626
region_name: ${env.AWS_DEFAULT_REGION:=us-east-2}
2727
```

src/llama_stack/distributions/ci-tests/run-with-postgres-store.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ providers:
4747
- provider_id: bedrock
4848
provider_type: remote::bedrock
4949
config:
50-
api_key: ${env.AWS_BEDROCK_API_KEY:=}
50+
api_key: ${env.AWS_BEARER_TOKEN_BEDROCK:=}
5151
region_name: ${env.AWS_DEFAULT_REGION:=us-east-2}
5252
- provider_id: ${env.NVIDIA_API_KEY:+nvidia}
5353
provider_type: remote::nvidia

src/llama_stack/distributions/ci-tests/run.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ providers:
4747
- provider_id: bedrock
4848
provider_type: remote::bedrock
4949
config:
50-
api_key: ${env.AWS_BEDROCK_API_KEY:=}
50+
api_key: ${env.AWS_BEARER_TOKEN_BEDROCK:=}
5151
region_name: ${env.AWS_DEFAULT_REGION:=us-east-2}
5252
- provider_id: ${env.NVIDIA_API_KEY:+nvidia}
5353
provider_type: remote::nvidia

src/llama_stack/distributions/starter-gpu/run-with-postgres-store.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ providers:
4747
- provider_id: bedrock
4848
provider_type: remote::bedrock
4949
config:
50-
api_key: ${env.AWS_BEDROCK_API_KEY:=}
50+
api_key: ${env.AWS_BEARER_TOKEN_BEDROCK:=}
5151
region_name: ${env.AWS_DEFAULT_REGION:=us-east-2}
5252
- provider_id: ${env.NVIDIA_API_KEY:+nvidia}
5353
provider_type: remote::nvidia

src/llama_stack/distributions/starter-gpu/run.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ providers:
4747
- provider_id: bedrock
4848
provider_type: remote::bedrock
4949
config:
50-
api_key: ${env.AWS_BEDROCK_API_KEY:=}
50+
api_key: ${env.AWS_BEARER_TOKEN_BEDROCK:=}
5151
region_name: ${env.AWS_DEFAULT_REGION:=us-east-2}
5252
- provider_id: ${env.NVIDIA_API_KEY:+nvidia}
5353
provider_type: remote::nvidia

src/llama_stack/distributions/starter/run-with-postgres-store.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ providers:
4747
- provider_id: bedrock
4848
provider_type: remote::bedrock
4949
config:
50-
api_key: ${env.AWS_BEDROCK_API_KEY:=}
50+
api_key: ${env.AWS_BEARER_TOKEN_BEDROCK:=}
5151
region_name: ${env.AWS_DEFAULT_REGION:=us-east-2}
5252
- provider_id: ${env.NVIDIA_API_KEY:+nvidia}
5353
provider_type: remote::nvidia

src/llama_stack/distributions/starter/run.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ providers:
4747
- provider_id: bedrock
4848
provider_type: remote::bedrock
4949
config:
50-
api_key: ${env.AWS_BEDROCK_API_KEY:=}
50+
api_key: ${env.AWS_BEARER_TOKEN_BEDROCK:=}
5151
region_name: ${env.AWS_DEFAULT_REGION:=us-east-2}
5252
- provider_id: ${env.NVIDIA_API_KEY:+nvidia}
5353
provider_type: remote::nvidia

src/llama_stack/providers/remote/inference/bedrock/bedrock.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ async def openai_chat_completion(
111111
logger.error(f"AWS Bedrock authentication token expired: {error_msg}")
112112
raise ValueError(
113113
"AWS Bedrock authentication failed: Bearer token has expired. "
114-
"The AWS_BEDROCK_API_KEY environment variable contains an expired pre-signed URL. "
114+
"The AWS_BEARER_TOKEN_BEDROCK environment variable contains an expired pre-signed URL. "
115115
"Please refresh your token by generating a new pre-signed URL with AWS credentials. "
116116
"Refer to AWS Bedrock documentation for details on OpenAI-compatible endpoints."
117117
) from e

src/llama_stack/providers/remote/inference/bedrock/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ class BedrockConfig(RemoteInferenceProviderConfig):
2727
@classmethod
2828
def sample_run_config(cls, **kwargs):
2929
return {
30-
"api_key": "${env.AWS_BEDROCK_API_KEY:=}",
30+
"api_key": "${env.AWS_BEARER_TOKEN_BEDROCK:=}",
3131
"region_name": "${env.AWS_DEFAULT_REGION:=us-east-2}",
3232
}

tests/unit/providers/inference/test_bedrock_config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
def test_bedrock_config_defaults_no_env(monkeypatch):
1111
"""Test BedrockConfig defaults when env vars are not set"""
12-
monkeypatch.delenv("AWS_BEDROCK_API_KEY", raising=False)
12+
monkeypatch.delenv("AWS_BEARER_TOKEN_BEDROCK", raising=False)
1313
monkeypatch.delenv("AWS_DEFAULT_REGION", raising=False)
1414
config = BedrockConfig()
1515
assert config.auth_credential is None
@@ -35,5 +35,5 @@ def test_bedrock_config_sample():
3535
sample = BedrockConfig.sample_run_config()
3636
assert "api_key" in sample
3737
assert "region_name" in sample
38-
assert sample["api_key"] == "${env.AWS_BEDROCK_API_KEY:=}"
38+
assert sample["api_key"] == "${env.AWS_BEARER_TOKEN_BEDROCK:=}"
3939
assert sample["region_name"] == "${env.AWS_DEFAULT_REGION:=us-east-2}"

0 commit comments

Comments
 (0)