-
Notifications
You must be signed in to change notification settings - Fork 5.7k
/
serverless.yml
82 lines (78 loc) · 1.99 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
service: service
configValidationMode: error
provider:
name: aws
runtime: nodejs16.x
versionFunctions: false
s3:
customBucket:
name: ${self:service}-custom-bucket-${opt:stage, 'dev'}
publicAccessBlockConfiguration:
BlockPublicAcls: true
BlockPublicPolicy: true
IgnorePublicAcls: true
RestrictPublicBuckets: true
functions:
minimal:
handler: core.minimal
events:
- s3: ${self:service}-s3-minimal
extended:
handler: core.extended
events:
- s3:
bucket: ${self:service}-s3-extended
event: s3:ObjectRemoved:*
rules:
- prefix: photos/
- suffix: .jpg
custom:
handler: core.custom
events:
- s3:
bucket: customBucket
existing:
handler: core.existing
events:
- s3:
bucket: ${self:service}-s3-existing-simple
event: s3:ObjectCreated:*
rules:
- prefix: Files/
- suffix: .TXT
existing: true
# testing if two functions share one bucket with multiple bucket configs
existingCreated:
handler: core.existingCreated
events:
- s3:
bucket: ${self:service}-s3-existing-complex
event: s3:ObjectCreated:*
rules:
- prefix: photos
- suffix: .jpg
existing: true
- s3:
bucket: ${self:service}-s3-existing-complex
event: s3:ObjectCreated:*
rules:
- prefix: photos
- suffix: .png
existing: true
existingRemoved:
handler: core.existingRemoved
events:
- s3:
bucket: ${self:service}-s3-existing-complex
event: s3:ObjectRemoved:*
rules:
- prefix: photos
- suffix: .jpg
existing: true
- s3:
bucket: ${self:service}-s3-existing-complex
event: s3:ObjectRemoved:*
rules:
- prefix: photos
- suffix: .png
existing: true