fix(bedrock): forward litellm_params AWS auth to batch create signing - #36449
Conversation
transform_create_batch_request signed requests using only optional_params,
which is always {} at the create_batch call site in llm_http_handler.py.
This meant cross-account role/credentials configured via litellm_params
never reached sign_aws_request, causing Bedrock to reject the signed
request with "Cross-account pass role is not allowed" even though
aws_batch_role_arn was correctly resolved for the roleArn field.
Merge optional_params and litellm_params before signing and region
resolution so cross-account auth configured at the deployment level is
actually used to sign the CreateModelInvocationJob request.
Greptile SummaryThis PR forwards deployment-level AWS authentication and region parameters into Bedrock batch request signing so configured cross-account credentials are retained.
Confidence Score: 5/5The PR appears safe to merge, with the Bedrock batch request now using the deployment’s configured AWS authentication and region consistently. The active batch caller supplies deployment parameters through litellm_params and an empty optional_params mapping; the merged mapping therefore restores the required signer inputs, while the pre-signed HTTP branch sends the same URL used during signing.
|
| Filename | Overview |
|---|---|
| litellm/llms/bedrock/batches/transformation.py | Correctly supplies deployment AWS settings to both endpoint construction and the existing Bedrock signer without changing the HTTP transport path. |
| tests/test_litellm/llms/bedrock/batches/test_transformation.py | Adds focused mocked coverage confirming that the configured assume-role ARN and region reach request signing. |
Reviews (1): Last reviewed commit: "fix(bedrock): forward litellm_params AWS..." | Re-trigger Greptile
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
Thanks Noah, the diagnosis was right. PR #36160 merged this same litellm_params merge for batch and file signing, so closing this as superseded. |
|
@linear attach this pr BerriAI/litellm#36160to the ticket |
|
Attached this pull request to LIT-5303. |
TLDR
Problem this solves:
How it solves it:
User Flow
Before: an admin who configured a Bedrock deployment with a cross-account batch role gets every batch job rejected by AWS
After: the same batch job is accepted
Relevant issues
Linear ticket
Resolves LIT-4223
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
@greptileaito re-request a review after pushing changes)Delays in PR merge?
If you're seeing a delay in your PR being merged, ping the LiteLLM Team on Slack (#pr-review).
Screenshots / Proof of Fix
Reproducing this needs a Bedrock deployment with a real cross-account IAM role (aws_role_name for the assume-role hop, aws_batch_role_arn for the job's roleArn), which I don't have credentials for. Steps below reproduce it against a live proxy for anyone who does.
Config (dev_config.yaml), pointed at a Bedrock model whose account differs from the calling identity's account:
Start the proxy against that config, then:
Before the fix (checked out at
9de3315dad, the commit this branch is based on): the batches call fails, and the proxy log shows the AWS error body containing "Cross-account pass role is not allowed."After the fix (this branch,
6b50fcc8a5): the same call returns a batch object with an id and a validating/in-progress status.Type
🐛 Bug Fix
Caveats (if any)
Final Attestation