Architecture details
This section describes the components and AWS services that make up this solution and the architecture details on how these components work together.
This solution includes three separate Step Functions workflows invoked by EventBridge events, as described in the Architecture diagram section. The following sections describe each of these workflows, AWS services used in this solution, and how the solution works.
AWS services in this solution
AWS service | Description |
---|---|
Amazon API Gateway |
Core. This service provides the REST API for the solution. |
Amazon Cognito |
Core. This service handles user management and authentication for the API. |
Amazon Comprehend |
Core. This service performs standard and PII entity detection. NoteThe CloudFormation template doesn’t deploy this service. Instead, Lambda calls this service as a part of the architecture. |
Amazon Comprehend Medical |
Core. This service performs medical entity and PHI detection. NoteThe CloudFormation template doesn’t deploy this service. Instead, Lambda calls this service as a part of the architecture. |
Amazon DynamoDB |
Core. Two tables contain data for this solution:
|
Amazon EventBridge |
Core. This solution uses an entirely event-driven architecture.
|
AWS KMS |
Core. AWS managed keys provide server-side encryption on the Amazon SQS queues in this solution. The solution also uses AWS KMS to:
|
AWS Lambda |
Core. The solution uses Lambda functions to:
|
Amazon SNS |
Core. The solution creates an Amazon SNS topic to handle sending success and failure notifications to users through email. |
Amazon SQS |
Core. Amazon SQS acts as the intermediary between the workflow Step Functions and their core processing logic, which the solution implements as Lambda Functions. As such, the solution creates an Amazon SQS queue for each workflow. The solution also implements a dead-letter queue with Amazon SQS to handle failed processing requests for each workflow. |
Amazon S3 |
Core. This solution creates the following S3 buckets for storage:
|
AWS Step Functions |
Core. Step Functions implement the workflows and interact with the workflow orchestrator with EventBridge events. Each workflow Step Function:
|
Amazon Textract |
Core. The solution uses Amazon Textract in the text extraction workflow to:
NoteThe CloudFormation template doesn’t deploy this service. Instead, Lambda calls this service as a part of the architecture. |
AWS WAF |
Core. The solution deploys a web application firewall (WAF) in front of the API Gateway deployment to protect it. |
AWS CloudFormation |
Supporting. This solution is distributed as a CloudFormation template, and CloudFormation deploys the AWS resources for the solution. |
Amazon CloudWatch |
Supporting. This solution publishes logs from solution resources to CloudWatch Logs, and publishes metrics for processed documents to CloudWatch metrics. The solutions also creates a CloudWatch dashboard to view this data, as well as CloudWatch Alarms to raise alerts when executions are failing. |
AWS CDK |
Supporting. The source code for this solution uses AWS CDK to generate the CloudFormation templates. |
IAM |
Supporting. IAM manages access permissions between the resources in this solution, such as allowing a workflow Lambda function to write to the ML inferences S3 bucket. See IAM roles for details. |
Service Catalog |
Supporting. This solution uses Service Catalog AppRegistry to track and manage solution deployments. |
Amazon Kendra |
Optional. You can optionally deploy this solution with Amazon Kendra support, which provides NLP-based search for the uploaded documents. |
Amazon
OpenSearch |
Optional. You can optionally deploy this solution with Amazon OpenSearch Serverless support, which provides keyword search for the uploaded documents. |