You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Amazon Q Business to Amazon Simple Storage Service (Amazon S3)
2
+
3
+
This pattern contains a sample stack that leverages Amazon Q Business to build a generative AI application to derive insights from content present in an S3 bucket. An AWS Lambda function initiates the crawling and indexing of the documents present in the specified S3 bucket. Users can then ask questions to the Amazon Q Business application to receive a generated response.
4
+
5
+
Important: this application uses various AWS services and there are costs associated with these services after the Free Tier usage - please see the AWS Pricing page for details. You are responsible for any AWS costs incurred. No warranty is implied in this example.
6
+
7
+
## Requirements
8
+
*[Create an AWS account](https://portal.aws.amazon.com/gp/aws/developer/registration/index.html) if you do not already have one and log in. The IAM user that you use must have sufficient permissions to make necessary AWS service calls and manage AWS resources.
9
+
*[AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) installed and configured
*[Enable AWS IAM Identity Center](https://docs.aws.amazon.com/singlesignon/latest/userguide/get-set-up-for-idc.html)
13
+
*[Create Users in AWS IAM Identity Center](https://docs.aws.amazon.com/singlesignon/latest/userguide/addusers.html). Note down the Instance ARN by going to the AWS IAM Identity Center console --> Settings --> Instance ARN. You will require it when deploying the stack.
14
+
*[Create an S3 Bucket](https://docs.aws.amazon.com/AmazonS3/latest/userguide/creating-bucket.html) and [upload documents](https://docs.aws.amazon.com/AmazonS3/latest/userguide/upload-objects.html) that you want to be indexed. If you already have an S3 bucket with data that you want to crawl, you can skip this step.
15
+
16
+
## Deployment Instructions
17
+
1. Create a new directory, navigate to that directory in a terminal and clone the GitHub repository:
1. Note the outputs from the CDK deployment process. These contain the resource names and/or ARNs which are used for testing.
30
+
31
+
# How it works
32
+
Please refer to the architecture diagram below:
33
+
34
+

35
+
36
+
Here's a breakdown of the steps:
37
+
38
+
**Amazon Q Business Application:** Amazon Q Business application created with S3 as the data source.
39
+
40
+
**Amazon S3:** S3 bucket that contains documents to be indexed.
41
+
42
+
**AWS Lambda:** AWS Lambda function `DataSourceSync` crawls and indexes the content from the S3 bucket. The Amazon Q Business application retrieves data from the indexed content and provides a generated response.
43
+
44
+
## Testing
45
+
46
+
1. Go to the Amazon Q Business Console and verify that your application `MyQBusinessApp-${StackName}` has been created.
47
+

48
+
49
+
1. Click on the Name of the Application. Scroll down to the `Groups and Users` section. Click on `Manage access and Subscriptions`.
50
+

51
+
1. Click on `Add groups and users` and select `Assign existing users and groups`. Click `Next`.
52
+
53
+
Note: If you have NOT already created a user in the Requirements section, then create one by choosing `Add and assign new users` instead and add the user.
54
+

55
+
1. Add the name of the user and click on `Assign`.
56
+

57
+
1. Select the user and in the `Change subscription` dropdown, select `Update subscription tier`. In the `New subscription` dropdown, choose `Q Business Lite` and `Confirm`.
58
+

59
+
1. Go back to your application. Under `Web experience settings`, copy the `Deployed URL` link.
60
+

61
+
1. Open the URL in a New Incognito Window. Login to the web experience with the credentials of the created user. Ask a question in the chat interface regarding the documents you have in the S3 bucket provided as a data source.
62
+

63
+
64
+
## Cleanup
65
+
66
+
1. Delete the stack
67
+
```bash
68
+
cdk destroy
69
+
```
70
+
----
71
+
Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
s3_bucket_name=CfnParameter(self, "S3DSBucketName", type="String", description="Enter the S3 bucket name where the contents you want to be indexed are stored.")
25
+
identity_center_arn=CfnParameter(self, "IdentityCenterInstanceArn", type="String", description="Enter the ARN of the Amazon Q Business Identity Center instance.")
0 commit comments