-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
feat: add AWS profile support for Bedrock credentials #10504
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
base: dev
Are you sure you want to change the base?
Conversation
- Add BEDROCK_AWS_PROFILE environment variable support - Implement AWS SDK credential provider chain for automatic refresh - Update credential loading logic to support profiles, static env vars, and user-provided credentials - Add logging for credential source transparency - Update .env.example with profile configuration documentation Follows S3 implementation pattern for credential handling. Enables users to configure AWS profiles with optional credential_process for automatic token refresh.
- Add AWS profile configuration as Option 1 (recommended for temporary credentials) - Document credential_process for automatic credential refresh - Reorganize authentication methods into three clear options with recommendations - Add examples for ~/.aws/config and ~/.aws/credentials setup - Include JSON format specification for credential_process output - Add links to AWS CLI configuration and external process documentation - Clarify when to use each authentication method (profiles vs provider chain vs static) - Add warnings about static credentials with temporary tokens Aligns documentation with new BEDROCK_AWS_PROFILE feature in LibreChat - PR: danny-avila/LibreChat#10504.
|
Issue: #10506 |
|
Please add corresponding documentation PR to https://github.com/LibreChat-AI/librechat.ai |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds AWS profile support for Bedrock credentials, enabling automatic credential refresh through the AWS SDK's credential provider chain. This enhancement allows users to configure AWS profiles with optional credential_process for seamless token rotation, eliminating manual updates of static environment variables when credentials expire.
Key Changes:
- Added
BEDROCK_AWS_PROFILEenvironment variable support for AWS profile-based authentication - Refactored credential loading logic to support three methods: user-provided credentials, static environment variables, and AWS SDK credential provider chain
- Added comprehensive documentation in
.env.examplewith configuration examples and AWS documentation references
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| api/server/services/Endpoints/bedrock/options.js | Refactored credential selection logic to support AWS profiles via credential provider chain, added logging for credential source transparency, and set profile property on llmConfig when applicable |
| .env.example | Added detailed documentation for AWS profile configuration including examples of credential_process setup and links to AWS documentation |
Comments suppressed due to low confidence (2)
.env.example:172
- Corrected spelling of 'support' to 'supported'.
# The following models are not support due to not supporting streaming:
.env.example:175
- Corrected spelling of 'support' to 'supported'.
# The following models are not support due to not supporting conversation history:
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
That was already done - LibreChat-AI/librechat.ai#443 |
|
Hi @iElsha I can review/merge this soon. thanks for your patience. Also sent you a message on Discord so we can collaborate on better AWS compatibility |
Pull Request Template
Summary
This PR adds AWS profile support for Bedrock credentials, enabling automatic credential refresh using the AWS SDK's credential provider chain. This
improvement allows users to configure AWS profiles with optional
credential_processfor seamless token rotation, eliminating the need to manuallyupdate static environment variables when credentials expire.
Key Changes:
BEDROCK_AWS_PROFILEenvironment variable support.env.examplewith comprehensive documentation on profile configuration and optional auto-refresh setupBenefits:
Change Type
Please delete any irrelevant options.
Testing
Please describe your test process and include instructions so that we can reproduce your test. If there are any important variables for your testing configuration, list them here.
Test Configuration:
Environment Variables:
BEDROCK_AWS_DEFAULT_REGION=us-west-2 BEDROCK_AWS_PROFILE=my-bedrock-profile AWS Config (~/.aws/config): [profile my-bedrock-profile] region = us-west-2 credential_process = my-custom-refresh-command --format json # This can also be credential_process = node /path/to/LibreChat/config/get-aws-credentials.js or anything else...Test Steps:
Backward Compatibility Testing:
Checklist
Please delete any irrelevant options.
Test Suites: 1 skipped, 80 passed, 80 of 81 total