Access denied when calling Amazon Q business BatchPutDocument API. Please check your data source IAM role.

0

Hi, I am trying out Amazon Q and using the Q retriever. I have successfully added a S3 bucket as the data source. As I try to sync the files in the S3, I received error: "Access denied when calling Amazon Q business BatchPutDocument API. Please check your data source IAM role."

The IAM role for data source it is using has the following permissions policies. What else can be missing? Please advise.

  • AmazonKendraFullAccess
  • AmazonS3FullAccess

Trusted Entities:

{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "Service": [ "lambda.amazonaws.com", "kendra.amazonaws.com", "qbusiness.amazonaws.com" ] }, "Action": "sts:AssumeRole" } ] }

2개 답변
1
수락된 답변

Hi there!

Since you are using the native Q retriever you will need to allow BatchPutDocument on your Q index, like below:

    {
      "Sid": "AllowsAmazonQToIngestDocuments",
      "Effect": "Allow",
      "Action": [
        "qbusiness:BatchPutDocument",
        "qbusiness:BatchDeleteDocument"
      ],
      "Resource": "arn:aws:qbusiness:{{region}}:{{source_account}}:application/{{application_id}}/index/{{index_id}}"
    },

You can check out the full IAM permission needed in the docs at https://docs.aws.amazon.com/amazonq/latest/business-use-dg/create-s3-datasource-iam-role.html as you will also have to add permissions for the Principal Store APIs in addition to the above and access to your S3 bucket. There are also examples for other configurations.

AWS
Gillian
답변함 2달 전
0

Since the error is pointing to BatchPutDocument API, I followed this https://docs.aws.amazon.com/kendra/latest/dg/iam-roles.html

Here is the policy I added to the role. However, I am still getting the same error. Thanks for your pointers. { "Version": "2012-10-17", "Statement": [ { "Action": [ "s3:GetObject" ], "Resource": [ "arn:aws:s3:::xxxx/" ], "Effect": "Allow" }, { "Action": [ "s3:ListBucket" ], "Resource": [ "arn:aws:s3:::xxxx" ], "Effect": "Allow" }, { "Effect": "Allow", "Action": [ "kendra:BatchPutDocument", "kendra:BatchDeleteDocument" ], "Resource": [ "arn:aws:kendra:us-east-2:12345678:index/" ] } ] }

답변함 2달 전
  • If you are using the native Q retriever you need to provide permissions for qbusiness:BatchPutDocument rather than kendra:BatchPutDocument. The link in the answer gives the full details of the permissions needed.

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