Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🪨 feat: AWS default credentials chain #123

Merged
merged 1 commit into from
Sep 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion pages/docs/configuration/pre_configured_ai/bedrock.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Head to the [AWS docs](https://docs.aws.amazon.com/bedrock/latest/userguide/gett

You’ll also need to turn on model access for your account, which you can do by [following these instructions](https://docs.aws.amazon.com/bedrock/latest/userguide/model-access.html).

## Authentication

- You will need to set the following environment variables:

```bash filename=".env"
Expand All @@ -12,7 +14,25 @@ BEDROCK_AWS_ACCESS_KEY_ID=your_access_key_id
BEDROCK_AWS_SECRET_ACCESS_KEY=your_secret_access_key
```

Note: Other ways to authenticate are still in development.
**Note:** You can also omit the access keys in order to use the default AWS credentials chain but you must set the default region:

```bash filename=".env"
BEDROCK_AWS_DEFAULT_REGION=us-east-1
```

Doing so prompts the credential provider to find credentials from the following sources (listed in order of precedence):

- Environment variables exposed via process.env
- SSO credentials from token cache
- Web identity token credentials
- Shared credentials and config ini files
- The EC2/ECS Instance Metadata Service

The default credential provider will invoke one provider at a time and only continue to the next if no credentials have been located.

For example, if the process finds values defined via the `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` environment variables, the files at ~/.aws/credentials and ~/.aws/config will not be read, nor will any messages be sent to the Instance Metadata Service.

## Configuring models

- You can optionally specify which models you want to make available with `BEDROCK_AWS_MODELS`:

Expand Down
Loading