Skip to content

Bedrock Batch for Titan Text Embeddings v2

0

I'm trying to create a "smoke test" batch job using Titan Text Embeddings v2, and getting the following error:

$ aws bedrock create-model-invocation-job \
  --region us-east-1 \
  --model-id amazon.titan-embed-text-v2:0 \
  --job-name smoke-embeddings-$(date +%s) \
  --role-arn arn:aws:iam::"$ACCT_ID":role/bedrock-batch-role \
  --input-data-config '{"s3InputDataConfig":{"s3Uri":"s3://'"$BUCKET"'/bedrock/in/smoke/payload.jsonl"}}' \
  --output-data-config '{"s3OutputDataConfig":{"s3Uri":"s3://'"$BUCKET"'/bedrock/out/smoke/"}}'

An error occurred (ValidationException) when calling the CreateModelInvocationJob operation: Your account is not authorized to perform this action. Please create a support case (https://console.aws.amazon.com/support/home) with details about your use case and we will get back to you.

I tried this in the Console website as well, and received a similar message. I have access to the embedding model, and runtime InvokeModel succeeds but batch CreateModelInvocationJob fails.

The input JSONL file has the "recordId" wrapper and seems to be formatted properly (I tried with a simple {"inputText":"Hello world"} file). I created the appropriate role with permissions to S3 (and with trust relationships that mirror the docs), and also a caller policy for my IAM user that gives the proper Bedrock batch permissions as well as the IAM PassRole permission. My account is not part of an organization and there are no permission boundaries that apply to my setup. Everything is in us-east-1 (which the docs say should have the batch embedding model I'm trying to use). There don't appear to be quotas on usage other than basic defaults that are nowhere near applicable to the small smoke test I'm trying to run.

I tried debugging with ChatGPT, tried opening a support ticket, and nothing has helped so far. Anyone have ideas on what might be going on and how I can resolve?

  • Also FWIW there doesn't seem to be a CloudTrail trace for these errors when I tried to create the batch job.

1 Answer
0

The "Operation not allowed" or "Your account is not authorized to perform this action" error you're encountering with Amazon Bedrock batch jobs is a known issue that several users have reported.

Based on the information provided, here are some potential causes and solutions:

  1. Account-level restrictions: Even though you have access to the Titan Text Embeddings v2 model for real-time inference (InvokeModel), your account might not have been granted access to batch inference capabilities. This is separate from model access permissions.

  2. Input format issues: For embedding models like Titan Text Embeddings v2, your input file needs to have a specific format. Make sure your JSONL file contains an "input_text" field with the text you want to embed. For example:

{"input_text": "Your text to embed here"}

Unlike other models, embedding models don't require a "prompt_id" field.

  1. IAM permissions: Double-check that both your user role and the service role have the necessary permissions. The service role needs permissions for bedrock:CreateModelInvocationJob, bedrock:InvokeModel, and S3 read/write access.

  2. Support case: As the error message suggests, this might be a limitation that requires AWS Support intervention. Since you mentioned you've already opened a support ticket, you might need to wait for their response as this could be related to account-level settings that only AWS can modify.

  3. Try a different region: If possible, you could try running the batch job in a different region to see if the issue is region-specific.

Unfortunately, this appears to be an issue that might require AWS Support to resolve if all your configurations are correct. The "Operation not allowed" error is often related to account-level restrictions rather than configuration problems.
Sources
Amazon Bedrock batch job: Validation Error: Operation Not Allowed | AWS re:Post
Build a serverless Amazon Bedrock batch job orchestration workflow using AWS Step Functions | Artificial Intelligence
AWS Bedrock Batch Inference Operation Not Allowed | AWS re:Post

answered 4 days ago
AWS
EXPERT
reviewed 3 days ago