Setting up permissions

In order to query a Kendra index you need permissions for the query API call, in my case I’ll be creating a policy to attach to my sagemaker notebook execution role, if instead of using a role, you prefer to use an IAM User , you can attach the same policy to it.

You are going to create a policy with query permissions to our index.

  1. On the AWS Console got IAM and click on Roles.

  1. Look for the role you want to give permission to query your Kendra index, in my case it is an Amazon Sagemaker Execution Role.

  1. Click on Attach Policies.

  1. Mark KendraReadOnlyAccess and click on Attach policy.