Skip to content

AccessDenied when syncing Amazon Bedrock Knowledge Base: role cannot call Titan embedding model

0

Hi everyone,

I’m new to AWS and to Amazon Bedrock and I’m stuck trying to create and sync a Knowledge Base. I’ve gone in circles with IAM roles/policies and keep getting AccessDenied related to the embedding model. I’d really appreciate a clean, step-by-step explanation of what the correct role/policy setup should be and how to fix my current state.

What I’m trying to do

Region: us-east-1

Goal: Create an Amazon Bedrock Knowledge Base with vector store that reads documents from S3 and uses Titan Text Embeddings v2.

This Knowledge Base will later be used by an Agent (and eventually a voice flow with Amazon Nova Sonic + Vonage), but right now I just want the Knowledge Base to sync successfully.

How I created the Knowledge Base

In the Bedrock console I went to Knowledge bases → Create knowledge base.

I selected: “Knowledge base with vector store” (unstructured data).

Basic settings:

Name: basemexicogas (or similar)

IAM role: I chose “Create and use a new service role” (Bedrock created a service role like RolServicioKnowledgeBase or AmazonBedrockExecutionRoleForKnowledgeBase_randomNum).

Data source:

Type: Amazon S3

I pointed it to my S3 bucket with my documents.

Embeddings & vector store:

Embeddings model: Amazon Titan Text Embeddings v2 (arn:aws:bedrock:us-east-1::foundation-model/amazon.titan-embed-text-v2:0)

Vector store: Amazon OpenSearch Serverless (quick create).

The creation of the Knowledge Base and the OpenSearch collection seems to succeed.

The problem appears when I click “Sync”.

Main error I get on sync

When I click Sync, I get:

Data sync failed. "Knowledge base role arn:aws:iam::435326265446:role/service-role/RolServicioKnowledgeBase is not able to call specified bedrock embedding model arn:aws:bedrock:us-east-1::foundation-model/amazon.titan-embed-text-v2:0: Operation not allowed (Service: BedrockRuntime, Status Code: 400, Request ID: 4b38a6e6-b39d-405d-8d4a-a24e7de332fd) (SDK Attempt Count: 1)"

So basically:

the Knowledge Base execution role is not allowed to call the Titan embedding model.

What I already tried (IAM roles & policies)

I know this is a permissions issue, so I tried several things:

Letting Bedrock auto-create the role

I let Bedrock create the service role (e.g. RolServicioKnowledgeBase or AmazonBedrockExecutionRoleForKnowledgeBase_*).

Then I tried to sync → I got the error above.

Adding AWS managed policies to the role In IAM, for the KB service role, I attached:

AmazonBedrockFullAccess

AmazonS3FullAccess

(On other attempts I also attached OpenSearch Serverless policies.)

Adding a custom inline policy to explicitly allow the Titan embedding model:

{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "bedrock:InvokeModel" ], "Resource": [ "arn:aws:bedrock:us-east-1::foundation-model/amazon.titan-embed-text-v1:0", "arn:aws:bedrock:us-east-1::foundation-model/amazon.titan-embed-text-v2:0" ] } ] }

Even with this inline policy attached, syncing still fails with the same error.

Enabling model access (Foundation models) In the Bedrock console under Foundation models, I made sure that Amazon Titan Text Embeddings v2 is available/accessible in us-east-1. From the console it looks like I have access to use it.

Recreating the Knowledge Base and roles from scratch

I deleted the Knowledge Base.

I created a new IAM role for Bedrock with:

AmazonBedrockFullAccess

AmazonS3FullAccess

Custom inline policy (like above for bedrock:InvokeModel).

Then I tried to create the Knowledge Base again, sometimes using the existing role, sometimes letting Bedrock create a new service role.

I still end up with the same sync error about not being able to call the embedding model.

Additional error I got when trying another cleanup attempt

In one attempt, when I tried to create another Knowledge Base / role cleanup, I got this error:

Knowledge Base: basemexicogas was failed to create. [AccessDeniedException] bedrock.amazonaws.com did not create the default version (v2) of the AmazonBedrockFoundationModelPolicyForKnowledgeBase_RolServicioKnowledgeBase policy that is attached to the RolServicioKnowledgeBase role. To continue, detach the policy from any other identities and then delete the policy and the role.

So at this point I’m a bit confused about:

The auto-created “AmazonBedrockFoundationModelPolicyForKnowledgeBase_*” policies and roles.

Whether I should avoid editing those policies/roles manually.

Whether I should not attach AmazonBedrockFullAccess to the KB execution role.

What the exact, expected IAM trust policy and permission policies should be for a Knowledge Base execution role that:

Reads from S3,

Uses Titan Text Embeddings v2,

