- Resources
- Roles
- CFNLambdaRole (Bootstrap Stack)
- CFNLambdaRole (QnABot Stack)
- ESProxyLambdaRole
- ESLoginLambdaRole
- ExampleLambdaRole
- KendraCrawlerRole
- ExtensionLambdaRole
- S3ListLambdaRole
- ExportRole
- KendraSyncRole
- TranslateRole
- ConnectRole
- FullfillmentLambdaRole
- ImportRole
- LexBuildLambdaRole
- LexProxyLambdaRole
- SignupLambdaRole – not used (deprecated)
- SignupLambda
- SchemaLambda
- TestAllRole
- Master Stack - 20
- Example Stack - 2
- Export - 6
- Import - 1
- TestAll - 1
- Bootstrap (separate stack used for deployments) - 1
Total - 30
- User Pool - authenticated login to Content Designer
- Identity Pool - supports API Gateway IAM authentication when calling supported Lambdas
- AssetBucket - additional components used to extend QnABot
- BuildStatusBucket - used for staging various assets during deployment
- ExportBucket - Used for staging files exported from QnABot. API Gateway is used a proxy for the bucket
- ImportBucket - Used for staging files imported into QnABot
- TestAllBucket - Used for staging files used for the TestAll functionality.
- MetricsBucket - All captured usage data is sent to both OpenSearch and this bucket via Kinesis
- MainAccessLogBucket - Access log bucket for the AssetBucket, BuildStatusBucket, ExportBucket, ImportBucket and MetricsBucket
- devBootStrapAccessLogsBucket - Access log bucket for the dev Bootstrap bucket
- devAccessLogsBucket - Access Log bucket for the dev bucket
- ContentDesignerOutputBucket - Results from “Test all”, "Import", and "Export" functionality
- Bucket - HTML/CSS/Javascript used by the Content Designer
- Lambda
- S3
- SNS - APIGW has a 30 second timeout. The Kendra web crawler takes longer than 30 seconds. The Content Designer calls the Crawler API to trigger an SNS message that starts the crawler Lambda
- Stores user session information.
- Stores curated questions and answers
- Stores usage metrics
- Master 21
- Example 13
- Export 6
- Import 2
- The chatbot engine
- FeedbackSNS can generate notifications (text, email, etc.) for positive/negative feedback
- There is an optional utility script which adds KMS/CMK encryption to many resources. The list below is for the default use cases
- The quiz workflow.
- KendraCrawlerRule - Schedules the Kendra Crawler based on setting
- CloudWatchEventRule - triggered when the Parameter Store custom setting is changed. It in turns triggers the KendraCrawler Lambda that configures the KendraCrawlerRule to schedule the crawler to run
- Lambda
- Kendra
- Sentiment Analysis - detects whether a question was positive, negative, neutral or mixed
- Language Detection - detects the user’s language, translates the text to English and translates the response from English to the user’s language
- Analyze Syntax - detects parts of speech in a sentence and searches for questions in OpenSearch based on words that match specified parts of speech – i.e, Nouns, Adjectives, Verbs, etc
- PII Detection - detects whether a question contains Personally Identifiable Information and allows an administrator to instruct QnABot to reject a question that contains certain types of PII.
- Kendra FAQ - Questions entered into QnABot are synchronized with Kendra FAQ for better matching
- Kendra Documents - QnABot has an integrated web crawler, web page contents are indexed with Kendra
- DefaultQnABotSettings - default settings for QnABot
- CustomQnABotSettings - any settings that are changed from th e default by the user. QnABot merges DefaultQnABotSettings and CustomQnABotSettings at runtime
- Static assets (HTML, CSS, JavaScript) related to the Content Designer
- Holding area for data transfers between different processes
- Translates user’s questions to and from English as necessary
- Custom Terminology - An administrator can import a CSV file with language pairs to override default translations
- Convert voice to text
- Convert text to voice
- Transfers messages from fulfillment lambda to Kinesis Firehose to the OpenSearch index for OpenSearchDashboards and S3.
- Used to store feedback from the client to OpenSearchDashboards
Deletes the objects from S3 to allow the bucket to be deleted when the stack is deleted
A custom CloudFormation resource
- Deploys APIGateway resources
- Creates and manages Cognito Identity Pools
- Updates OpenSearch resources
- Creates LexBot
S3 – Unzips assets stored in S3
CloudFormation will not recognize that a referenced zip file for a Lambda has changed using our deployment process. This creates a new S3 version of the object.
- Deletes contents of the bucket when QnABot is uninstalled so the bucket can be deleted
This lambda contains a collection of lambda hooks for QnABot and a custom resource to create the example documents.
Custom CF resource that expands resources for custom extensions packages - in the Imports section of Tools
Reads versions of file based on CF parameter. It forces CF to recognize a new version of the Lambda code so it will update the resource
Processes user’s questions through a pipeline – used mostly in Content Designer
- Reads settings from SSM Parameter Store
- Processes question with Comprehend (see above)
- Translates questions and answer if necessary (see above)
- Uses Kendra FAQ feature (see above)
- Supports “Rebuild Lex” functionality
- Uses KMS to decrypt sessions encrypted by the quiz functionality
Scheduled job to expire metrics data from OpenSearch
Proxies requests from API Gateway to OpenSearch
Designed to just return a question ID – may be used by guided navigation package – research whether it is deprecated
Same functionality as ESProxyLambda used mostly at runtime
Returns slot types from the LexBot
Sends events to OpenSearch using Firehose
Showcases using QnABot for quizzes
- KMS for encrypting questions - The quiz lambda sends the answer in a session attribute, and we didn't want people cheating by looking inside the session attribute.. we use KMS to encrypt it.
- Example of creating custom functionality using JavaScript. It is not used by QnABot
demonstrates how QnABot can be asked by a user for a live agent based phone callback
Thumbs Up/Thumbs Down support
- Uses a KMS/CMK to encrypt messages before sending them to Firehose
Demonstrates branching questions – going to the next step in a branched workflow
Demonstrates branching questions – going to the next step in a branched workflow
This lambda contains a collection of lambda hooks for QnABot and a custom resource to create the example documents.
This lambda contains a collection of lambda hooks for QnABot and a custom resource to create the example documents.
Supports indexing web pages
- Reads settings from ParameterStore
- Dynamically changes the EventBridge KendraCrawlerRule based on a setting
- Creates custom Kendra Data Source and indexes web pages
This role will be used for all “extensions” to the question processing pipeline. Currently we have the Lambda(s) below configured
When enabled, if a question cannot be answered via the OpenSearch query, QnABot searches the configured Kendra index(es)
- Uses XRay for request tracing
- When configured via the PublicOrPrivate CF parameter, it is attached to a VPC
- Translates questions and answers between English and the users’s native language
Sample custom python Lambda hook
Some of our samples embed images. ExampleS3ListLambda provides endpoints to the images in S3 via APIGW
Users can import example files in the Content Designer stored on S3. This Lambda returns the URL of the API Gateway S3 proxy request to retrieve the file.
Used as part of the export questions functionality.
Syncs curated questions stored in OpenSearch to Kendra FAQ
- Reads settings from ParameterStore
- Reads JSON FAQ file from S3
- Syncs JSON FAQ file to Kendra FAQ
- When calling Kendra to sync FAQs, a role needs to be passed to the command to allow access to S3. This role needs “iam:passRole” permission
- Used to managed importing Translate Custom Terminologies
- Supports the Connect wizard.
- processes and writes locally stored Connect Call Flows to S3
- Lambda Write permission (Not needed – SIM created in open source backlog)
Orchestrates processing pipeline for questions and answers
- Lex (See services section)
- Lambda Write – calls other Lambdas
- Comprehend (see Services section)
- Kendra (see Service section)
- S3
- DynamoDB (see Services section)
- Parameter Store (see Services section)
Starts the import question and answer process
Supports the import question process in the Cotent Designer*
- Reads the question file from S3
- Writes a status file that is retrieve via an API GW S3 Proxy
Generates additional NLP training data for Lex using questions from questions added via the content designer
- Reads questions from OpenSearch to rebuild Lex model
Polls Lex service to determine build completion status
- Stores status file in S3 read by API GW S3 proxy endpoint.
Starts Lex Rebuild process
- Stores status file in S3 read by API GW S3 proxy endpoint
- Proxies Lex requests from API Gateway to Lex
Reads status of the Lex Build process from status file S3 object and returns the status
Supports the quiz functionality
- OpenSearchService
Supports “Test All Questions” step in the Content Designer
- Calls other Lambdas as needed to test questions and answers
Handles sending anonymized operational metrics to AWS