BerriAI/litellm · error · ValueError
AWS IAM role ARN is required for Bedrock batch jobs. Set…
Error message
AWS IAM role ARN is required for Bedrock batch jobs. Set 'aws_batch_role_arn' in litellm_params or AWS_BATCH_ROLE_ARN env var
What it means
Configuration guard in Bedrock batch creation: no IAM role ARN was resolved from litellm_params.aws_batch_role_arn, optional_params, or the AWS_BATCH_ROLE_ARN env var. Bedrock batch jobs require a role to read/write S3, so job creation cannot proceed.
Solutions
- Set aws_batch_role_arn in litellm_params for the batch call.
- Set the AWS_BATCH_ROLE_ARN environment variable.
- Create an IAM role with Bedrock/S3 batch permissions and use its ARN.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at litellm/llms/bedrock/batches/transformation.py:184 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18).
Data as JSON: /api/errors/a941bf5cfbb60859.
Report an issue: GitHub.
Appendix: source
Thrown at litellm/llms/bedrock/batches/transformation.py:184
raise ValueError("input_file_id is required for Bedrock batch creation")
# Extract S3 information from file ID using common utility
input_bucket, input_key = self.common_utils.parse_s3_uri(input_file_id)
# Get output S3 configuration
output_bucket = litellm_params.get("s3_output_bucket_name") or os.getenv("AWS_S3_OUTPUT_BUCKET_NAME")
if not output_bucket:
# Use same bucket as input if no output bucket specified
output_bucket = input_bucket
# Get IAM role ARN
role_arn: Final = (
litellm_params.get("aws_batch_role_arn")
or optional_params.get("aws_batch_role_arn")
or os.getenv("AWS_BATCH_ROLE_ARN")
)
if not role_arn:
raise ValueError(
"AWS IAM role ARN is required for Bedrock batch jobs. "
"Set 'aws_batch_role_arn' in litellm_params or AWS_BATCH_ROLE_ARN env var"
)
if not model:
raise ValueError("Could not determine Bedrock model ID. Please pass `model` in your request body.")
# Generate job name with the correct model ID using common utility
job_name: Final = self.common_utils.generate_unique_job_name(model, prefix="litellm")
output_key: Final = f"litellm-batch-outputs/{job_name}/"
# Build input data config
input_data_config: Final[BedrockInputDataConfig] = {
"s3InputDataConfig": BedrockS3InputDataConfig(s3Uri=f"s3://{input_bucket}/{input_key}")
}
# Build output data config
s3_output_config: Final[BedrockS3OutputDataConfig] = BedrockS3OutputDataConfig(View on GitHub (pinned to 77b7c6c40c)