-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserverless.yml
68 lines (62 loc) · 1.32 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
service: aws-rekognition-sandbox
frameworkVersion: '3'
plugins:
- serverless-prune-plugin
provider:
name: aws
runtime: go1.x
stage: ${env:DEPLOY_STAGE}
region: ${env:REGION}
profile: ${self:custom.profiles.${self:provider.stage}}
logRetentionInDays: 3
lambdaHashingVersion: 20201221
iam:
role:
statements:
- Effect: Allow
Action:
- s3:*
Resource: "*"
- Effect: Allow
Action:
- rekognition:*
Resource: "*"
environment:
DEPLOY_STAGE: ${env:DEPLOY_STAGE}
TRIGGER_BUCKET_NAME: ${env:TRIGGER_BUCKET_NAME}
REGION: ${env:REGION}
httpApi:
cors: true
custom:
defaultStage: dev
profiles:
dev: nekochans-dev
prune:
automatic: true
number: 1
package:
patterns:
- '!./**'
- ./bin/**
functions:
imageRecognition:
handler: bin/imagerecognition
events:
- httpApi:
method: POST
path: /images/recognition
detectFaces:
handler: bin/detectfaces
events:
- httpApi:
method: POST
path: /images/faces
isAcceptableCatImage:
handler: bin/isacceptablecatimage
events:
- s3:
bucket: ${env:TRIGGER_BUCKET_NAME}
event: s3:ObjectCreated:*
rules:
- prefix: tmp/
existing: true