-
Notifications
You must be signed in to change notification settings - Fork 2
/
serverless.yml
47 lines (44 loc) · 1.07 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
service: aws-lambda-image-processor
plugins:
- serverless-dotenv-plugin
provider:
name: aws
runtime: nodejs12.x
profile: default
timeout: 10
region: ${env:LAMBDA_REGION}
iamRoleStatements:
- Effect: Allow
Action:
- s3:PutObject
- s3:PutObjectAcl
Resource: "arn:aws:s3:::${env:OUTPUT_BUCKET}/*"
- Effect: Allow
Action:
- s3:GetObject
- s3:GetObjectAcl
Resource: "arn:aws:s3:::${env:INPUT_BUCKET}/*"
functions:
processor:
handler: dist/index.handler
environment:
OUTPUT_BUCKET: ${env:OUTPUT_BUCKET}
events:
- s3:
bucket: ${env:INPUT_BUCKET}
event: s3:ObjectCreated:Put
rules:
- prefix: originals/
existing: true
- s3:
bucket: ${env:INPUT_BUCKET}
event: s3:ObjectCreated:Post
rules:
- prefix: originals/
existing: true
- s3:
bucket: ${env:INPUT_BUCKET}
event: s3:ObjectCreated:CompleteMultipartUpload
rules:
- prefix: originals/
existing: true