fix: allow Bedrock provider to use AWS SDK default credential chain#3708
fix: allow Bedrock provider to use AWS SDK default credential chain#3708majiayu000 wants to merge 4 commits intosimstudioai:mainfrom
Conversation
Remove hard requirement for explicit AWS credentials in Bedrock provider. When access key and secret key are not provided, the AWS SDK automatically falls back to its default credential chain (env vars, instance profile, ECS task role, EKS IRSA, SSO). Closes simstudioai#3694 Signed-off-by: majiayu000 <1835304752@qq.com>
Reject configurations where only one of bedrockAccessKeyId or bedrockSecretKey is provided, preventing silent fallback to the default credential chain with a potentially different identity. Add tests covering all credential configuration scenarios. Signed-off-by: majiayu000 <1835304752@qq.com>
Remove unused config parameter and dead _lastConfig assignment from mock factory. Break long mockReturnValue chain to satisfy biome line-length rule. Signed-off-by: majiayu000 <1835304752@qq.com>
|
@majiayu000 is attempting to deploy a commit to the Sim Team on Vercel. A member of the Team first needs to authorize it. |
PR SummaryMedium Risk Overview Updates request validation to reject partial credentials (only one of the two keys) and only includes Written by Cursor Bugbot for commit e67b9df. This will update automatically on new commits. Configure here. |
Greptile SummaryThis PR makes AWS Bedrock credentials optional in the provider, allowing the AWS SDK's default credential chain (environment variables, IAM roles, Key changes:
Confidence Score: 5/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[executeRequest called] --> B{bedrockAccessKeyId\nprovided?}
B -- Yes --> C{bedrockSecretKey\nprovided?}
B -- No --> D{bedrockSecretKey\nprovided?}
C -- Yes --> E[Build clientConfig\nwith explicit credentials]
C -- No --> F[Throw Error:\nboth keys must be\nprovided together]
D -- Yes --> F
D -- No --> G[Build clientConfig\nwithout credentials]
E --> H[new BedrockRuntimeClient\nwith credentials]
G --> I[new BedrockRuntimeClient\nno credentials → AWS SDK\ndefault credential chain]
H --> J[Send request to Bedrock]
I --> J
Last reviewed commit: "fix: clean up bedroc..." |
Use BedrockRuntimeClientConfig from SDK instead of inline type. Add default return value for prepareToolsWithUsageControl mock. Signed-off-by: majiayu000 <1835304752@qq.com>
Summary
Make Bedrock credentials optional so the provider falls back to AWS SDK's default credential chain (env vars, IAM role,
~/.aws/credentials, etc.) when explicit keys are not provided.Fixes #3694
Type of Change
Testing
apps/sim/providers/bedrock/index.test.tscovering:Checklist
Screenshots/Videos
N/A — backend-only change, no UI impact.