-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yml
44 lines (41 loc) · 1.08 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
service: FoodDx-DEVELOPMENT
custom:
pythonRequirements:
dockerFile: Dockerfile
dockerizePip: non-linux
dockerExtraFiles:
- /lib64/libgthread-2.0.so.0
- /lib64/libglib-2.0.so.0
useDownloadCache: false
useStaticCache: false
noDeploy: []
OPENCV_PROCESS_BUCKET: kahlil-test-image-upload-bucket
OPENCV_OUTPUT_BUCKET: kahlil-test-images-to-be-rated
provider:
name: aws
runtime: python3.8
region: ap-southeast-1
iamRoleStatements:
- Effect: Allow
Action:
- s3:GetObject
Resource:
- arn:aws:s3:::${self:custom.OPENCV_PROCESS_BUCKET}/*
- Effect: Allow
Action:
- s3:PutObject
Resource:
- arn:aws:s3:::${self:custom.OPENCV_OUTPUT_BUCKET}/*
environment:
OPENCV_OUTPUT_BUCKET: ${self:custom.OPENCV_OUTPUT_BUCKET}
functions:
opencv-python-resizer:
handler: handler.opencv
events:
- existingS3:
bucket: ${self:custom.OPENCV_PROCESS_BUCKET}
events:
- s3:ObjectCreated:*
plugins:
- serverless-python-requirements
- serverless-plugin-existing-s3