- Newest
- Most votes
- Most comments
Hello,
Greetings of the day!
From the response, I understand that you are experiencing an error while creating the batch jobs.
The first error appears to be related to an issue during the IAM role creation and the second error is S3 permission issue. Please use the following permissions and trust relationship, and apply that role while creating a job.
[1] Create an IAM policy with the following permissions. Replace MYINPUTBUCKETNAME and MYOUTPUTBUCKETNAME with your actual bucket names. Also, replace YOURAWSACCOUNTID with your AWS account ID.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:GetObject",
"s3:PutObject",
"s3:ListBucket"
],
"Resource": [
"arn:aws:s3:::MYINPUTBUCKETNAME",
"arn:aws:s3:::MYINPUTBUCKETNAME/*",
"arn:aws:s3:::MYOUTPUTBUCKETNAME",
"arn:aws:s3:::MYOUTPUTBUCKETNAME/*"
],
"Condition": {
"StringEquals": {
"aws:ResourceAccount": "YOURAWSACCOUNTID"
}
}
}
]
}
[2] Create a role with the following trust policy. Please replace YOURAWSACCOUNTID with your AWS account ID. Also, attach the above-created policy to this role.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Service": "bedrock.amazonaws.com"
},
"Action": "sts:AssumeRole",
"Condition": {
"StringEquals": {
"aws:SourceAccount": "YOURAWSACCOUNTID"
},
"ArnEquals": {
"aws:SourceArn": "arn:aws:bedrock:us-west-2:YOURAWSACCOUNTID:model-invocation-job/*"
}
}
}
]
}
Once the role is created, create a batch job and select the existing role created above. If the issue persist even after following above steps, please contact AWS support from the concerned account so they can check the your account logs for the same.
Thanks!
Resource: [1] https://docs.aws.amazon.com/bedrock/latest/userguide/batch-inference-permissions.html#batch-inference-permissions-service
Based on the information you've provided, there are a few potential issues that could be causing the errors you're encountering with your Bedrock Batch Inference job:
-
Role Permissions: The error message suggests that there might be an issue with the IAM role permissions. Even though you've created a role based on the preview, it's possible that the role doesn't have the necessary permissions to access your S3 bucket. Double-check that the role has the appropriate S3 permissions, including ListBucket, GetObject, and PutObject for the specific bucket and folders you're using.
-
S3 Bucket Configuration: Ensure that your S3 bucket is properly configured to allow access from the Bedrock service. This includes having the correct bucket policy and CORS configuration if necessary.
-
Input/Output URI Format: While you mentioned using the GUI to select the correct folders and files, it's worth double-checking the exact format of your input and output URIs. For the input, make sure it points to the specific JSONL file. For the output, ensure it points to the folder where you want the results to be stored.
-
Job Configuration: The initial error message mentions "Missing multi-value replacements required by the template for [outputput_bucket_names_with_or_without_object_prefixes]". This suggests there might be an issue with how the output configuration is being set. Make sure you're providing all required fields in the job configuration, including the correct output data config.
To resolve these issues:
-
Review and update the IAM role permissions to ensure it has full access to the specific S3 bucket and objects you're using for input and output.
-
Verify your S3 bucket settings, ensuring it's accessible from the same region as your Bedrock client.
-
Double-check the format of your input and output URIs, making sure they're correctly pointing to the JSONL file and output folder respectively.
-
If you're using the API or SDK to create the job, ensure all required fields are properly filled out in your CreateModelInvocationJob request, including the inputDataConfig and outputDataConfig.
-
Try creating a new IAM role with broader permissions temporarily to isolate whether it's a permissions issue.
If these steps don't resolve the issue, you may need to contact AWS support for further assistance, as there could be account-specific or service-related issues that aren't immediately apparent.
Sources
Create a batch inference job - Amazon Bedrock
Enhance performance of generative language models with self-consistency prompting on Amazon Bedrock | AWS Machine Learning Blog
Error in AWS Bedrock Batch Inteference | AWS re:Post
answered 2 years ago
This is unhelpful.
Relevant content
asked 2 years ago
asked 2 years ago
- AWS OFFICIALUpdated a year ago

Thanks, I actually already tried this, but when creating the role I think I must've made a hard to see typo, because repeating your advice again worked this time for in console.
I will try doing it via-code and see if the second error is cleared up too.
This works in code too, eliminating the other error.