Skip to content

Commit ac8d91e

Browse files
committed
docs: refresh bedrock discovery docs
1 parent 2903340 commit ac8d91e

2 files changed

Lines changed: 38 additions & 14 deletions

File tree

docs/help/faq.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,7 @@ for usage/billing and raise limits as needed.
626626
</Accordion>
627627

628628
<Accordion title="Is AWS Bedrock supported?">
629-
Yes - via pi-ai's **Amazon Bedrock (Converse)** provider with **manual config**. You must supply AWS credentials/region on the gateway host and add a Bedrock provider entry in your models config. See [Amazon Bedrock](/providers/bedrock) and [Model providers](/providers/models). If you prefer a managed key flow, an OpenAI-compatible proxy in front of Bedrock is still a valid option.
629+
Yes. OpenClaw has a bundled **Amazon Bedrock (Converse)** provider. With AWS env markers present, OpenClaw can auto-discover the streaming/text Bedrock catalog and merge it as an implicit `amazon-bedrock` provider; otherwise you can explicitly enable `models.bedrockDiscovery.enabled` or add a manual provider entry. See [Amazon Bedrock](/providers/bedrock) and [Model providers](/providers/models). If you prefer a managed key flow, an OpenAI-compatible proxy in front of Bedrock is still a valid option.
630630
</Accordion>
631631

632632
<Accordion title="How does Codex auth work?">

docs/providers/bedrock.md

Lines changed: 37 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,21 @@ not an API key.
2121

2222
## Automatic model discovery
2323

24-
If AWS credentials are detected, OpenClaw can automatically discover Bedrock
25-
models that support **streaming** and **text output**. Discovery uses
26-
`bedrock:ListFoundationModels` and is cached (default: 1 hour).
24+
OpenClaw can automatically discover Bedrock models that support **streaming**
25+
and **text output**. Discovery uses `bedrock:ListFoundationModels` and is
26+
cached (default: 1 hour).
27+
28+
How the implicit provider is enabled:
29+
30+
- If `models.bedrockDiscovery.enabled` is `true`, OpenClaw will try discovery
31+
even when no AWS env marker is present.
32+
- If `models.bedrockDiscovery.enabled` is unset, OpenClaw only auto-adds the
33+
implicit Bedrock provider when it sees one of these AWS auth markers:
34+
`AWS_BEARER_TOKEN_BEDROCK`, `AWS_ACCESS_KEY_ID` +
35+
`AWS_SECRET_ACCESS_KEY`, or `AWS_PROFILE`.
36+
- The actual Bedrock runtime auth path still uses the AWS SDK default chain, so
37+
shared config, SSO, and IMDS instance-role auth can work even when discovery
38+
needed `enabled: true` to opt in.
2739

2840
Config options live under `models.bedrockDiscovery`:
2941

@@ -44,7 +56,8 @@ Config options live under `models.bedrockDiscovery`:
4456

4557
Notes:
4658

47-
- `enabled` defaults to `true` when AWS credentials are present.
59+
- `enabled` defaults to auto mode. In auto mode, OpenClaw only enables the
60+
implicit Bedrock provider when it sees a supported AWS env marker.
4861
- `region` defaults to `AWS_REGION` or `AWS_DEFAULT_REGION`, then `us-east-1`.
4962
- `providerFilter` matches Bedrock provider names (for example `anthropic`).
5063
- `refreshInterval` is seconds; set to `0` to disable caching.
@@ -101,15 +114,24 @@ export AWS_BEARER_TOKEN_BEDROCK="..."
101114
## EC2 Instance Roles
102115

103116
When running OpenClaw on an EC2 instance with an IAM role attached, the AWS SDK
104-
will automatically use the instance metadata service (IMDS) for authentication.
105-
However, OpenClaw's credential detection currently only checks for environment
106-
variables, not IMDS credentials.
117+
can use the instance metadata service (IMDS) for authentication. For Bedrock
118+
model discovery, OpenClaw only auto-enables the implicit provider from AWS env
119+
markers unless you explicitly set `models.bedrockDiscovery.enabled: true`.
107120

108-
**Workaround:** Set `AWS_PROFILE=default` to signal that AWS credentials are
109-
available. The actual authentication still uses the instance role via IMDS.
121+
Recommended setup for IMDS-backed hosts:
122+
123+
- Set `models.bedrockDiscovery.enabled` to `true`.
124+
- Set `models.bedrockDiscovery.region` (or export `AWS_REGION`).
125+
- You do **not** need a fake API key.
126+
- You only need `AWS_PROFILE=default` if you specifically want an env marker
127+
for auto mode or status surfaces.
110128

111129
```bash
112-
# Add to ~/.bashrc or your shell profile
130+
# Recommended: explicit discovery enable + region
131+
openclaw config set models.bedrockDiscovery.enabled true
132+
openclaw config set models.bedrockDiscovery.region us-east-1
133+
134+
# Optional: add an env marker if you want auto mode without explicit enable
113135
export AWS_PROFILE=default
114136
export AWS_REGION=us-east-1
115137
```
@@ -149,11 +171,11 @@ aws ec2 associate-iam-instance-profile \
149171
--instance-id i-xxxxx \
150172
--iam-instance-profile Name=EC2-Bedrock-Access
151173

152-
# 3. On the EC2 instance, enable discovery
174+
# 3. On the EC2 instance, enable discovery explicitly
153175
openclaw config set models.bedrockDiscovery.enabled true
154176
openclaw config set models.bedrockDiscovery.region us-east-1
155177

156-
# 4. Set the workaround env vars
178+
# 4. Optional: add an env marker if you want auto mode without explicit enable
157179
echo 'export AWS_PROFILE=default' >> ~/.bashrc
158180
echo 'export AWS_REGION=us-east-1' >> ~/.bashrc
159181
source ~/.bashrc
@@ -166,7 +188,9 @@ openclaw models list
166188

167189
- Bedrock requires **model access** enabled in your AWS account/region.
168190
- Automatic discovery needs the `bedrock:ListFoundationModels` permission.
169-
- If you use profiles, set `AWS_PROFILE` on the gateway host.
191+
- If you rely on auto mode, set one of the supported AWS auth env markers on the
192+
gateway host. If you prefer IMDS/shared-config auth without env markers, set
193+
`models.bedrockDiscovery.enabled: true`.
170194
- OpenClaw surfaces the credential source in this order: `AWS_BEARER_TOKEN_BEDROCK`,
171195
then `AWS_ACCESS_KEY_ID` + `AWS_SECRET_ACCESS_KEY`, then `AWS_PROFILE`, then the
172196
default AWS SDK chain.

0 commit comments

Comments
 (0)