fix to support: feat2864 - using local credentials file with Amazon Bedrock #3986
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request Type
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
yarn lint
from the root of the repo & committed changes