Writes to OpenSearch Serverless.

My environment / users

Region: us-east-1

I originally used the root user (I know that’s not recommended).

Then I created an IAM user to work with Bedrock and Knowledge Bases, as required by the console (Knowledge Bases cannot be created with the root user).

The errors above are happening while logged in as the IAM user.

What I’m asking for

Could someone please provide:

The canonical, minimal example of:

The trust policy for the Knowledge Base execution role.

The permission policies (managed and/or inline) that role needs to successfully call the Titan embedding model and OpenSearch Serverless during Knowledge Base sync.

A step-by-step cleanup and creation process, for example:

Which auto-created roles/policies should I delete.

How to create a fresh Knowledge Base and service role without conflicting with AmazonBedrockFoundationModelPolicyForKnowledgeBase_*.

Whether I should use “Create and use a new service role” vs “Use an existing service role” in the Knowledge Base UI.

Any known gotchas with:

Titan Text Embeddings v2 and Knowledge Bases in us-east-1,

Or with editing the auto-generated AmazonBedrockFoundationModelPolicyForKnowledgeBase_* policies.

I’m just trying to get a simple Knowledge Base with Titan Embeddings to sync successfully, but I keep getting Operation not allowed on the embedding model even after adding what looks like all the necessary permissions.

Thank you in advance for any detailed guidance or a working example configuration.

asked a year ago777 views

2 Answers
0

Based on the error message you're encountering, it appears that your Knowledge Base role doesn't have proper access to the Amazon Titan embedding model. This is a common issue that can be resolved by following these steps:

The Root Cause

The main issue is likely that you haven't subscribed to the Amazon Titan Embedding model in the Bedrock Model Marketplace. Even if you have the correct IAM permissions, you need to explicitly subscribe to the model before you can use it.

Step-by-Step Solution

  1. Subscribe to the Titan Embedding Model:
  • Go to the Amazon Bedrock console
  • Navigate to "Model access" under "Bedrock configurations"
  • Find "Amazon Titan Embed Text v2" in the list
  • Click "Request model access" if it's not already enabled
  • Complete the subscription process
  1. Verify IAM Role Permissions: Your IAM role for the Knowledge Base needs these permissions:
  • bedrock:InvokeModel for the Titan embedding model
  • S3 access permissions for your data source
  • S3Vectors or OpenSearch permissions depending on your vector store
  1. Create a Clean Knowledge Base Setup:
  • Delete any existing problematic Knowledge Base
  • Delete any auto-created roles that might be causing conflicts
  • Create a new Knowledge Base with "Create and use a new service role"
  • After creation, you can enhance the auto-created role with additional permissions if needed
  1. Required IAM Policy Elements: Your Knowledge Base role should have a policy that includes:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"bedrock:InvokeModel"
],
"Resource": [
"arn:aws:bedrock:us-east-1::foundation-model/amazon.titan-embed-text-v2:0"
]
},
{
"Effect": "Allow",
"Action": [
"s3:ListBucket"
],
"Resource": [
"arn:aws:s3:::{YOUR_SOURCE_BUCKET_NAME}"
]
},
{
"Effect": "Allow",
"Action": [
"s3:GetObject"
],
"Resource": [
"arn:aws:s3:::{YOUR_SOURCE_BUCKET_NAME}/*"
]
}
]
}
  1. For OpenSearch Serverless Vector Store: Add the necessary OpenSearch permissions to your role if you're using OpenSearch Serverless as your vector store.

The most important step is subscribing to the model in the Bedrock Model Marketplace. Many users encounter this issue because they have the correct IAM permissions but haven't completed the model subscription process. After subscribing to the model and ensuring your IAM role has the proper permissions, you should be able to successfully sync your Knowledge Base.
Sources
Data sync failed error in Amazon Bedrock Knowledgebase | AWS re:Post
Resolve file sync failures with Amazon Bedrock Knowledge Bases | AWS re:Post
Building cost-effective RAG applications with Amazon Bedrock Knowledge Bases and Amazon S3 Vectors | Artificial Intelligence

answered a year ago

0

Hey,

Hope you're keeping well.

The sync error means the Knowledge Base’s service role doesn’t have permission to invoke the Titan embedding model. When you select “Create and use a new service role,” Bedrock creates an IAM role with S3 and OpenSearch access, but it won’t automatically include the bedrock:InvokeModel permission for that specific model ARN.

Go to IAM > Roles, open your Knowledge Base role, and attach an inline policy granting bedrock:InvokeModel on the Titan model ARN you’re using. For example:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": "bedrock:InvokeModel",
      "Resource": "arn:aws:bedrock:us-east-1::foundation-model/amazon.

Thanks and regards,  
Taz

answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.