This repository has been archived by the owner on Mar 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 28
/
serverless.yml
94 lines (84 loc) · 2.17 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
service: ${self:custom.project.name}
provider:
name: aws
runtime: nodejs6.10
profile: ${self:custom.project.provider.profile}
stage: ${self:custom.project.provider.stage}
region: ${self:custom.project.provider.region}
iamRoleStatements:
- Effect: "Allow"
Action:
- "s3:ListBucket"
- "s3:GetObject"
- "s3:GetObjectAcl"
Resource:
Fn::Join:
- ""
- - "arn:aws:s3:::"
- ${self:custom.project.sourceBucket}
- "/"
- ${self:custom.project.sourcePrefix}
- "*"
- Effect: "Allow"
Action:
- "s3:ListBucket"
- "s3:PutObject"
- "s3:DeleteObject"
- "s3:GetObjectAcl"
- "s3:ListBucketMultipartUploads"
- "s3:ListMultipartUploadParts"
- "s3:PutObject"
- "s3:PutObjectAcl"
- "s3:PutObjectTagging"
- "s3:PutObjectVersionAcl"
- "s3:PutObjectVersionTagging"
Resource:
Fn::Join:
- ""
- - "arn:aws:s3:::"
- ${self:custom.project.destinationBucket}
- "/"
- ${self:custom.project.destinationPrefix}
- "*"
- Effect: "Allow"
Action:
- rekognition:DetectFaces
custom:
webpackIncludeModules: false # disable auto including modules
project: ${file(src/config.js):serverless}
plugins:
- serverless-webpack
package:
exclude:
- .serverless
- .webpack
- coverage
- .babelrc
- .eslintignore
- .eslintrc
- .gitignore
- LICENSE
- package.json
- README.md
- serverless.yml
- webpack.config.js
functions:
sharpImage:
description: Resizes images
memorySize: 1024
timeout: 30
handler: handler.processImage
events:
- s3:
bucket: ${self:custom.project.sourceBucket}
event: s3:ObjectCreated:*
rules:
- prefix: ${self:custom.project.sourcePrefix}
# Comment out the imageDestinationBucket section
# if you want to use previously existing buckets
resources:
Resources:
imageDestinationBucket:
Type: AWS::S3::Bucket
Properties:
BucketName: ${self:custom.project.destinationBucket}