Skip to content

fix to support: feat2864 - using local credentials file with Amazon Bedrock #3986

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nonatofabio
Copy link

Pull Request Type

  • ✨ feat
  • πŸ› fix
  • ♻️ refactor
  • πŸ’„ style
  • πŸ”¨ chore
  • πŸ“ docs

Relevant Issues

connect #2864

What is in this change?

This PR fixes an authentication bug in the AWS Bedrock provider where passing an empty object {} as credentials caused the AWS SDK to reject the configuration with the error:
Resolved credential object is not valid.

The credentials getter in server/utils/AiProviders/bedrock/index.js now returns undefined instead of {} for iam_role and default cases. This enables the AWS SDK to correctly fall back to its default credential provider chain (e.g., local credentials file, environment, or EC2/ECS IAM role), restoring support for local development and environments that use assumed roles.

Additional Information

Verified that returning undefined allows the AWS SDK to use local credentials as expected.
No other logic or side effects are introduced by this change.

Developer Validations

  • I ran yarn lint from the root of the repo & committed changes
  • [] Relevant documentation has been updated
  • I have tested my code functionality
  • Docker build succeeds locally

@@ -107,7 +107,7 @@ class AWSBedrockLLM {
// IAM role is used for long-term credentials implied by system process
// is filled by the AWS SDK automatically if we pass in no credentials
case "iam_role":
return {};
return undefined; // No explicit credentials needed, AWS SDK will use the IAM role of the instance or local credential if returning undefined.
default:
return {};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should return undefined in the default case then as well, yeah?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants