From 2b8c133cd515db2f6b200c28032090bfc934d9fd Mon Sep 17 00:00:00 2001 From: Ian Falconer <38296760+leftbrainstuff@users.noreply.github.com> Date: Fri, 31 May 2024 23:53:35 +0200 Subject: [PATCH 1/5] Update package.json Update aws cdk version to resolve a python 3.7 not supported by aws lambda --- textract-pipeline/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/textract-pipeline/package.json b/textract-pipeline/package.json index de756868..8afcc3ae 100644 --- a/textract-pipeline/package.json +++ b/textract-pipeline/package.json @@ -13,7 +13,7 @@ "devDependencies": { "@types/jest": "^24.0.22", "@types/node": "^14.0.0", - "aws-cdk": "^2.26.0", + "aws-cdk": "^2.142.1", "jest": "^29.5.0", "ts-jest": "^24.1.0", "ts-node": "^8.1.0", From f41fffa4f64ff8ba67c6d20f806328e6e2748b04 Mon Sep 17 00:00:00 2001 From: Ian Falconer <38296760+leftbrainstuff@users.noreply.github.com> Date: Sat, 1 Jun 2024 00:16:36 +0200 Subject: [PATCH 2/5] Update package.json Update from chatgpt to latest versions --- textract-pipeline/package.json | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/textract-pipeline/package.json b/textract-pipeline/package.json index 8afcc3ae..e9d4849f 100644 --- a/textract-pipeline/package.json +++ b/textract-pipeline/package.json @@ -11,17 +11,17 @@ "cdk": "cdk" }, "devDependencies": { - "@types/jest": "^24.0.22", - "@types/node": "^14.0.0", + "@types/jest": "^29.5.3", + "@types/node": "^18.0.0", "aws-cdk": "^2.142.1", "jest": "^29.5.0", - "ts-jest": "^24.1.0", - "ts-node": "^8.1.0", - "typescript": "~3.7.2" + "ts-jest": "^29.1.0", + "ts-node": "^10.9.1", + "typescript": "^5.0.0" }, "dependencies": { - "aws-cdk-lib": "^2.1.0", - "constructs": "^10.0.0", - "source-map-support": "^0.5.16" + "aws-cdk-lib": "^2.142.1", + "constructs": "^10.1.227", + "source-map-support": "^0.5.21" } } From 7fc7dd5b09d4119cbc0ea619b42052f7c8d8934c Mon Sep 17 00:00:00 2001 From: Ian Falconer <38296760+leftbrainstuff@users.noreply.github.com> Date: Sat, 1 Jun 2024 01:12:08 +0200 Subject: [PATCH 3/5] Update textract-pipeline-stack.ts Update lambda python version to 3.12 was 3.7 to supported aws lambda runtime --- textract-pipeline/lib/textract-pipeline-stack.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/textract-pipeline/lib/textract-pipeline-stack.ts b/textract-pipeline/lib/textract-pipeline-stack.ts index 10c325a7..845d50b5 100644 --- a/textract-pipeline/lib/textract-pipeline-stack.ts +++ b/textract-pipeline/lib/textract-pipeline-stack.ts @@ -92,7 +92,7 @@ export class TextractPipelineStack extends cdk.Stack { // Helper Layer with helper functions const helperLayer = new lambda.LayerVersion(this, 'HelperLayer', { code: lambda.Code.fromAsset('lambda/helper'), - compatibleRuntimes: [lambda.Runtime.PYTHON_3_7], + compatibleRuntimes: [lambda.Runtime.PYTHON_3_12], license: 'Apache-2.0', description: 'Helper layer.', }); @@ -100,7 +100,7 @@ export class TextractPipelineStack extends cdk.Stack { // Textractor helper layer const textractorLayer = new lambda.LayerVersion(this, 'Textractor', { code: lambda.Code.fromAsset('lambda/textractor'), - compatibleRuntimes: [lambda.Runtime.PYTHON_3_7], + compatibleRuntimes: [lambda.Runtime.PYTHON_3_12], license: 'Apache-2.0', description: 'Textractor layer.', }); @@ -109,7 +109,7 @@ export class TextractPipelineStack extends cdk.Stack { // S3 Event processor const s3Processor = new lambda.Function(this, 'S3Processor', { - runtime: lambda.Runtime.PYTHON_3_7, + runtime: lambda.Runtime.PYTHON_3_12, code: lambda.Code.fromAsset('lambda/s3processor'), handler: 'lambda_function.lambda_handler', timeout: cdk.Duration.seconds(30), @@ -148,7 +148,7 @@ export class TextractPipelineStack extends cdk.Stack { // S3 Batch Operations Event processor const s3BatchProcessor = new lambda.Function(this, 'S3BatchProcessor', { - runtime: lambda.Runtime.PYTHON_3_7, + runtime: lambda.Runtime.PYTHON_3_12, code: lambda.Code.fromAsset('lambda/s3batchprocessor'), handler: 'lambda_function.lambda_handler', timeout: cdk.Duration.seconds(30), @@ -173,7 +173,7 @@ export class TextractPipelineStack extends cdk.Stack { // Document processor (Router to Sync/Async Pipeline) const documentProcessor = new lambda.Function(this, 'TaskProcessor', { - runtime: lambda.Runtime.PYTHON_3_7, + runtime: lambda.Runtime.PYTHON_3_12, code: lambda.Code.fromAsset('lambda/documentprocessor'), handler: 'lambda_function.lambda_handler', timeout: cdk.Duration.seconds(900), @@ -198,7 +198,7 @@ export class TextractPipelineStack extends cdk.Stack { // Sync Jobs Processor (Process jobs using sync APIs) const syncProcessor = new lambda.Function(this, 'SyncProcessor', { - runtime: lambda.Runtime.PYTHON_3_7, + runtime: lambda.Runtime.PYTHON_3_12, code: lambda.Code.fromAsset('lambda/syncprocessor'), handler: 'lambda_function.lambda_handler', reservedConcurrentExecutions: 1, @@ -232,7 +232,7 @@ export class TextractPipelineStack extends cdk.Stack { // Async Job Processor (Start jobs using Async APIs) const asyncProcessor = new lambda.Function(this, 'ASyncProcessor', { - runtime: lambda.Runtime.PYTHON_3_7, + runtime: lambda.Runtime.PYTHON_3_12, code: lambda.Code.fromAsset('lambda/asyncprocessor'), handler: 'lambda_function.lambda_handler', reservedConcurrentExecutions: 1, @@ -278,7 +278,7 @@ export class TextractPipelineStack extends cdk.Stack { // Async Jobs Results Processor const jobResultProcessor = new lambda.Function(this, 'JobResultProcessor', { - runtime: lambda.Runtime.PYTHON_3_7, + runtime: lambda.Runtime.PYTHON_3_12, code: lambda.Code.fromAsset('lambda/jobresultprocessor'), handler: 'lambda_function.lambda_handler', memorySize: 2000, From 5db6a4321a6b70052bdff1007fd66e6dfb68a31a Mon Sep 17 00:00:00 2001 From: Ian Falconer <38296760+leftbrainstuff@users.noreply.github.com> Date: Sat, 1 Jun 2024 01:30:58 +0200 Subject: [PATCH 4/5] Update tsconfig.json Update es2020 was es2018 to resolve ts deploy error --- textract-pipeline/tsconfig.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/textract-pipeline/tsconfig.json b/textract-pipeline/tsconfig.json index 03c16d26..2ffc6dce 100644 --- a/textract-pipeline/tsconfig.json +++ b/textract-pipeline/tsconfig.json @@ -2,7 +2,7 @@ "compilerOptions": { "target":"ES2018", "module": "commonjs", - "lib": ["es2018"], + "lib": ["es2020"], "declaration": true, "strict": true, "noImplicitAny": true, From 2ce2bdcb6613527033dde3a7b269bdbe1aab5be2 Mon Sep 17 00:00:00 2001 From: Ian Falconer <38296760+leftbrainstuff@users.noreply.github.com> Date: Sat, 1 Jun 2024 01:50:14 +0200 Subject: [PATCH 5/5] Update textract-pipeline-stack.ts Update JAVA version to an aws supported runtime --- textract-pipeline/lib/textract-pipeline-stack.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/textract-pipeline/lib/textract-pipeline-stack.ts b/textract-pipeline/lib/textract-pipeline-stack.ts index 845d50b5..541abdeb 100644 --- a/textract-pipeline/lib/textract-pipeline-stack.ts +++ b/textract-pipeline/lib/textract-pipeline-stack.ts @@ -312,7 +312,7 @@ export class TextractPipelineStack extends cdk.Stack { //-------------- // PDF Generator const pdfGenerator = new lambda.Function(this, 'PdfGenerator', { - runtime: lambda.Runtime.JAVA_8, + runtime: lambda.Runtime.JAVA_11, code: lambda.Code.fromAsset('lambda/pdfgenerator'), handler: 'DemoLambdaV2::handleRequest', memorySize: 3000,