Connecting Amazon Q Business to Amazon S3 using the console - Amazon Q Business

Connecting Amazon Q Business to Amazon S3 using the console

The following procedure outlines how to connect Amazon Q Business to Amazon S3 using the AWS Management Console.

Connecting Amazon Q to Amazon S3
  1. Sign in to the AWS Management Console and open the Amazon Q console at https://console.aws.amazon.com/amazonq/business/.

  2. Complete the steps to create your Amazon Q application.

  3. Complete the steps for selecting an Amazon Q retriever.

  4. Then, from Data sources – Add an available data source to connect your Amazon Q application.

    You can add up to 5 data sources.

  5. Then, on the Amazon S3 page, enter the following information:

  6. Name – Name your data source for easy tracking.

    Note: You can include hyphens (-) but not spaces. Maximum of 1,000 alphanumeric characters.

  7. Configure VPC and security group – optional – You can choose to use a VPC if your Amazon S3 bucket is not accessible through the public internet. If you so, you must add Subnets and VPC security groups as well.

    Important

    Make sure you have:

    For more information, see Using Amazon VPC and Using Amazon VPC with Amazon S3.

    If you choose to use VPC, enter the following information:

    1. Subnets – Select up to 6 repository subnets that define the subnets and IP ranges the repository instance uses in the selected VPC.

    2. VPC security groups – Choose up to 10 security groups that allow access to your data source. Ensure that the security group allows incoming traffic from Amazon EC2 instances and devices outside your VPC. For databases, security group instances are required.

  8. IAM role – Choose an existing IAM role or create an IAM role to access your repository credentials and index content.

    Note

    IAM roles used for applications can't be used for data sources. If you are unsure if an existing role is used for an application, choose Create a new role to avoid errors.

  9. Sync scope, enter the following information:

    1. Enter the data source location – The path to the Amazon S3 bucket where your data is stored. Select Browse S3 to find and choose your bucket.

    2. Maximum file size - optional – The maximum file size value that Amazon Q will crawl. Amazon Q will only crawl files within the limit you define.

    3. Advanced settings, enter the following information:

      • Metadata files prefix folder location - optional – The path to the folder in which your metadata is stored. Select Browse S3 to locate your metadata folder.

      • Access control list configuration file location - optional – The path to the location of a file containing a JSON structure that specifies access settings for the files stored in your S3 data source. Select Browse S3 to locate your ACL file.

    4. Regex patterns – Add patterns to include or exclude documents from your index. All paths are relative to the data source location Amazon S3 bucket. You can add up to 100 patterns.

      You can include and exclude documents using file names, file types, file paths, and glob patterns (patterns that can expand a wildcard pattern into a list of path names that match the given pattern).

      Examples of glob patterns include:

      • /myapp/config/* – All files inside config directory

      • /**/*.png – All .png files in all directories

      • /**/*.{png,ico,md} – All .png, .ico, or .md files in all directories

      • /myapp/src/**/*.ts – All .ts files inside src directory (and all its subdirectories)

      • **/!(*.module).ts – All .ts files but not .module.ts

  10. Sync mode, choose how you want to update your index when your data source content changes. When you sync your data source with Amazon Q for the first time, all content is synced by default.

    • Full sync – Sync all content regardless of the previous sync status.

    • New, modified, or deleted content sync – Sync only new, modified, and deleted documents.

  11. In Sync run schedule, for Frequency – Choose how often Amazon Q will sync with your data source. For more details, see Sync run schedule.

  12. Tags - optional – Add tags to search and filter your resources or track your AWS costs. See Tags for more details.

  13. Field mappings – A list of data source document attributes to map to your index fields. Add the fields from the Data source details page after you finish adding your data source. You can choose from two types of fields:

    1. Default – Automatically created by Amazon Q on your behalf based on common fields in your data source. You can't edit these.

    2. Custom – Automatically created by Amazon Q on your behalf based on common fields in your data source. You can edit these. You can also create and add new custom fields.

      Note

      Support for adding custom fields varies by connector. You won't see the Add field option if your connector doesn't support adding custom fields.

    For more information, see Field mappings.

  14. To finish connecting your data source to Amazon Q, select Add data source.

    You are taken to the Data source details, where you can view your data source configuration details.

  15. In Data source details, choose Sync now to allow Amazon Q to begin syncing (crawling and ingesting) data from your data source. When the sync job finishes, your data source is ready to use.

    Note

    You can also choose to view CloudWatch logs for your data source sync job by selecting View CloudWatch logs. If you get a Resource not found exception when you try to view your CloudWatch logs for a data source sync job in progress, it can be because the CloudWatch logs are not available yet. Wait for some time and check again.