Skip to content

Commit f308c02

Browse files
bweigelbweigel
authored andcommitted
docs: update to al2 examples
1 parent 9356f2c commit f308c02

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

README.md

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ Tesseract OCR Lambda Layer
3333

3434
# Quickstart
3535

36-
This repo comes with ready-to-use binaries compiled against the AWS Lambda Runtimes (based on Amazonlinux 1).
37-
Example Projects in Python 3.6 using Serverless Framework and CDK are provided:
36+
This repo comes with ready-to-use binaries compiled against the AWS Lambda Runtimes (based on Amazon Linux 1 and 2).
37+
Example Projects in Python 3.6 (& 3.8) using Serverless Framework and CDK are provided:
3838

3939
```bash
4040
## Demo using Serverless Framework and prebuilt layer
41-
cd example/serverless-framework
41+
cd example/serverless
4242
npm ci
4343
npx sls deploy
4444

@@ -69,20 +69,19 @@ provider:
6969

7070
# define layer
7171
layers:
72-
tesseractAl1:
72+
tesseractAl2:
7373
# and path to contents
74-
path: ready-to-use/amazonlinux-1
74+
path: ready-to-use/amazonlinux-2
7575
compatibleRuntimes:
76-
- python3.6
77-
- python3.7
76+
- python3.8
7877

7978
functions:
8079
tesseract-ocr:
8180
handler: ...
82-
runtime: python3.6
81+
runtime: python3.8
8382
# reference layer in function
8483
layers:
85-
- { Ref: TesseractAl1LambdaLayer }
84+
- { Ref: TesseractAl2LambdaLayer }
8685
events:
8786
- http:
8887
path: ocr
@@ -105,17 +104,17 @@ Reference the path to the layer contents in your constructs:
105104
const app = new App();
106105
const stack = new Stack(app, 'tesseract-lambda-ci');
107106

108-
const al1Layer = new lambda.LayerVersion(stack, 'al1-layer', {
107+
const al2Layer = new lambda.LayerVersion(stack, 'al2-layer', {
109108
// reference the directory containing the ready-to-use layer
110-
code: Code.fromAsset(path.resolve(__dirname, './ready-to-use/amazonlinux-1')),
109+
code: Code.fromAsset(path.resolve(__dirname, './ready-to-use/amazonlinux-2')),
111110
description: 'AL1 Tesseract Layer',
112111
});
113-
new lambda.Function(stack, 'python3.6', {
112+
new lambda.Function(stack, 'python38', {
114113
// reference the source code to your function
115114
code: lambda.Code.fromAsset(path.resolve(__dirname, 'lambda-handlers')),
116-
runtime: Runtime.PYTHON_3_6,
115+
runtime: Runtime.PYTHON_3_8,
117116
// add tesseract layer to function
118-
layers: [al1Layer],
117+
layers: [al2Layer],
119118
memorySize: 512,
120119
timeout: Duration.seconds(30),
121120
handler: 'handler.main',

0 commit comments

Comments
 (0)