-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserverless.yml
68 lines (61 loc) · 1.51 KB
/
serverless.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# serverless.yml
service: Textractgc
provider:
name: aws
runtime: python3.8
stage: dev
region: us-gov-east-1
memorySize: 700
logRetentionInDays: 30
lambdaHashingVersion: 20201221 #set harsh version to avoid warning
versionFunctions: false # Optional function versioning
environment:
BUCKET_SRC: 'nara-census-jpg-prod-gc'
BUCKET_DST: 'nara-textract-gc'
REGION: 'us-gov-east-1'
layers:
Python:
path: dependencies
description: Python env
compatibleRuntimes:
- python3.8
package:
artifact: dependencies.zip
package:
patterns:
- '!**'
- './src/**'
- './handler.py'
- '!./src/__pycache__/**'
- '!./src/tmp/**'
functions:
textract:
handler: handler.textract
reservedConcurrency: 100
timeout: 900
events:
- sqs:
batchSize: 10
maximumBatchingWindow: 2
arn:
Fn::GetAtt:
- TextractQueue
- Arn
layers:
- Ref: PythonLambdaLayer
vpc:
securityGroupIds:
- sg-093533cfa782a6c56
subnetIds:
- subnet-039f9f66e6f8c148b
- subnet-026379b7d4054d6b0
- subnet-062825a9a2293f128
resources:
Resources:
TextractQueue:
Type: "AWS::SQS::Queue"
Properties:
QueueName: "TextractQueue"
MessageRetentionPeriod: 1209600 # set retention period to 14 days (max 14 days on AWS, default 4 days)
VisibilityTimeout: 901 #need to be equal and bigger than timeout
DelaySeconds: 2