@cdklabs/cdk-appmod-catalog-blueprints 1.0.1 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.jsii +700 -203
- package/lib/document-processing/adapter/adapter.d.ts +47 -0
- package/lib/document-processing/adapter/adapter.js +5 -0
- package/lib/document-processing/adapter/index.d.ts +2 -0
- package/lib/document-processing/adapter/index.js +19 -0
- package/lib/document-processing/adapter/queued-s3-adapter.d.ts +66 -0
- package/lib/document-processing/adapter/queued-s3-adapter.js +230 -0
- package/lib/document-processing/agentic-document-processing.d.ts +22 -0
- package/lib/document-processing/agentic-document-processing.js +11 -14
- package/lib/document-processing/base-document-processing.d.ts +8 -44
- package/lib/document-processing/base-document-processing.js +23 -190
- package/lib/document-processing/bedrock-document-processing.js +3 -13
- package/lib/document-processing/default-document-processing-config.d.ts +3 -0
- package/lib/document-processing/default-document-processing-config.js +14 -0
- package/lib/document-processing/index.d.ts +2 -0
- package/lib/document-processing/index.js +3 -1
- package/lib/document-processing/resources/default-bedrock-invoke/index.py +36 -24
- package/lib/document-processing/resources/default-sqs-consumer/index.py +10 -5
- package/lib/document-processing/resources/default-strands-agent/index.py +8 -5
- package/lib/document-processing/tests/agentic-document-processing-nag.test.js +6 -2
- package/lib/document-processing/tests/agentic-document-processing.test.js +5 -19
- package/lib/document-processing/tests/bedrock-document-processing-nag.test.js +6 -2
- package/lib/framework/custom-resource/default-runtimes.js +1 -1
- package/lib/framework/foundation/access-log.js +1 -1
- package/lib/framework/foundation/eventbridge-broker.js +1 -1
- package/lib/framework/foundation/network.js +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/utilities/data-loader.js +1 -1
- package/lib/utilities/lambda-iam-utils.js +1 -1
- package/lib/utilities/observability/cloudfront-distribution-observability-property-injector.js +1 -1
- package/lib/utilities/observability/default-observability-config.d.ts +9 -0
- package/lib/utilities/observability/default-observability-config.js +20 -0
- package/lib/utilities/observability/index.d.ts +1 -0
- package/lib/utilities/observability/index.js +2 -1
- package/lib/utilities/observability/lambda-observability-property-injector.js +1 -1
- package/lib/utilities/observability/powertools-config.js +1 -1
- package/lib/utilities/observability/state-machine-observability-property-injector.js +1 -1
- package/lib/webapp/frontend-construct.js +1 -1
- package/package.json +9 -9
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { Duration, RemovalPolicy } from 'aws-cdk-lib';
|
|
2
2
|
import { IMetric } from 'aws-cdk-lib/aws-cloudwatch';
|
|
3
3
|
import { Table } from 'aws-cdk-lib/aws-dynamodb';
|
|
4
|
-
import {
|
|
5
|
-
import { Bucket } from 'aws-cdk-lib/aws-s3';
|
|
6
|
-
import { Queue } from 'aws-cdk-lib/aws-sqs';
|
|
4
|
+
import { Key } from 'aws-cdk-lib/aws-kms';
|
|
7
5
|
import { StateMachine } from 'aws-cdk-lib/aws-stepfunctions';
|
|
8
6
|
import { BedrockInvokeModel, LambdaInvoke, StepFunctionsStartExecution } from 'aws-cdk-lib/aws-stepfunctions-tasks';
|
|
9
7
|
import { Construct } from 'constructs';
|
|
8
|
+
import { IAdapter } from './adapter';
|
|
10
9
|
import { Network } from '../framework';
|
|
11
10
|
import { EventbridgeBroker } from '../framework/foundation/eventbridge-broker';
|
|
12
11
|
import { LogGroupDataProtectionProps } from '../utilities';
|
|
@@ -16,27 +15,16 @@ import { IObservable, ObservableProps } from '../utilities/observability/observa
|
|
|
16
15
|
*/
|
|
17
16
|
export interface BaseDocumentProcessingProps extends ObservableProps {
|
|
18
17
|
/**
|
|
19
|
-
*
|
|
20
|
-
*
|
|
18
|
+
* Adapter that defines how the document processing workflow is triggered
|
|
19
|
+
*
|
|
20
|
+
* @default QueuedS3Adapter
|
|
21
21
|
*/
|
|
22
|
-
readonly
|
|
22
|
+
readonly ingressAdapter?: IAdapter;
|
|
23
23
|
/**
|
|
24
24
|
* DynamoDB table for storing document processing metadata and workflow state.
|
|
25
25
|
* If not provided, a new table will be created with DocumentId as partition key.
|
|
26
26
|
*/
|
|
27
27
|
readonly documentProcessingTable?: Table;
|
|
28
|
-
/**
|
|
29
|
-
* SQS queue visibility timeout for processing messages.
|
|
30
|
-
* Should be longer than expected processing time to prevent duplicate processing.
|
|
31
|
-
* @default Duration.seconds(300)
|
|
32
|
-
*/
|
|
33
|
-
readonly queueVisibilityTimeout?: Duration;
|
|
34
|
-
/**
|
|
35
|
-
* The number of times a message can be unsuccessfully dequeued before being moved to the dead-letter queue.
|
|
36
|
-
*
|
|
37
|
-
* @default 5
|
|
38
|
-
*/
|
|
39
|
-
readonly dlqMaxReceiveCount?: number;
|
|
40
28
|
/**
|
|
41
29
|
* Maximum execution time for the Step Functions workflow.
|
|
42
30
|
* @default Duration.minutes(30)
|
|
@@ -68,22 +56,6 @@ export interface BaseDocumentProcessingProps extends ObservableProps {
|
|
|
68
56
|
*/
|
|
69
57
|
readonly encryptionKey?: Key;
|
|
70
58
|
}
|
|
71
|
-
/**
|
|
72
|
-
* S3 prefix constants for organizing documents throughout the processing lifecycle.
|
|
73
|
-
*
|
|
74
|
-
* Documents flow through these prefixes based on processing outcomes:
|
|
75
|
-
* - Upload → raw/ (triggers processing)
|
|
76
|
-
* - Success → processed/ (workflow completed successfully)
|
|
77
|
-
* - Failure → failed/ (workflow encountered errors)
|
|
78
|
-
*/
|
|
79
|
-
export declare enum DocumentProcessingPrefix {
|
|
80
|
-
/** Prefix for newly uploaded documents awaiting processing */
|
|
81
|
-
RAW = "raw/",
|
|
82
|
-
/** Prefix for documents that failed processing */
|
|
83
|
-
FAILED = "failed/",
|
|
84
|
-
/** Prefix for successfully processed documents */
|
|
85
|
-
PROCESSED = "processed/"
|
|
86
|
-
}
|
|
87
59
|
/**
|
|
88
60
|
* Union type for Step Functions tasks that can be used in document processing workflows.
|
|
89
61
|
* Supports Bedrock model invocation, Lambda function invocation, and nested Step Functions execution.
|
|
@@ -118,20 +90,14 @@ export declare abstract class BaseDocumentProcessing extends Construct implement
|
|
|
118
90
|
readonly metricNamespace: string;
|
|
119
91
|
/** log group data protection configuration */
|
|
120
92
|
readonly logGroupDataProtection: LogGroupDataProtectionProps;
|
|
121
|
-
/** S3 bucket for document storage with organized prefixes (raw/, processed/, failed/) */
|
|
122
|
-
readonly bucket: Bucket;
|
|
123
|
-
/** SQS queue for reliable message processing with dead letter queue support */
|
|
124
|
-
readonly queue: Queue;
|
|
125
93
|
/** DynamoDB table for storing document processing metadata and workflow state */
|
|
126
94
|
readonly documentProcessingTable: Table;
|
|
127
95
|
/** Configuration properties for the document processing pipeline */
|
|
128
96
|
private readonly props;
|
|
129
|
-
/** Dead letter queue */
|
|
130
|
-
readonly deadLetterQueue: Queue;
|
|
131
97
|
/** KMS key */
|
|
132
98
|
readonly encryptionKey: Key;
|
|
133
|
-
/**
|
|
134
|
-
readonly
|
|
99
|
+
/** Ingress adapter, responsible for triggering workflow */
|
|
100
|
+
readonly ingressAdapter: IAdapter;
|
|
135
101
|
/**
|
|
136
102
|
* Creates a new BaseDocumentProcessing construct.
|
|
137
103
|
*
|
|
@@ -144,8 +110,6 @@ export declare abstract class BaseDocumentProcessing extends Construct implement
|
|
|
144
110
|
*/
|
|
145
111
|
constructor(scope: Construct, id: string, props: BaseDocumentProcessingProps);
|
|
146
112
|
protected handleStateMachineCreation(stateMachineId: string): StateMachine;
|
|
147
|
-
protected handleWorkflowTrigger(stateMachine: StateMachine): void;
|
|
148
|
-
private createSQSConsumerLambda;
|
|
149
113
|
private createStateMachineRole;
|
|
150
114
|
private createMoveToFailedChain;
|
|
151
115
|
private createMoveToProcessedChain;
|